use of javax.swing.JSeparator in project binnavi by google.
the class CProjectNodeMenuBuilder method createMenu.
@Override
protected void createMenu(final JComponent menu) {
if ((m_projects.length == 1) && (m_addAddressSpaceAction == null)) {
// We delay the creation of the m_addAddressSpaceAction object because we need to have
// getSelectionUpdater working.
final INaviProject singleProject = m_projects[0];
m_addAddressSpaceAction = CActionProxy.proxy(new CAddAddressSpaceAction(getProjectTree(), singleProject, getSelectionUpdater()));
updateActions(singleProject);
}
final boolean isSingleSelection = m_projects.length == 1;
if (canOpen()) {
menu.add(new JMenuItem(m_loadProjectAction));
menu.add(new JSeparator());
}
if (isSingleSelection) {
// We can not search in more than one project at a time, and only if the project
// is already loaded.
menu.add(new JMenuItem(m_searchViewAction));
menu.add(new JSeparator());
// We do not allow the user to add address spaces to more than one
// project at a time. And the project must be loaded too.
menu.add(new JMenuItem(m_addAddressSpaceAction));
menu.add(new JSeparator());
menu.add(new JMenuItem(m_forwardAction));
menu.add(new JSeparator());
}
menu.add(new JMenuItem(CActionProxy.proxy(new CDeleteProjectAction(getParent(), m_database, m_projects, getParentUpdater()))));
if (m_table != null) {
menu.add(new JSeparator());
menu.add(new JMenuItem(CActionProxy.proxy(new CSearchTableAction(getParent(), m_table))));
menu.add(new JMenuItem(CActionProxy.proxy(new CopySelectionAction(m_table))));
}
addPluginMenus(menu);
}
use of javax.swing.JSeparator in project ACS by ACS-Community.
the class AlarmTable method buildPopupMenu.
/**
* Build the popup menu
*/
private void buildPopupMenu() {
popupM.add(ackMI);
popupM.add(showReducedMI);
popupM.add(new JSeparator());
popupM.add(saveMI);
popupM.add(clipMI);
popupM.pack();
ackMI.addActionListener(this);
saveMI.addActionListener(this);
clipMI.addActionListener(this);
showReducedMI.addActionListener(this);
}
use of javax.swing.JSeparator in project ACS by ACS-Community.
the class ZoomPrefsDlg method initialize.
/**
* Init the GUI
*/
private void initialize() {
// Window setup
setTitle("Drill down preferences");
ImageIcon zoomIcon = new ImageIcon(LogTypeHelper.class.getResource("/zoom.png"));
setIconImage(zoomIcon.getImage());
setModal(true);
setDefaultCloseOperation(DISPOSE_ON_CLOSE);
// Window content setup
JPanel contentPanel = new JPanel();
contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));
// The panel with levels
JPanel levelsPnl = new JPanel();
levelsPnl.setBorder(BorderFactory.createTitledBorder("Levels"));
levelsPnl.setLayout(new BoxLayout(levelsPnl, BoxLayout.Y_AXIS));
JPanel minPnl = new JPanel();
minPnl.add(new JLabel("Min log level to load: "));
minLevelCB = buildLogLevelCB(zoomManager.getMinLevel());
minPnl.add(minLevelCB);
levelsPnl.add(minPnl);
JPanel maxPnl = new JPanel();
maxPnl.add(new JLabel("Max log level to load: "));
maxLevelCB = buildLogLevelCB(zoomManager.getMaxLevel());
maxPnl.add(maxLevelCB);
levelsPnl.add(maxPnl);
contentPanel.add(levelsPnl);
// The panel with the folder
JPanel folderPnl = new JPanel(new BorderLayout());
folderPnl.setBorder(BorderFactory.createTitledBorder("Folder of XML files"));
folderPnl.add(folderBtn, BorderLayout.EAST);
folderBtn.addActionListener(this);
folderPnl.add(folderLbl, BorderLayout.CENTER);
setupFolderLbl();
contentPanel.add(folderPnl);
// The Ok/Cancel buttons
contentPanel.add(new JSeparator());
JPanel buttonPnl = new JPanel(new BorderLayout());
buttonPnl.add(cancelBtn, BorderLayout.WEST);
cancelBtn.addActionListener(this);
buttonPnl.add(okBtn, BorderLayout.EAST);
okBtn.addActionListener(this);
okBtn.setEnabled(folder != null);
contentPanel.add(buttonPnl);
rootPane.setContentPane(contentPanel);
}
use of javax.swing.JSeparator in project ACS by ACS-Community.
the class FilterChooserDialog method initialize.
/**
* Init the GUI
*/
private void initialize() {
setLocation(50, 50);
// Add the toolbars
initMenubar();
initToolbar();
JPanel panel = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
description = new JLabel("Select filter to apply");
c = newConstraints(0, 0, 0, 4);
c.gridwidth = 3;
panel.add(description, c);
c = newConstraints(0, 1, 0, 4);
c.gridwidth = 3;
c.weighty = 1.0;
c.fill = GridBagConstraints.BOTH;
filterList = new CheckList();
panel.add(new JScrollPane(filterList), c);
JSeparator sep = new JSeparator();
GridBagConstraints constr = newConstraints(0, 2, 4, 4);
constr.gridwidth = 3;
panel.add(sep, constr);
buttonApply = new JButton("Apply");
buttonApply.addActionListener(bl);
panel.add(buttonApply, newConstraints(0, 3, 4, 4));
buttonRestore = new JButton("Restore");
buttonRestore.addActionListener(bl);
panel.add(buttonRestore, newConstraints(1, 3, 4, 4));
buttonClose = new JButton("Close");
buttonClose.addActionListener(bl);
panel.add(buttonClose, newConstraints(2, 3, 4, 4));
getContentPane().add(panel, BorderLayout.CENTER);
pack();
}
use of javax.swing.JSeparator in project ACS by ACS-Community.
the class ObjectExplorer method initEngines.
/**
* Insert the method's description here.
* Creation date: (9.4.2002 17:46:00)
* @param param java.lang.String[]
*/
private void initEngines(String[] param) {
if (param == null)
return;
for (int i = 0; i < param.length; i++) {
JRadioButtonMenuItem radio = new JRadioButtonMenuItem();
radio.setActionCommand(param[i]);
radio.setName(param[i]);
radio.setText(param[i]);
radio.setSelected(false);
radio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent a) {
startConnect(((JRadioButtonMenuItem) a.getSource()).getName());
}
});
getConnectMenu().add(radio);
}
getConnectMenu().add(new JSeparator());
JMenuItem radio = new JMenuItem();
radio.setActionCommand("Other");
radio.setName("Other");
radio.setText("Other...");
radio.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent a) {
getOtherRemoteAccessDialog().show();
}
});
getConnectMenu().add(radio);
if (param.length > 0)
startConnect(param[0]);
}
Aggregations