Package com.sun.messaging.jmq.admin.apps.console.util

Examples of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel


        items[2] = new LabelledComponent(acr.getString(acr.I_BROKER_USERNAME), userTF);

        passwdTF = new JPasswordField("", 10);
        items[3] = new LabelledComponent(acr.getString(acr.I_BROKER_PASSWD), passwdTF);

        LabelValuePanel lvp = new LabelValuePanel(items, 4, 4);

  workConstraints.gridx = 0;
  workConstraints.anchor = GridBagConstraints.WEST;
  workConstraints.fill = GridBagConstraints.NONE;
  workConstraints.ipadx = 0;
  workConstraints.ipady = 0;
  workConstraints.weightx = 1.0;

  workConstraints.gridy = 0;
  workGridbag.setConstraints(brokerPanel, workConstraints);
  workPanel.add(brokerPanel);

  workConstraints.gridy = 1;
        workConstraints.insets = new Insets(10, 0, 0, 0);
  workConstraints.fill = GridBagConstraints.HORIZONTAL;
  JSeparator sep = new JSeparator();
  workGridbag.setConstraints(sep, workConstraints);
  workPanel.add(sep);

  workConstraints.gridy = 2;
        workConstraints.insets = new Insets(0, 0, 0, 0)// reset
  workConstraints.fill = GridBagConstraints.NONE;
  workGridbag.setConstraints(lvp, workConstraints);
  workPanel.add(lvp);

  ta = new JTextArea(acr.getString(acr.W_SAVE_AS_CLEAR_TEXT));
  ta.setLineWrap(true);
  ta.setWrapStyleWord(true);
  Color bgColor = brokerPanel.getBackground();
  ta.setBackground(bgColor);
  Color fgColor = l.getForeground();
  ta.setForeground(fgColor);
  ta.setFont(l.getFont());

  // Find longer of:
  // 1) Broker Label: ______
  // 2) LabelValuePanel
  int width1 = l.getPreferredSize().width + 5 +
         brokerNameTF.getPreferredSize().width;
  int width2 = lvp.getPreferredSize().width;
  if (width1 >= width2)
      ta.setSize(width1, 1);
  else
      ta.setSize(width2, 1);
View Full Code Here


  credentialsText = new JPasswordField(20);
  credentialsText.addActionListener(this);
  items[1] = new LabelledComponent(Context.SECURITY_CREDENTIALS + ":",
                 credentialsText);
 
  LabelValuePanel lvp = new LabelValuePanel(items, 5, 5);

  c.gridx = 0;
  c.gridy = 0;
  c.anchor = GridBagConstraints.WEST;
  gridbag.setConstraints(lvp, c);
View Full Code Here

          ":", panel2, LabelledComponent.NORTH);
  }
  items[2] = new LabelledComponent(acr.getString(acr.I_READONLY) + ":",
                 checkBox);

  LabelValuePanel lvp = new LabelValuePanel(items, 5, 5);

  c1.gridx = 0;
  c1.gridy = 0;
  c1.anchor = GridBagConstraints.NORTHWEST;
  gridbag1.setConstraints(panel1, c1);
  workPanel.add(panel1);

  c1.gridx = 0;
  c1.gridy = 1;
  c1.anchor = GridBagConstraints.WEST;
  gridbag1.setConstraints(lvp, c1);
  workPanel.add(lvp);

  JSeparator separator = new JSeparator();
  c1.gridx = 0;
  c1.gridy = 2;
  c1.ipady = 0; // reset
  c1.anchor = GridBagConstraints.CENTER; // reset
  c1.fill = GridBagConstraints.HORIZONTAL;
  c1.insets = new Insets(5, 0, 5, 0);
  gridbag1.setConstraints(separator, c1);
  workPanel.add(separator);
 
  /*
   * From here, list the properties on the destination.
   */
  AdministeredObject obj = (AdministeredObject)new com.sun.messaging.Topic();
  Properties props = obj.getConfiguration();

  LabelledComponent items2[] = new LabelledComponent[props.size()];
  textItems = new JTextField[props.size()];

  int i = 0;
  for (Enumeration e = obj.enumeratePropertyNames(); e.hasMoreElements(); i++) {
      String propName = (String)e.nextElement();
      try {
    textItems[i] = new JTextField((String)props.get(propName), 25);
    items2[i] = new LabelledComponent(obj.getPropertyLabel(propName) + ":",
              textItems[i]);
      } catch (Exception ex) {
      }
  }

  LabelValuePanel lvp2 = new LabelValuePanel(items2, 5, 5);

  c1.gridx = 0;
  c1.gridy = 3;
  c1.anchor = GridBagConstraints.WEST;
  gridbag1.setConstraints(lvp2, c1);
  workPanel.add(lvp2);

  // Set width lookup name label to max width of bottom panel.
  if (propsDlg) {
      int maxWidth = lvp2.getPreferredSize().width;
      JComponent c = items[0].getComponent();
      Dimension dim = new Dimension(maxWidth - items[0].getLabelWidth() - 20,
            c.getPreferredSize().height);
      c.setPreferredSize(dim);
  }
View Full Code Here

        JPanel                  workPanel;
        GridBagLayout           workGridbag;
        GridBagConstraints      workConstraints;
        LabelledComponent       tmpLabelC;
        LabelledComponent       lvpItems[];
        LabelValuePanel         lvp;
        JSeparator              sep;

        workPanel = new JPanel();
        workGridbag = new GridBagLayout();
        workPanel.setLayout(workGridbag);
        workConstraints = new GridBagConstraints();

  /*
         * Initialize.
         */
        workConstraints.gridx = 0;
        workConstraints.gridy = 0;
        workConstraints.anchor = GridBagConstraints.WEST;
        workConstraints.fill = GridBagConstraints.NONE;
        workConstraints.insets = new Insets(5, 0, 5, 0);
        workConstraints.ipadx = 0;
        workConstraints.ipady = 0;
        workConstraints.weightx = 1.0;

        lvpItems = new LabelledComponent[3];

        svcName = new JLabel();
        tmpLabelC = new LabelledComponent(
    ar.getString(ar.I_JMQCMD_SVC_NAME) + ":",
    svcName);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
  lvpItems[0] = tmpLabelC;

  // for radio buttons for dynamic / static port number
  JPanel servicePanel = new JPanel();
  GridBagLayout serviceGridbag = new GridBagLayout();
  servicePanel.setLayout(serviceGridbag);
  GridBagConstraints serviceConstraints = new GridBagConstraints();

  /*
         * Initialize.
         */
        serviceConstraints.anchor = GridBagConstraints.WEST;
  serviceConstraints.insets = new Insets(0, 0, 0, 0);

  serviceConstraints.gridx = 0;
  serviceConstraints.gridy = 0;
  dynamicPortButton = new JRadioButton();
  dynamicPortButton.addActionListener(this);
  serviceGridbag.setConstraints(dynamicPortButton, serviceConstraints);
  servicePanel.add(dynamicPortButton);

  serviceConstraints.gridx = 0;
  serviceConstraints.gridy = 1;
  staticPortButton = new JRadioButton();
  staticPortButton.addActionListener(this);
  serviceGridbag.setConstraints(staticPortButton, serviceConstraints);
  servicePanel.add(staticPortButton);

  ButtonGroup servicePortGroup = new ButtonGroup();
  servicePortGroup.add(dynamicPortButton);
  servicePortGroup.add(staticPortButton);

  serviceConstraints.gridx = 1;
  serviceConstraints.gridy = 0;
  JLabel dynamicLabel = new JLabel(acr.getString(acr.I_DYNAMIC_CAP) + ":");
  serviceGridbag.setConstraints(dynamicLabel, serviceConstraints);
  servicePanel.add(dynamicLabel);

  serviceConstraints.gridx = 1;
  serviceConstraints.gridy = 1;
  JLabel staticLabel = new JLabel(acr.getString(acr.I_STATIC_CAP) + ":");
  serviceGridbag.setConstraints(staticLabel, serviceConstraints);
  servicePanel.add(staticLabel);

  serviceConstraints.gridx = 2;
  serviceConstraints.gridy = 0;
  serviceConstraints.insets = new Insets(0, 5, 0, 0);
  dynamicPortLabel = new JLabel();
  serviceGridbag.setConstraints(dynamicPortLabel, serviceConstraints);
  servicePanel.add(dynamicPortLabel);

  serviceConstraints.gridx = 2;
  serviceConstraints.gridy = 1;
  serviceConstraints.insets = new Insets(0, 5, 0, 0);
  staticPortIF = new IntegerField(0, Integer.MAX_VALUE, 15);
  staticPortIF.setEnabled(false);
  serviceGridbag.setConstraints(staticPortIF, serviceConstraints);
  servicePanel.add(staticPortIF);

        tmpLabelC = new LabelledComponent(
                ar.getString(ar.I_JMQCMD_SVC_PORT)+":",
                servicePanel, LabelledComponent.NORTH);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
        lvpItems[1] = tmpLabelC;

  // Set this so that we can enable/disable this component
  svcPortComponent = lvpItems[1];

        svcState = new JLabel();
        tmpLabelC = new LabelledComponent(
    ar.getString(ar.I_JMQCMD_SVC_STATE)+":",
    svcState);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
  lvpItems[2] = tmpLabelC;

        lvp = new LabelValuePanel(lvpItems, 4, 0);
        workGridbag.setConstraints(lvp, workConstraints);
        workPanel.add(lvp);

        workConstraints.gridy = 1;

        sep = new JSeparator();
        workConstraints.fill = GridBagConstraints.HORIZONTAL;
        workGridbag.setConstraints(sep, workConstraints);
        workPanel.add(sep);
        /*
         * Reset
         */
        workConstraints.fill = GridBagConstraints.NONE;
        workConstraints.gridy = 2;

        lvpItems = new LabelledComponent[2];

        allocatedThreads = new JLabel();
        tmpLabelC = new LabelledComponent(
    ar.getString(ar.I_JMQCMD_SVC_CUR_THREADS) + ":",
    allocatedThreads);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
  lvpItems[0] = tmpLabelC;

        numConnections = new JLabel();
        tmpLabelC = new LabelledComponent(
    ar.getString(ar.I_JMQCMD_SVC_NUM_CXN) + ":",
    numConnections);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
  lvpItems[1] = tmpLabelC;

        lvp = new LabelValuePanel(lvpItems, 4, 0);
        workGridbag.setConstraints(lvp, workConstraints);
        workPanel.add(lvp);

        workConstraints.gridy = 3;

        sep = new JSeparator();
        workConstraints.fill = GridBagConstraints.HORIZONTAL;
        workGridbag.setConstraints(sep, workConstraints);
        workPanel.add(sep);
        /*
         * Reset
         */
        workConstraints.fill = GridBagConstraints.NONE;
        workConstraints.gridy = 4;

        lvpItems = new LabelledComponent[2];

        minThreads = new IntegerField(0, Integer.MAX_VALUE, 15);
  minThreads.addActionListener(this);
        tmpLabelC = new LabelledComponent(
                ar.getString(ar.I_JMQCMD_SVC_MIN_THREADS) + ":",
                minThreads);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
        workPanel.add(tmpLabelC);
  lvpItems[0] = tmpLabelC;

  maxThreads = new IntegerField(0, Integer.MAX_VALUE, 15);
  maxThreads.addActionListener(this);
        tmpLabelC = new LabelledComponent(
                ar.getString(ar.I_JMQCMD_SVC_MAX_THREADS) + ":",
                maxThreads);
        workGridbag.setConstraints(tmpLabelC, workConstraints);
  lvpItems[1] = tmpLabelC;

        lvp = new LabelValuePanel(lvpItems, 4, 0);
        workGridbag.setConstraints(lvp, workConstraints);
        workPanel.add(lvp);

  return workPanel;
    }
View Full Code Here

  JScrollPane scrollPane = new JScrollPane(table);
  scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
 
  items[2] = new LabelledComponent(" ", scrollPane);

  lvp = new LabelValuePanel(items, 5, 5);
  c.gridx = 0;
  c.gridy = 4;
  c.gridwidth = 2;
  c.anchor = GridBagConstraints.CENTER;
  gridbag.setConstraints(lvp, c);
View Full Code Here

  items[0] = new LabelledComponent(acr.getString(acr.I_BROKER_USERNAME), username);
  password = new JPasswordField(20);
  password.addActionListener(this);
  items[1] = new LabelledComponent(acr.getString(acr.I_BROKER_PASSWD), password);
 
  LabelValuePanel lvp = new LabelValuePanel(items, 5, 5);

  c.gridx = 0;
  c.gridy = 0;
  c.anchor = GridBagConstraints.WEST;
  gridbag.setConstraints(lvp, c);
View Full Code Here

        JPanel       workPanel;
  GridBagLayout     workGridbag;
  GridBagConstraints   workConstraints;
  LabelledComponent  tmpLabelC;
  LabelledComponent  lvpItems[];
  LabelValuePanel    lvp;

        workPanel = new JPanel();
  workGridbag = new GridBagLayout();
  workPanel.setLayout(workGridbag);
  workConstraints = new GridBagConstraints();

  workConstraints.gridx = 0;
  workConstraints.anchor = GridBagConstraints.WEST;
  workConstraints.fill = GridBagConstraints.NONE;
  workConstraints.insets = new Insets(5, 0, 5, 0);
  workConstraints.ipadx = 0;
  workConstraints.ipady = 0;
  workConstraints.weightx = 1.0;

  /*
   * Removed metric interval
  lvpItems = new LabelledComponent[6];
  */
  lvpItems = new LabelledComponent[7];

  versionLbl = new JLabel();
  tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_VERSION_STR),
      versionLbl);
  lvpItems[0] = tmpLabelC;

  instanceNameLbl = new JLabel();
  tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_INSTANCE_NAME),
      instanceNameLbl);
  lvpItems[1] = tmpLabelC;

  portTF = new IntegerField(0, Integer.MAX_VALUE, 10);
  tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_PORT), portTF);
  lvpItems[2] = tmpLabelC;

  autoCreateTopicCkb = new JCheckBox();
  tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_ACREATE_TOPICS),
        autoCreateTopicCkb);
  lvpItems[3] = tmpLabelC;

  autoCreateQueueCkb = new JCheckBox();
        autoCreateQueueCkb.addActionListener(this);
  tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_ACREATE_QUEUES),
        autoCreateQueueCkb);
  lvpItems[4] = tmpLabelC;

  /*
   * Active Consumers
   */
        activeConsumerIF = new IntegerField(0, Integer.MAX_VALUE, 10);
        activeConsumerSF = new SpecialValueField(activeConsumerIF,
        acr.getString(acr.I_BROKER_UNLIMITED));
  activeConsumerLabelC = new LabelledComponent
      (acr.getString(acr.I_BROKER_AUTOCREATED_ACTIVE_CONSUMER),
       activeConsumerSF, LabelledComponent.NORTH);
  lvpItems[5] = activeConsumerLabelC;

  /*
   * Failover Consumers
   */
        failoverConsumerIF = new IntegerField(0, Integer.MAX_VALUE, 10);
        failoverConsumerSF = new SpecialValueField(failoverConsumerIF,
        acr.getString(acr.I_BROKER_UNLIMITED));
  failoverConsumerLabelC = new LabelledComponent
      (acr.getString(acr.I_BROKER_AUTOCREATED_FAILOVER_CONSUMER),
       failoverConsumerSF, LabelledComponent.NORTH);
  lvpItems[6] = failoverConsumerLabelC;


  /*
  metricIntervalTF = new TimeField(Integer.MAX_VALUE, "0", 10);
  metricIntervalSF = new SpecialValueField(metricIntervalTF,
      acr.getString(acr.I_BROKER_OFF));
  tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_METRIC_INTERVAL),
    metricIntervalSF, LabelledComponent.NORTH);
  lvpItems[4] = tmpLabelC;
  */

  lvp = new LabelValuePanel(lvpItems, 4, 5);
  workGridbag.setConstraints(lvp, workConstraints);
  workPanel.add(lvp);

  return (workPanel);
    }
View Full Code Here

        JPanel       workPanel;
  GridBagLayout     workGridbag;
  GridBagConstraints   workConstraints;
  LabelledComponent  tmpLabelC;
  LabelledComponent  lvpItems[];
  LabelValuePanel    lvp;

        workPanel = new JPanel();
  workGridbag = new GridBagLayout();
  workPanel.setLayout(workGridbag);
  workConstraints = new GridBagConstraints();

  workConstraints.gridx = 0;
  workConstraints.anchor = GridBagConstraints.WEST;
  workConstraints.fill = GridBagConstraints.NONE;
  workConstraints.insets = new Insets(5, 0, 5, 0);
  workConstraints.ipadx = 0;
  workConstraints.ipady = 0;
  workConstraints.weightx = 1.0;

  lvpItems = new LabelledComponent[3];

  logLevelCb = new JComboBox(BKR_LOG_LEVEL_VALID_VALUES);
  tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_LOG_LEVEL),
    logLevelCb);
  lvpItems[0] = tmpLabelC;

        logRolloverSizeBF = new BytesField(0, Integer.MAX_VALUE, "0", 10);
  logRolloverSizeSF = new SpecialValueField(logRolloverSizeBF,
      acr.getString(acr.I_BROKER_UNLIMITED));
        tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_LOG_ROLLOVER_SIZE),
                logRolloverSizeSF, LabelledComponent.NORTH);
  lvpItems[1] = tmpLabelC;

  logRolloverIntervalTF = new TimeField(Integer.MAX_VALUE, "0", 10);
  logRolloverIntervalSF = new SpecialValueField(logRolloverIntervalTF,
      acr.getString(acr.I_BROKER_UNLIMITED));
  tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_LOG_ROLLOVER_INTERVAL),
    logRolloverIntervalSF, LabelledComponent.NORTH);
  lvpItems[2] = tmpLabelC;

  lvp = new LabelValuePanel(lvpItems, 4, 5);
  workGridbag.setConstraints(lvp, workConstraints);
  workPanel.add(lvp);

  return (workPanel);
    }
View Full Code Here

        JPanel       workPanel;
  GridBagLayout     workGridbag;
  GridBagConstraints   workConstraints;
  LabelledComponent  tmpLabelC;
  LabelledComponent  lvpItems[];
  LabelValuePanel    lvp;

        workPanel = new JPanel();
  workGridbag = new GridBagLayout();
  workPanel.setLayout(workGridbag);
  workConstraints = new GridBagConstraints();

  workConstraints.gridx = 0;
  workConstraints.anchor = GridBagConstraints.WEST;
  workConstraints.fill = GridBagConstraints.NONE;
  workConstraints.insets = new Insets(5, 0, 5, 0);
  workConstraints.ipadx = 0;
  workConstraints.ipady = 0;
  workConstraints.weightx = 1.0;

  lvpItems = new LabelledComponent[3];

  maxNumMsgsInMemDskTF = new IntegerField(0, Integer.MAX_VALUE, 10);
  maxNumMsgsInMemDskSF = new SpecialValueField(maxNumMsgsInMemDskTF,
      acr.getString(acr.I_BROKER_UNLIMITED));
  tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_MAX_MSGS_IN_MEM_DSK),
    maxNumMsgsInMemDskSF, LabelledComponent.NORTH);
  lvpItems[0] = tmpLabelC;

  maxTtlSizeMsgsInMemDskBF = new BytesField(0, Integer.MAX_VALUE, "0", 10);
  maxTtlSizeMsgsInMemDskSF = new SpecialValueField(maxTtlSizeMsgsInMemDskBF,
      acr.getString(acr.I_BROKER_UNLIMITED));
  tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_MAX_TTL_SIZE_MSGS_IN_MEM_DSK),
    maxTtlSizeMsgsInMemDskSF, LabelledComponent.NORTH);
  lvpItems[1] = tmpLabelC;

  maxMsgSizeBF = new BytesField(0, Integer.MAX_VALUE, "0", 10);
  maxMsgSizeSF = new SpecialValueField(maxMsgSizeBF,
      acr.getString(acr.I_BROKER_UNLIMITED));
  tmpLabelC = new LabelledComponent(
    acr.getString(acr.I_BROKER_MAX_MSG_SIZE),
    maxMsgSizeSF, LabelledComponent.NORTH);
  lvpItems[2] = tmpLabelC;

  lvp = new LabelValuePanel(lvpItems, 4, 5);
  workGridbag.setConstraints(lvp, workConstraints);
  workPanel.add(lvp);

  return (workPanel);
    }
View Full Code Here

        JPanel       workPanel;
        GridBagLayout    workGridbag;
        GridBagConstraints  workConstraints;
  LabelledComponent  tmpLabelC;
  LabelledComponent  lvpItems[];
  LabelValuePanel    lvp;

        workPanel = new JPanel();

        tabbedPane = new JTabbedPane();
        tabbedPane.addTab(acr.getString(acr.I_DEST_PROP_BASIC), makeBasicTab());
View Full Code Here

TOP

Related Classes of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.