1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * ident "%Z%%M% %I% %E% SMI" 24*0Sstevel@tonic-gate * 25*0Sstevel@tonic-gate * Copyright (c) 2001 by Sun Microsystems, Inc. 26*0Sstevel@tonic-gate * All rights reserved. 27*0Sstevel@tonic-gate * 28*0Sstevel@tonic-gate */ 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate /** 31*0Sstevel@tonic-gate * This file was originally automatically generated by Java WorkShop. 32*0Sstevel@tonic-gate * 33*0Sstevel@tonic-gate * Runtime vendor: SunSoft, Inc. 34*0Sstevel@tonic-gate * Runtime version: 1.0 35*0Sstevel@tonic-gate * 36*0Sstevel@tonic-gate * Visual vendor: SunSoft, Inc. 37*0Sstevel@tonic-gate * Visual version: 1.0 38*0Sstevel@tonic-gate */ 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate 41*0Sstevel@tonic-gate import sunsoft.jws.visual.rt.base.*; 42*0Sstevel@tonic-gate import sunsoft.jws.visual.rt.type.*; 43*0Sstevel@tonic-gate import java.awt.Event; 44*0Sstevel@tonic-gate 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gate public class KdcGuiOps extends Operations { 47*0Sstevel@tonic-gate private Op ops[]; 48*0Sstevel@tonic-gate 49*0Sstevel@tonic-gate private KdcGui group; 50*0Sstevel@tonic-gate private KdcGuiRoot gui; 51*0Sstevel@tonic-gate setGroup(Group group)52*0Sstevel@tonic-gate public void setGroup(Group group) { 53*0Sstevel@tonic-gate this.group = (KdcGui)group; 54*0Sstevel@tonic-gate } 55*0Sstevel@tonic-gate setRoot(Root root)56*0Sstevel@tonic-gate public void setRoot(Root root) { 57*0Sstevel@tonic-gate this.gui = (KdcGuiRoot)root; 58*0Sstevel@tonic-gate if (ops == null) 59*0Sstevel@tonic-gate initializeOps(); 60*0Sstevel@tonic-gate } 61*0Sstevel@tonic-gate handleMessage(Message msg)62*0Sstevel@tonic-gate public boolean handleMessage(Message msg) { 63*0Sstevel@tonic-gate for (int i = 0; i < ops.length; i++) { 64*0Sstevel@tonic-gate if (ops[i].hasCode()) { 65*0Sstevel@tonic-gate if (ops[i].matchMessage(msg)) { 66*0Sstevel@tonic-gate handleCallback(i, msg, 67*0Sstevel@tonic-gate (msg.isAWT ? (Event)msg.arg : null)); 68*0Sstevel@tonic-gate } 69*0Sstevel@tonic-gate } else { 70*0Sstevel@tonic-gate ops[i].handleMessage(msg); 71*0Sstevel@tonic-gate } 72*0Sstevel@tonic-gate } 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate return false; 75*0Sstevel@tonic-gate } 76*0Sstevel@tonic-gate initializeOps()77*0Sstevel@tonic-gate private void initializeOps() { 78*0Sstevel@tonic-gate ops = new Op[17]; 79*0Sstevel@tonic-gate 80*0Sstevel@tonic-gate ops[0] = new Op(gui); 81*0Sstevel@tonic-gate ops[0].name = "Op1"; 82*0Sstevel@tonic-gate ops[0].filter = new OpFilter(); 83*0Sstevel@tonic-gate ops[0].filter.filterType = OpFilter.EVENT; 84*0Sstevel@tonic-gate ops[0].filter.target = gui.Exit2; 85*0Sstevel@tonic-gate ops[0].filter.id = 1001; 86*0Sstevel@tonic-gate ops[0].action = new OpAction(); 87*0Sstevel@tonic-gate ops[0].action.actionType = OpAction.CODE; 88*0Sstevel@tonic-gate 89*0Sstevel@tonic-gate ops[1] = new Op(gui); 90*0Sstevel@tonic-gate ops[1].name = "Op1"; 91*0Sstevel@tonic-gate ops[1].filter = new OpFilter(); 92*0Sstevel@tonic-gate ops[1].filter.filterType = OpFilter.EVENT; 93*0Sstevel@tonic-gate ops[1].filter.target = gui.browserHelp1; 94*0Sstevel@tonic-gate ops[1].filter.id = 1001; 95*0Sstevel@tonic-gate ops[1].action = new OpAction(); 96*0Sstevel@tonic-gate ops[1].action.actionType = OpAction.CODE; 97*0Sstevel@tonic-gate 98*0Sstevel@tonic-gate ops[2] = new Op(gui); 99*0Sstevel@tonic-gate ops[2].name = "Op1"; 100*0Sstevel@tonic-gate ops[2].filter = new OpFilter(); 101*0Sstevel@tonic-gate ops[2].filter.filterType = OpFilter.EVENT; 102*0Sstevel@tonic-gate ops[2].filter.target = gui.Context2; 103*0Sstevel@tonic-gate ops[2].filter.id = 1001; 104*0Sstevel@tonic-gate ops[2].action = new OpAction(); 105*0Sstevel@tonic-gate ops[2].action.actionType = OpAction.CODE; 106*0Sstevel@tonic-gate 107*0Sstevel@tonic-gate ops[3] = new Op(gui); 108*0Sstevel@tonic-gate ops[3].name = "Op1"; 109*0Sstevel@tonic-gate ops[3].filter = new OpFilter(); 110*0Sstevel@tonic-gate ops[3].filter.filterType = OpFilter.EVENT; 111*0Sstevel@tonic-gate ops[3].filter.target = gui.About2; 112*0Sstevel@tonic-gate ops[3].filter.id = 1001; 113*0Sstevel@tonic-gate ops[3].action = new OpAction(); 114*0Sstevel@tonic-gate ops[3].action.actionType = OpAction.CODE; 115*0Sstevel@tonic-gate 116*0Sstevel@tonic-gate ops[4] = new Op(gui); 117*0Sstevel@tonic-gate ops[4].name = "Exit"; 118*0Sstevel@tonic-gate ops[4].filter = new OpFilter(); 119*0Sstevel@tonic-gate ops[4].filter.filterType = OpFilter.EVENT; 120*0Sstevel@tonic-gate ops[4].filter.target = gui.mainframe; 121*0Sstevel@tonic-gate ops[4].filter.id = 1001; 122*0Sstevel@tonic-gate ops[4].action = new OpAction(); 123*0Sstevel@tonic-gate ops[4].action.actionType = OpAction.CODE; 124*0Sstevel@tonic-gate 125*0Sstevel@tonic-gate ops[5] = new Op(gui); 126*0Sstevel@tonic-gate ops[5].name = "Op1"; 127*0Sstevel@tonic-gate ops[5].filter = new OpFilter(); 128*0Sstevel@tonic-gate ops[5].filter.filterType = OpFilter.EVENT; 129*0Sstevel@tonic-gate ops[5].filter.target = gui.PrintCurPr; 130*0Sstevel@tonic-gate ops[5].filter.id = 1001; 131*0Sstevel@tonic-gate ops[5].action = new OpAction(); 132*0Sstevel@tonic-gate ops[5].action.actionType = OpAction.CODE; 133*0Sstevel@tonic-gate 134*0Sstevel@tonic-gate ops[6] = new Op(gui); 135*0Sstevel@tonic-gate ops[6].name = "Op1"; 136*0Sstevel@tonic-gate ops[6].filter = new OpFilter(); 137*0Sstevel@tonic-gate ops[6].filter.filterType = OpFilter.EVENT; 138*0Sstevel@tonic-gate ops[6].filter.target = gui.PrintCurPol; 139*0Sstevel@tonic-gate ops[6].filter.id = 1001; 140*0Sstevel@tonic-gate ops[6].action = new OpAction(); 141*0Sstevel@tonic-gate ops[6].action.actionType = OpAction.CODE; 142*0Sstevel@tonic-gate 143*0Sstevel@tonic-gate ops[7] = new Op(gui); 144*0Sstevel@tonic-gate ops[7].name = "Op1"; 145*0Sstevel@tonic-gate ops[7].filter = new OpFilter(); 146*0Sstevel@tonic-gate ops[7].filter.filterType = OpFilter.EVENT; 147*0Sstevel@tonic-gate ops[7].filter.target = gui.PrintPrlist; 148*0Sstevel@tonic-gate ops[7].filter.id = 1001; 149*0Sstevel@tonic-gate ops[7].action = new OpAction(); 150*0Sstevel@tonic-gate ops[7].action.actionType = OpAction.CODE; 151*0Sstevel@tonic-gate 152*0Sstevel@tonic-gate ops[8] = new Op(gui); 153*0Sstevel@tonic-gate ops[8].name = "Op1"; 154*0Sstevel@tonic-gate ops[8].filter = new OpFilter(); 155*0Sstevel@tonic-gate ops[8].filter.filterType = OpFilter.EVENT; 156*0Sstevel@tonic-gate ops[8].filter.target = gui.PrintPollist; 157*0Sstevel@tonic-gate ops[8].filter.id = 1001; 158*0Sstevel@tonic-gate ops[8].action = new OpAction(); 159*0Sstevel@tonic-gate ops[8].action.actionType = OpAction.CODE; 160*0Sstevel@tonic-gate 161*0Sstevel@tonic-gate ops[9] = new Op(gui); 162*0Sstevel@tonic-gate ops[9].name = "Op1"; 163*0Sstevel@tonic-gate ops[9].filter = new OpFilter(); 164*0Sstevel@tonic-gate ops[9].filter.filterType = OpFilter.EVENT; 165*0Sstevel@tonic-gate ops[9].filter.target = gui.logout; 166*0Sstevel@tonic-gate ops[9].filter.id = 1001; 167*0Sstevel@tonic-gate ops[9].action = new OpAction(); 168*0Sstevel@tonic-gate ops[9].action.actionType = OpAction.CODE; 169*0Sstevel@tonic-gate 170*0Sstevel@tonic-gate ops[10] = new Op(gui); 171*0Sstevel@tonic-gate ops[10].name = "Exit"; 172*0Sstevel@tonic-gate ops[10].filter = new OpFilter(); 173*0Sstevel@tonic-gate ops[10].filter.filterType = OpFilter.EVENT; 174*0Sstevel@tonic-gate ops[10].filter.target = gui.Exit; 175*0Sstevel@tonic-gate ops[10].filter.id = 1001; 176*0Sstevel@tonic-gate ops[10].action = new OpAction(); 177*0Sstevel@tonic-gate ops[10].action.actionType = OpAction.CODE; 178*0Sstevel@tonic-gate 179*0Sstevel@tonic-gate ops[11] = new Op(gui); 180*0Sstevel@tonic-gate ops[11].name = "Op1"; 181*0Sstevel@tonic-gate ops[11].filter = new OpFilter(); 182*0Sstevel@tonic-gate ops[11].filter.filterType = OpFilter.EVENT; 183*0Sstevel@tonic-gate ops[11].filter.target = gui.editPreferences; 184*0Sstevel@tonic-gate ops[11].filter.id = 1001; 185*0Sstevel@tonic-gate ops[11].action = new OpAction(); 186*0Sstevel@tonic-gate ops[11].action.actionType = OpAction.CODE; 187*0Sstevel@tonic-gate 188*0Sstevel@tonic-gate ops[12] = new Op(gui); 189*0Sstevel@tonic-gate ops[12].name = "Op1"; 190*0Sstevel@tonic-gate ops[12].filter = new OpFilter(); 191*0Sstevel@tonic-gate ops[12].filter.filterType = OpFilter.EVENT; 192*0Sstevel@tonic-gate ops[12].filter.target = gui.refreshPrincipals; 193*0Sstevel@tonic-gate ops[12].filter.id = 1001; 194*0Sstevel@tonic-gate ops[12].action = new OpAction(); 195*0Sstevel@tonic-gate ops[12].action.actionType = OpAction.CODE; 196*0Sstevel@tonic-gate 197*0Sstevel@tonic-gate ops[13] = new Op(gui); 198*0Sstevel@tonic-gate ops[13].name = "Op1"; 199*0Sstevel@tonic-gate ops[13].filter = new OpFilter(); 200*0Sstevel@tonic-gate ops[13].filter.filterType = OpFilter.EVENT; 201*0Sstevel@tonic-gate ops[13].filter.target = gui.refreshPolicies; 202*0Sstevel@tonic-gate ops[13].filter.id = 1001; 203*0Sstevel@tonic-gate ops[13].action = new OpAction(); 204*0Sstevel@tonic-gate ops[13].action.actionType = OpAction.CODE; 205*0Sstevel@tonic-gate 206*0Sstevel@tonic-gate ops[14] = new Op(gui); 207*0Sstevel@tonic-gate ops[14].name = "Op1"; 208*0Sstevel@tonic-gate ops[14].filter = new OpFilter(); 209*0Sstevel@tonic-gate ops[14].filter.filterType = OpFilter.EVENT; 210*0Sstevel@tonic-gate ops[14].filter.target = gui.browserHelp2; 211*0Sstevel@tonic-gate ops[14].filter.id = 1001; 212*0Sstevel@tonic-gate ops[14].action = new OpAction(); 213*0Sstevel@tonic-gate ops[14].action.actionType = OpAction.CODE; 214*0Sstevel@tonic-gate 215*0Sstevel@tonic-gate ops[15] = new Op(gui); 216*0Sstevel@tonic-gate ops[15].name = "Op1"; 217*0Sstevel@tonic-gate ops[15].filter = new OpFilter(); 218*0Sstevel@tonic-gate ops[15].filter.filterType = OpFilter.EVENT; 219*0Sstevel@tonic-gate ops[15].filter.target = gui.Context; 220*0Sstevel@tonic-gate ops[15].filter.id = 1001; 221*0Sstevel@tonic-gate ops[15].action = new OpAction(); 222*0Sstevel@tonic-gate ops[15].action.actionType = OpAction.CODE; 223*0Sstevel@tonic-gate 224*0Sstevel@tonic-gate ops[16] = new Op(gui); 225*0Sstevel@tonic-gate ops[16].name = "Op1"; 226*0Sstevel@tonic-gate ops[16].filter = new OpFilter(); 227*0Sstevel@tonic-gate ops[16].filter.filterType = OpFilter.EVENT; 228*0Sstevel@tonic-gate ops[16].filter.target = gui.About; 229*0Sstevel@tonic-gate ops[16].filter.id = 1001; 230*0Sstevel@tonic-gate ops[16].action = new OpAction(); 231*0Sstevel@tonic-gate ops[16].action.actionType = OpAction.CODE; 232*0Sstevel@tonic-gate } 233*0Sstevel@tonic-gate handleCallback(int index, Message msg, Event evt)234*0Sstevel@tonic-gate private void handleCallback(int index, Message msg, Event evt) { 235*0Sstevel@tonic-gate switch (index) { 236*0Sstevel@tonic-gate case 0: 237*0Sstevel@tonic-gate { 238*0Sstevel@tonic-gate group.checkExit( 239*0Sstevel@tonic-gate (java.awt.Frame)gui.loginframe.getBody()); 240*0Sstevel@tonic-gate } 241*0Sstevel@tonic-gate break; 242*0Sstevel@tonic-gate case 1: 243*0Sstevel@tonic-gate { 244*0Sstevel@tonic-gate group.checkHelp( 245*0Sstevel@tonic-gate (java.awt.Frame)gui.loginframe.getBody()); 246*0Sstevel@tonic-gate } 247*0Sstevel@tonic-gate break; 248*0Sstevel@tonic-gate case 2: 249*0Sstevel@tonic-gate { 250*0Sstevel@tonic-gate group.checkContextSensitiveHelp( 251*0Sstevel@tonic-gate (java.awt.Frame)gui.loginframe.getBody()); 252*0Sstevel@tonic-gate } 253*0Sstevel@tonic-gate break; 254*0Sstevel@tonic-gate case 3: 255*0Sstevel@tonic-gate { 256*0Sstevel@tonic-gate group.checkAbout( 257*0Sstevel@tonic-gate (java.awt.Frame)gui.loginframe.getBody()); 258*0Sstevel@tonic-gate } 259*0Sstevel@tonic-gate break; 260*0Sstevel@tonic-gate case 4: 261*0Sstevel@tonic-gate { 262*0Sstevel@tonic-gate group.exit(); 263*0Sstevel@tonic-gate } 264*0Sstevel@tonic-gate break; 265*0Sstevel@tonic-gate case 5: 266*0Sstevel@tonic-gate { 267*0Sstevel@tonic-gate group.checkPrintCurPr(); 268*0Sstevel@tonic-gate } 269*0Sstevel@tonic-gate break; 270*0Sstevel@tonic-gate case 6: 271*0Sstevel@tonic-gate { 272*0Sstevel@tonic-gate group.checkPrintCurPol(); 273*0Sstevel@tonic-gate } 274*0Sstevel@tonic-gate break; 275*0Sstevel@tonic-gate case 7: 276*0Sstevel@tonic-gate { 277*0Sstevel@tonic-gate group.checkPrintPrList(); 278*0Sstevel@tonic-gate } 279*0Sstevel@tonic-gate break; 280*0Sstevel@tonic-gate case 8: 281*0Sstevel@tonic-gate { 282*0Sstevel@tonic-gate group.checkPrintPoList(); 283*0Sstevel@tonic-gate } 284*0Sstevel@tonic-gate break; 285*0Sstevel@tonic-gate case 9: 286*0Sstevel@tonic-gate { 287*0Sstevel@tonic-gate group.checkLogout(); 288*0Sstevel@tonic-gate } 289*0Sstevel@tonic-gate break; 290*0Sstevel@tonic-gate case 10: 291*0Sstevel@tonic-gate { 292*0Sstevel@tonic-gate group.checkExit( 293*0Sstevel@tonic-gate (java.awt.Frame)gui.mainframe.getBody()); 294*0Sstevel@tonic-gate } 295*0Sstevel@tonic-gate break; 296*0Sstevel@tonic-gate case 11: 297*0Sstevel@tonic-gate { 298*0Sstevel@tonic-gate group.checkEditPreferences(); 299*0Sstevel@tonic-gate } 300*0Sstevel@tonic-gate break; 301*0Sstevel@tonic-gate case 12: 302*0Sstevel@tonic-gate { 303*0Sstevel@tonic-gate group.checkRefreshPrincipals(); 304*0Sstevel@tonic-gate } 305*0Sstevel@tonic-gate break; 306*0Sstevel@tonic-gate case 13: 307*0Sstevel@tonic-gate { 308*0Sstevel@tonic-gate group.checkRefreshPolicies(); 309*0Sstevel@tonic-gate } 310*0Sstevel@tonic-gate break; 311*0Sstevel@tonic-gate case 14: 312*0Sstevel@tonic-gate { 313*0Sstevel@tonic-gate group.checkHelp( 314*0Sstevel@tonic-gate (java.awt.Frame)gui.mainframe.getBody()); 315*0Sstevel@tonic-gate } 316*0Sstevel@tonic-gate break; 317*0Sstevel@tonic-gate case 15: 318*0Sstevel@tonic-gate { 319*0Sstevel@tonic-gate group.checkContextSensitiveHelp( 320*0Sstevel@tonic-gate (java.awt.Frame)gui.mainframe.getBody()); 321*0Sstevel@tonic-gate } 322*0Sstevel@tonic-gate break; 323*0Sstevel@tonic-gate case 16: 324*0Sstevel@tonic-gate { 325*0Sstevel@tonic-gate group.checkAbout( 326*0Sstevel@tonic-gate (java.awt.Frame)gui.mainframe.getBody()); 327*0Sstevel@tonic-gate } 328*0Sstevel@tonic-gate break; 329*0Sstevel@tonic-gate default: 330*0Sstevel@tonic-gate throw new Error("Bad callback index: " + index); 331*0Sstevel@tonic-gate } 332*0Sstevel@tonic-gate } 333*0Sstevel@tonic-gate 334*0Sstevel@tonic-gate 335*0Sstevel@tonic-gate // methods from lib/visual/gen/methods.java 336*0Sstevel@tonic-gate 337*0Sstevel@tonic-gate /** 338*0Sstevel@tonic-gate * Converts a string to the specified type. 339*0Sstevel@tonic-gate */ convert(String type, String value)340*0Sstevel@tonic-gate private Object convert(String type, String value) { 341*0Sstevel@tonic-gate return (Converter.getConverter(type).convertFromString(value)); 342*0Sstevel@tonic-gate } 343*0Sstevel@tonic-gate } 344