use of com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent 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);
}
use of com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent 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);
}
use of com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent 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);
}
use of com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent 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);
}
use of com.sun.messaging.jmq.admin.apps.console.util.LabelledComponent 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);
}
Aggregations