Esempio n. 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;
  }
Esempio n. 2
0
 @Override
 public void actionPerformed(ActionEvent e) {
   SmManagerClientModule module = ClientCoreContext.getModule(SmManagerClientModule.class);
   AddIpRangeController ipRangeController =
       module.getController(
           AddIpRangeModel.class, AddIpRangeView.class, AddIpRangeController.class);
   SmManagerService smManagerService =
       ClientCoreContext.getRemoteService("smManagerService", SmManagerService.class);
   List<IpRange> ipRanges = smManagerService.getAllUsersIpRange();
   ipRangeController.initData(ipRanges);
   ClientCoreContext.getWindowManager().openAsFrame(ipRangeController);
 }
Esempio n. 3
0
 /** 清除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);
 }
Esempio n. 4
0
  /**
   * 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);
  }
Esempio n. 5
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);
  }
Esempio n. 6
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);
 }