コード例 #1
0
  private void jbInit() throws Throwable {
    String[] aWhichButtonIUse = null;

    if (DelegateFactory.getInstance()
        .getTheJudgeDelegate()
        .hatRecht(com.lp.server.benutzer.service.RechteFac.RECHT_FERT_TECHNIKER_BEARBEITEN)) {
      createAndSaveAndShowButton(
          "/com/lp/client/res/worker16x16.png",
          LPMain.getTextRespectUISPr("fert.techniker.aendern"),
          ACTION_SPECIAL_TECHNIKER,
          RechteFac.RECHT_FERT_TECHNIKER_BEARBEITEN);

      aWhichButtonIUse =
          new String[] {
            ACTION_UPDATE, ACTION_SAVE, ACTION_DELETE, ACTION_DISCARD, ACTION_SPECIAL_TECHNIKER
          };

    } else {

      aWhichButtonIUse = new String[] {ACTION_UPDATE, ACTION_SAVE, ACTION_DELETE, ACTION_DISCARD};
    }

    this.enableToolsPanelButtons(aWhichButtonIUse);

    border1 = BorderFactory.createEmptyBorder(10, 10, 10, 10);
    this.setLayout(gridBagLayout1);

    jpaWorkingOn.setBorder(border1);
    jpaWorkingOn.setLayout(gridBagLayout3);
    JPanel panelButtonAction = getToolsPanel();
    getInternalFrame().addItemChangedListener(this);

    // controls
    wbuLostechniker = new WrapperButton();
    wtfLostechniker = new WrapperTextField();

    wbuLostechniker.setText(LPMain.getInstance().getTextRespectUISPr("button.personal"));

    wtfLostechniker.setActivatable(false);
    wtfLostechniker.setMandatoryFieldDB(true);

    wbuLostechniker.setMinimumSize(new Dimension(100, Defaults.getInstance().getControlHeight()));
    wbuLostechniker.setPreferredSize(new Dimension(100, Defaults.getInstance().getControlHeight()));

    wbuLostechniker.addActionListener(this);
    wbuLostechniker.setActionCommand(ACTION_SPECIAL_PERSONAL);

    this.add(
        panelButtonAction,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.NORTHWEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 0),
            0,
            0));
    this.add(
        jpaWorkingOn,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            1.0,
            1.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    // statusbarneu: 1 an den unteren rand des panels haengen
    this.add(
        getPanelStatusbar(),
        new GridBagConstraints(
            0,
            2,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 0, 0, 0),
            0,
            0));
    iZeile++;
    jpaWorkingOn.add(
        wbuLostechniker,
        new GridBagConstraints(
            0,
            iZeile,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
    jpaWorkingOn.add(
        wtfLostechniker,
        new GridBagConstraints(
            1,
            iZeile,
            1,
            1,
            1.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(2, 2, 2, 2),
            0,
            0));
  }