Search in sources :

Example 11 with LabelValuePanel

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

the class BrokerPasswdDialog method createWorkPanel.

@Override
public JPanel createWorkPanel() {
    JPanel workPanel = new JPanel();
    GridBagLayout gridbag = new GridBagLayout();
    workPanel.setLayout(gridbag);
    GridBagConstraints c = new GridBagConstraints();
    LabelledComponent[] items = new LabelledComponent[2];
    username = new JTextField(20);
    username.addActionListener(this);
    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);
    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) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JPasswordField(javax.swing.JPasswordField) JTextField(javax.swing.JTextField)

Example 12 with LabelValuePanel

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

the class ObjStorePasswdDialog method createWorkPanel.

@Override
public JPanel createWorkPanel() {
    JPanel workPanel = new JPanel();
    GridBagLayout gridbag = new GridBagLayout();
    workPanel.setLayout(gridbag);
    GridBagConstraints c = new GridBagConstraints();
    LabelledComponent[] items = new LabelledComponent[2];
    principalText = new JTextField(20);
    principalText.addActionListener(this);
    items[0] = new LabelledComponent(Context.SECURITY_PRINCIPAL + ":", principalText);
    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);
    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) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) JPasswordField(javax.swing.JPasswordField) JTextField(javax.swing.JTextField)

Example 13 with LabelValuePanel

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

the class BrokerDestPropsDialog method makeBasicTab.

private JPanel makeBasicTab() {
    JPanel basicPanel;
    GridBagLayout basicGridbag;
    GridBagConstraints basicConstraints;
    LabelledComponent tmpLabelC;
    LabelledComponent[] lvpItems;
    LabelValuePanel lvp;
    int i = 0;
    basicPanel = new JPanel();
    basicGridbag = new GridBagLayout();
    basicConstraints = new GridBagConstraints();
    basicPanel.setLayout(basicGridbag);
    basicConstraints.gridx = 0;
    basicConstraints.anchor = GridBagConstraints.WEST;
    basicConstraints.fill = GridBagConstraints.NONE;
    basicConstraints.insets = new Insets(10, 0, 10, 0);
    basicConstraints.ipadx = 0;
    basicConstraints.ipady = 0;
    basicConstraints.weightx = 1.0;
    /*
         * Basic destination info: name, type, state
         */
    lvpItems = new LabelledComponent[3];
    destNameValue = new JLabel();
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_DEST_NAME), destNameValue);
    lvpItems[0] = tmpLabelC;
    destTypeValue = new JLabel();
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_DEST_TYPE), destTypeValue);
    lvpItems[1] = tmpLabelC;
    destStateValue = new JLabel();
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_DEST_STATE) + ":", destStateValue);
    lvpItems[2] = tmpLabelC;
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 0;
    lvp = new LabelValuePanel(lvpItems, 4, 3);
    basicGridbag.setConstraints(lvp, basicConstraints);
    basicPanel.add(lvp);
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 1;
    basicConstraints.insets = new Insets(0, 0, 0, 0);
    basicConstraints.fill = GridBagConstraints.HORIZONTAL;
    JSeparator separator = new JSeparator();
    basicGridbag.setConstraints(separator, basicConstraints);
    basicPanel.add(separator);
    /*
         * Reset
         */
    basicConstraints.gridwidth = 1;
    basicConstraints.fill = GridBagConstraints.NONE;
    /*
         * Current number or message size / bytes info
         */
    lvpItems = new LabelledComponent[5];
    curNumMesgsValue = new JLabel();
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_DEST_NUM_MSGS), curNumMesgsValue);
    lvpItems[i++] = tmpLabelC;
    curNumMesgBytesValue = new JLabel();
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_DEST_TTL_SIZE_MSGS), curNumMesgBytesValue, acr.getString(acr.I_BYTES));
    lvpItems[i++] = tmpLabelC;
    curNumProducers = new JLabel();
    curNumProducersLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_DEST_NUM_PRODUCERS), curNumProducers);
    lvpItems[i++] = curNumProducersLabelC;
    curNumActive = new JLabel();
    curNumActiveLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_CUR_NUM_ACTIVE), curNumActive);
    lvpItems[i++] = curNumActiveLabelC;
    curNumFailover = new JLabel();
    curNumFailoverLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_CUR_NUM_FAILOVER), curNumFailover);
    lvpItems[i++] = curNumFailoverLabelC;
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 2;
    basicConstraints.insets = new Insets(10, 0, 10, 0);
    lvp = new LabelValuePanel(lvpItems, 4, 5);
    basicGridbag.setConstraints(lvp, basicConstraints);
    basicPanel.add(lvp);
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 3;
    basicConstraints.insets = new Insets(0, 0, 0, 0);
    basicConstraints.fill = GridBagConstraints.HORIZONTAL;
    separator = new JSeparator();
    basicGridbag.setConstraints(separator, basicConstraints);
    basicPanel.add(separator);
    /*
         * Reset
         */
    basicConstraints.gridwidth = 1;
    basicConstraints.fill = GridBagConstraints.NONE;
    i = 0;
    lvpItems = new LabelledComponent[6];
    /*
         * Queue message limit
         */
    mesgLimitIF = new IntegerField(0, Integer.MAX_VALUE, 11);
    mesgLimitSF = new SpecialValueField(mesgLimitIF, acr.getString(acr.I_BROKER_UNLIMITED));
    mesgLimitLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_MAX_NUM_MSGS), mesgLimitSF, LabelledComponent.NORTH);
    lvpItems[i++] = mesgLimitLabelC;
    /*
         * Queue size limit
         */
    mesgSizeLimitBF = new BytesField(0, Long.MAX_VALUE, 11);
    mesgSizeLimitSF = new SpecialValueField(mesgSizeLimitBF, acr.getString(acr.I_BROKER_UNLIMITED));
    mesgSizeLimitLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_MAX_TTL_SIZE_MSGS), mesgSizeLimitSF, LabelledComponent.NORTH);
    lvpItems[i++] = mesgSizeLimitLabelC;
    /*
         * Destination Maximum Size per Message
         */
    maxSizePerMsgBF = new BytesField(0, Long.MAX_VALUE, 11);
    maxSizePerMsgSF = new SpecialValueField(maxSizePerMsgBF, acr.getString(acr.I_BROKER_UNLIMITED));
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_MAX_SIZE_PER_MSG), maxSizePerMsgSF, LabelledComponent.NORTH);
    lvpItems[i++] = tmpLabelC;
    /*
         * Max Producers
         */
    maxProducerIF = new IntegerField(0, Integer.MAX_VALUE, 11);
    maxProducerSF = new SpecialValueField(maxProducerIF, acr.getString(acr.I_BROKER_UNLIMITED));
    maxProducerLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_MAX_PRODUCERS), maxProducerSF, LabelledComponent.NORTH);
    lvpItems[i++] = maxProducerLabelC;
    /*
         * Active Consumers
         */
    activeConsumerIF = new IntegerField(0, Integer.MAX_VALUE, 11);
    activeConsumerSF = new SpecialValueField(activeConsumerIF, acr.getString(acr.I_BROKER_UNLIMITED));
    activeConsumerLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_ACTIVE_CONSUMER), activeConsumerSF, LabelledComponent.NORTH);
    lvpItems[i++] = activeConsumerLabelC;
    /*
         * Failover Consumers
         */
    failoverConsumerIF = new IntegerField(0, Integer.MAX_VALUE, 11);
    failoverConsumerSF = new SpecialValueField(failoverConsumerIF, acr.getString(acr.I_BROKER_UNLIMITED));
    failoverConsumerLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_FAILOVER_CONSUMER), failoverConsumerSF, LabelledComponent.NORTH);
    lvpItems[i++] = failoverConsumerLabelC;
    lvp = new LabelValuePanel(lvpItems, 4, 5);
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 4;
    basicConstraints.insets = new Insets(10, 0, 10, 0);
    basicGridbag.setConstraints(lvp, basicConstraints);
    basicPanel.add(lvp);
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 5;
    basicConstraints.insets = new Insets(0, 0, 0, 0);
    basicConstraints.fill = GridBagConstraints.HORIZONTAL;
    separator = new JSeparator();
    basicGridbag.setConstraints(separator, basicConstraints);
    basicPanel.add(separator);
    /*
         * Reset
         */
    basicConstraints.gridwidth = 1;
    basicConstraints.fill = GridBagConstraints.NONE;
    i = 0;
    /*
         * Limit Behavior, Use Dead Message Queue
         */
    lvpItems = new LabelledComponent[2];
    limitBehaviorCb = new JComboBox(BKR_LIMIT_BEHAV_VALID_VALUES.toArray(new String[BKR_LIMIT_BEHAV_VALID_VALUES.size()]));
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_LIMIT_BEHAVIOR), limitBehaviorCb);
    lvpItems[i++] = tmpLabelC;
    useDMQCkb = new JCheckBox();
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_BROKER_USE_DMQ), useDMQCkb);
    lvpItems[i++] = tmpLabelC;
    basicConstraints.gridx = 0;
    basicConstraints.gridy = 6;
    basicConstraints.insets = new Insets(10, 0, 10, 0);
    lvp = new LabelValuePanel(lvpItems, 4, 2);
    basicGridbag.setConstraints(lvp, basicConstraints);
    basicPanel.add(lvp);
    return (basicPanel);
}
Also used : 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) JComboBox(javax.swing.JComboBox) JLabel(javax.swing.JLabel) IntegerField(com.sun.messaging.jmq.admin.apps.console.util.IntegerField) JSeparator(javax.swing.JSeparator) LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) JCheckBox(javax.swing.JCheckBox) SpecialValueField(com.sun.messaging.jmq.admin.apps.console.util.SpecialValueField)

Example 14 with LabelValuePanel

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

the class AboutDialog method makeRightPanel.

private JPanel makeRightPanel() {
    Version version;
    JPanel rightPanel;
    GridBagLayout gridbag;
    GridBagConstraints c;
    JLabel label;
    JSeparator sep;
    LabelValuePanel lvp;
    LabelledComponent[] lvpItems;
    LabelledComponent tmpLabelC;
    JTextArea ta;
    JScrollPane sp;
    int gridy = 0, width;
    version = new Version(false);
    rightPanel = new JPanel();
    gridbag = new GridBagLayout();
    rightPanel.setLayout(gridbag);
    c = new GridBagConstraints();
    label = new JLabel(version.getProductName() + " " + version.getReleaseQID());
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    label = new JLabel(acr.getString(acr.I_VERSION, version.getBuildVersion()));
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    label = new JLabel(acr.getString(acr.I_COMPILE, version.getBuildDate()));
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    sep = new JSeparator();
    c.gridx = 0;
    c.gridy = gridy++;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(5, 0, 5, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(sep, c);
    rightPanel.add(sep);
    /*
         * Reset
         */
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(0, 0, 0, 0);
    label = new JLabel(acr.getString(acr.I_VERSION_INFO, version.getVersionPackageName()));
    c.gridx = 0;
    gridy++;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    /*
         * Reset
         */
    c.insets = new Insets(0, 0, 0, 0);
    String[] patchids = version.getPatchIds();
    if (patchids == null || patchids.length < 1) {
        lvpItems = new LabelledComponent[3];
    } else {
        lvpItems = new LabelledComponent[4];
    }
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_IMPLEMENTATION), new JLabel(version.getImplementationVersion()));
    lvpItems[0] = tmpLabelC;
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_PROTOCOL_VERSION), new JLabel(version.getProtocolVersion()));
    lvpItems[1] = tmpLabelC;
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_TARGET_JMS_VERSION), new JLabel(version.getTargetJMSVersion()));
    lvpItems[2] = tmpLabelC;
    // The Patchids are listed in a panel on the right.
    if (patchids != null && patchids.length >= 1) {
        JPanel patchPanel = new JPanel();
        GridBagLayout gb = new GridBagLayout();
        patchPanel.setLayout(gb);
        GridBagConstraints c2 = new GridBagConstraints();
        for (int p = 0; p < patchids.length; p++) {
            c2.gridx = 0;
            c2.gridy = p;
            c2.ipadx = 0;
            c2.ipady = 0;
            c2.anchor = GridBagConstraints.WEST;
            JLabel patchLabel = new JLabel(patchids[p]);
            gb.setConstraints(patchLabel, c2);
            patchPanel.add(patchLabel);
        }
        tmpLabelC = new LabelledComponent(acr.getString(acr.I_PATCHES), patchPanel, LabelledComponent.NORTH);
        lvpItems[3] = tmpLabelC;
    }
    lvp = new LabelValuePanel(lvpItems, 4, 0);
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(lvp, c);
    rightPanel.add(lvp);
    label = new JLabel(acr.getString(acr.I_JAVA_VERSION) + System.getProperty("java.version") + " " + System.getProperty("java.vendor") + " " + System.getProperty("java.home"));
    c.gridx = 0;
    c.gridy = gridy++;
    c.insets = new Insets(5, 0, 0, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    String classpathStr = System.getProperty("java.class.path");
    classpathStr = classpathStr.replace(File.pathSeparatorChar, '\n');
    ta = new JTextArea(classpathStr);
    ta.setEditable(false);
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    Color bgColor = rightPanel.getBackground();
    ta.setBackground(bgColor);
    Color fgColor = label.getForeground();
    ta.setForeground(fgColor);
    ta.setFont(label.getFont());
    width = label.getPreferredSize().width;
    ta.setSize(width, 1);
    tmpLabelC = new LabelledComponent(acr.getString(acr.I_JAVA_CLASSPATH), ta, LabelledComponent.NORTH);
    c.gridx = 0;
    c.gridy = gridy++;
    c.insets = new Insets(0, 0, 0, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(tmpLabelC, c);
    rightPanel.add(tmpLabelC);
    sep = new JSeparator();
    c.gridx = 0;
    c.gridy = gridy++;
    c.fill = GridBagConstraints.HORIZONTAL;
    c.insets = new Insets(5, 0, 5, 0);
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(sep, c);
    rightPanel.add(sep);
    /*
         * Reset
         */
    c.fill = GridBagConstraints.NONE;
    c.insets = new Insets(0, 0, 0, 0);
    ta = new JTextArea(version.getCopyright(Version.SHORT_COPYRIGHT), 8, 0);
    ta.setEditable(false);
    ta.setLineWrap(true);
    ta.setWrapStyleWord(true);
    bgColor = rightPanel.getBackground();
    ta.setBackground(bgColor);
    fgColor = label.getForeground();
    ta.setForeground(fgColor);
    ta.setFont(label.getFont());
    // width = label.getPreferredSize().width;
    width = rightPanel.getPreferredSize().width;
    ta.setSize(width, 1);
    sp = new JScrollPane(ta);
    c.gridx = 0;
    c.gridy = gridy++;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(sp, c);
    rightPanel.add(sp);
    label = new JLabel(acr.getString(acr.I_RSA_CREDIT));
    c.gridx = 0;
    c.gridy = gridy++;
    c.ipady = 10;
    c.anchor = GridBagConstraints.WEST;
    gridbag.setConstraints(label, c);
    rightPanel.add(label);
    return rightPanel;
}
Also used : LabelValuePanel(com.sun.messaging.jmq.admin.apps.console.util.LabelValuePanel) JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) JTextArea(javax.swing.JTextArea) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) Color(java.awt.Color) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator) LabelledComponent(com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent) Version(com.sun.messaging.jmq.Version)

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