コード例 #1
0
  private void initializeLocalePanel() {
    localeP = new JPanel();
    GridBagLayout gbl = new GridBagLayout();
    GridBagConstraints gbc = new GridBagConstraints();
    localeP.setLayout(gbl);

    JLabel localeL = new JLabel("Locale of the application:");
    localeCh = new ChoiceString();
    localeCh.setItems(
        Constants.getSupportedLocales(null)); // TODO replace null with real RessourceBundle
    localeCh.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            onChange();
          }
        });
    localeL.setLabelFor(localeCh);

    // layout
    gbc.gridx = 0;
    gbc.gridy = 0;
    gbc.gridwidth = 1;
    gbc.gridheight = 1;
    gbc.anchor = GridBagConstraints.FIRST_LINE_START;
    gbl.setConstraints(localeL, gbc);
    localeP.add(localeL);
    // ----
    gbc.gridx = 1;
    gbc.weightx = 1.0;
    gbc.weighty = 1.0;
    gbc.insets = new Insets(0, DingsSwingConstants.SP_H_G, 0, 0);
    gbl.setConstraints(localeCh, gbc);
    localeP.add(localeCh);
  } // END private void initializeLocalePanel()
コード例 #2
0
 protected String constructXMLString(String xmlName) {
   StringBuffer xml = new StringBuffer();
   xml.append("<").append(xmlName);
   xml.append(Constants.getXMLFormattedAttribute(Constants.XML_ATTR_ID, id));
   xml.append(
       Constants.getXMLFormattedAttribute(Constants.XML_ATTR_LAST_UPD, this.getLastUpdString()));
   xml.append(">");
   xml.append(Constants.getXMLTaggedValue(Constants.XML_NAME, name));
   xml.append(Constants.getXMLTaggedValue(Constants.XML_DESCRIPTION, description));
   String rgb = Util.convertRGB(color);
   if (null != rgb) {
     xml.append(Constants.getXMLTaggedValue(Constants.XML_COLOR, rgb));
   }
   xml.append("</").append(xmlName).append(">");
   return xml.toString();
 } // END protected String constructXMLString()