/** 清除border */ public void clearBorder() { Border emptyBorder = ClientCoreContext.getSwingFactory().getEmptyBorder(0, 0, 0, 0); t1.setBorder(emptyBorder); t2.setBorder(emptyBorder); t3.setBorder(emptyBorder); t4.setBorder(emptyBorder); }
@Override protected JComponent createContentPane() { SwingFactory swingFactory = ClientCoreContext.getSwingFactory(); JLabel userLabel = swingFactory.getLabel( new LabelDecorator(ClientCoreContext.getString("smmanager.unlock.user"))); JLabel pwdLabel = swingFactory.getLabel( new LabelDecorator(ClientCoreContext.getString("smmanager.unlock.password"))); userField = swingFactory.getXEditor(new StringEditorDecorator("user")); userField.setEditable(false); pwdTextField = swingFactory.getXEditor(new PasswordEditorDecorator("password")); double[][] ds = new double[][] { {5, 100, 5, TableLayout.FILL, 5}, swingFactory.getTableLayoutRowParam(2, 1, 1) }; JPanel pane = swingFactory.getPanel(new TableLayout(ds)); pane.add(userLabel, "1,1,f,c"); pane.add(userField, "3,1,f,c"); pane.add(pwdLabel, "1,3,f,c"); pane.add(pwdTextField, "3,3,f,c"); // init data : current user SmCoreClientService smCoreClientService = ClientCoreContext.getLocalService("smCoreClientService", SmCoreClientService.class); userField.setText(smCoreClientService.getCurrentUser()); return pane; }
/** * constructor * * @param isSelected * @param ipAddress * @param colorSelect * @param colorNoSelect */ public XIpAddressEditor( boolean isSelected, String ipAddress, Color colorSelect, Color colorNoSelect) { super(); propertyChangeSupport = new PropertyChangeSupport(this); t1 = new XTextIPSpace(true, "1", this); t2 = new XTextIPSpace(true, "2", this); t3 = new XTextIPSpace(true, "3", this); t4 = new XTextIPSpace(true, "4", this); label1 = ClientCoreContext.getSwingFactory().getLabel(new LabelDecorator(".")); label2 = ClientCoreContext.getSwingFactory().getLabel(new LabelDecorator(".")); label3 = ClientCoreContext.getSwingFactory().getLabel(new LabelDecorator(".")); analyzeStr(ipAddress); setChildComponent(false); setLayout(null); changeChildComponent(); t1.setPrevNextComponent(null, t2); t2.setPrevNextComponent(t1, t3); t3.setPrevNextComponent(t2, t4); t4.setPrevNextComponent(t3, null); // Dimension preferredSize = t4.getPreferredSize(); add(t1); add(label1); add(t2); add(label2); add(t3); add(label3); add(t4); setSize(getPreferredSize()); addComponentListener( new ComponentListener() { public void componentResized(ComponentEvent e) { changeChildComponent(); } public void componentMoved(ComponentEvent e) {} public void componentShown(ComponentEvent e) {} public void componentHidden(ComponentEvent e) {} }); setChildComponent(true); if (colorSelect != null) DefaultColor_Selected = colorSelect; if (colorNoSelect != null) DefaultColor_NoSelected = colorNoSelect; setSelectEdge(isSelected, DefaultColor_Selected, DefaultColor_NoSelected); // t1.gotoComponent(t1); }