示例#1
0
  @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;
  }
示例#2
0
  @Override
  protected <V, M> void addButtonListener(ClientController<Object, V, M> controller) {
    okButton.setEnabled(true);
    okButton.setText(ClientCoreContext.getString("smmanager.unlock.button"));

    UnlockClientApplyAction applyAction =
        new UnlockClientApplyAction(UnlockClientApplyAction.class.getSimpleName());
    okButton.addActionListener(applyAction);
  }
示例#3
0
 public OpenAddIpRangeAction(String actionId) {
   super(actionId);
   String text = ClientCoreContext.getString("Button.add");
   int vk = XGuiUtils.getMnemonicKey('a');
   text =
       new StringBuilder(text).append("(").append(KeyEvent.getKeyText(vk)).append(")").toString();
   putValue(NAME, text);
   putValue(MNEMONIC_KEY, vk);
 }