Search in sources :

Example 6 with LabelValuePanel

use of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel in project openmq by eclipse-ee4j.

the class BrokerQueryDialog method makeBasicTab.

public JPanel makeBasicTab() {
    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;
    lvp = new LabelValuePanel(lvpItems, 4, 5);
    workGridbag.setConstraints(lvp, workConstraints);
    workPanel.add(lvp);
    return (workPanel);
}
Also used : LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel) JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JLabel(javax.swing.JLabel) IntegerField(com.sun.messaging.jmq.admin.apps.console.util.IntegerField) SpecialValueField(com.sun.messaging.jmq.admin.apps.console.util.SpecialValueField)

Example 7 with LabelValuePanel

use of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel in project openmq by eclipse-ee4j.

the class BrokerQueryDialog method makeLogTab.

public JPanel makeLogTab() {
    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.toArray(new String[BKR_LOG_LEVEL_VALID_VALUES.size()]));
    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);
}
Also used : LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel) JPanel(javax.swing.JPanel) BytesField(com.sun.messaging.jmq.admin.apps.console.util.BytesField) TimeField(com.sun.messaging.jmq.admin.apps.console.util.TimeField) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) SpecialValueField(com.sun.messaging.jmq.admin.apps.console.util.SpecialValueField)

Example 8 with LabelValuePanel

use of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel in project openmq by eclipse-ee4j.

the class BrokerQueryDialog method makeMsgTab.

public JPanel makeMsgTab() {
    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);
}
Also used : LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel) JPanel(javax.swing.JPanel) BytesField(com.sun.messaging.jmq.admin.apps.console.util.BytesField) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) IntegerField(com.sun.messaging.jmq.admin.apps.console.util.IntegerField) SpecialValueField(com.sun.messaging.jmq.admin.apps.console.util.SpecialValueField)

Example 9 with LabelValuePanel

use of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel in project openmq by eclipse-ee4j.

the class ObjStoreConFactoryDialog method layoutGroupProperties.

private JPanel layoutGroupProperties(String[] props, AdministeredObject aobj) {
    LabelledComponent[] items;
    items = new LabelledComponent[props.length];
    int k = 0;
    // XXX addExtra means add the 6 extra props.
    // XXX
    addExtra = false;
    for (int i = 0; i < props.length; i++) {
        items[k++] = makeLabelledComponent(aobj, props[i]);
        // XXX temporarily appending the extra list props.
        if (addExtra) {
            for (int j = 0; j < extraItems.length; j++) {
                items[k++] = extraItems[j];
            }
            addExtra = false;
        }
    }
    LabelValuePanel lvp = new LabelValuePanel(items, 5, 5);
    // 
    for (int i = 0; i < items.length; i++) {
        cfProps.add(items[i]);
    }
    return (lvp);
}
Also used : LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel)

Example 10 with LabelValuePanel

use of com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel in project openmq by eclipse-ee4j.

the class BrokerDialog method createWorkPanel.

@Override
public JPanel createWorkPanel() {
    JPanel workPanel = new JPanel();
    GridBagLayout workGridbag = new GridBagLayout();
    workPanel.setLayout(workGridbag);
    GridBagConstraints workConstraints = new GridBagConstraints();
    JPanel brokerPanel = new JPanel();
    GridBagLayout brokerGridbag = new GridBagLayout();
    brokerPanel.setLayout(brokerGridbag);
    GridBagConstraints brokerConstraints = new GridBagConstraints();
    brokerConstraints.gridx = 0;
    brokerConstraints.gridy = 0;
    brokerConstraints.anchor = GridBagConstraints.EAST;
    JLabel l = new JLabel(acr.getString(acr.I_BROKER_NAME));
    brokerGridbag.setConstraints(l, brokerConstraints);
    brokerPanel.add(l);
    brokerConstraints.gridx = 1;
    brokerConstraints.gridy = 0;
    brokerConstraints.anchor = GridBagConstraints.WEST;
    brokerConstraints.insets = new Insets(0, 5, 0, 0);
    brokerNameTF = new JTextField(20);
    brokerGridbag.setConstraints(brokerNameTF, brokerConstraints);
    brokerPanel.add(brokerNameTF);
    LabelledComponent[] items;
    items = new LabelledComponent[4];
    hostTF = new JTextField(DEFAULT_BROKER_HOST, 10);
    items[0] = new LabelledComponent(acr.getString(acr.I_BROKER_HOST), hostTF);
    portTF = new IntegerField(0, Integer.MAX_VALUE, DEFAULT_PRIMARY_PORT, 10);
    items[1] = new LabelledComponent(acr.getString(acr.I_BROKER_PORT), portTF);
    userTF = new JTextField(BrokerAdmin.DEFAULT_ADMIN_USERNAME, 10);
    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;
    // reset
    workConstraints.insets = new Insets(0, 0, 0, 0);
    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);
    }
    ta.setEditable(false);
    Dimension textSize = ta.getPreferredSize();
    ta.setSize(textSize);
    workConstraints.gridy = 3;
    workGridbag.setConstraints(ta, workConstraints);
    workPanel.add(ta);
    return (workPanel);
}
Also used : LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) JTextArea(javax.swing.JTextArea) GridBagLayout(java.awt.GridBagLayout) Color(java.awt.Color) JLabel(javax.swing.JLabel) IntegerField(com.sun.messaging.jmq.admin.apps.console.util.IntegerField) Dimension(java.awt.Dimension) JTextField(javax.swing.JTextField) JSeparator(javax.swing.JSeparator) LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) JPasswordField(javax.swing.JPasswordField)

Aggregations

LabelValuePanel (com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel)14 LabelledComponent (com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent)14 GridBagConstraints (java.awt.GridBagConstraints)13 GridBagLayout (java.awt.GridBagLayout)13 JPanel (javax.swing.JPanel)13 Insets (java.awt.Insets)9 JLabel (javax.swing.JLabel)8 JTextField (javax.swing.JTextField)7 JSeparator (javax.swing.JSeparator)6 IntegerField (com.sun.messaging.jmq.admin.apps.console.util.IntegerField)5 JCheckBox (javax.swing.JCheckBox)5 SpecialValueField (com.sun.messaging.jmq.admin.apps.console.util.SpecialValueField)4 JComboBox (javax.swing.JComboBox)4 BytesField (com.sun.messaging.jmq.admin.apps.console.util.BytesField)3 Color (java.awt.Color)3 Dimension (java.awt.Dimension)3 GridLayout (java.awt.GridLayout)3 JPasswordField (javax.swing.JPasswordField)3 JTextArea (javax.swing.JTextArea)3 ButtonGroup (javax.swing.ButtonGroup)2