use of javax.swing.JToolBar in project ACS by ACS-Community.
the class ErrorTreeCellRenderer method getJToolBar.
/**
* This method initializes jToolBar
*
* @return javax.swing.JToolBar
*/
private JToolBar getJToolBar() {
if (jToolBar == null) {
locationField = new JLabel();
locationField.setText("(none)");
locationField.setBackground(Color.WHITE);
jLabel = new JLabel();
jLabel.setText("Path: ");
jToolBar = new JToolBar();
jToolBar.setFloatable(false);
jToolBar.add(getNewDocButton());
jToolBar.add(getEditButton());
jToolBar.add(getCancelEditButton());
jToolBar.add(getSaveButton());
jToolBar.addSeparator();
jToolBar.addSeparator();
jToolBar.addSeparator();
jToolBar.add(jLabel);
jToolBar.add(locationField);
jToolBar.add(getDeleteDocButton());
}
return jToolBar;
}
use of javax.swing.JToolBar in project ACS by ACS-Community.
the class ErrorLogDialog method initGUI.
/**
* Builds the content of the GUI
*
*/
private void initGUI() {
ImageIcon icon = new ImageIcon(LogTypeHelper.class.getResource("/errorLogIcon.png"));
setIconImage(icon.getImage());
synchronized (logTA) {
logTA.setDocument(document);
logTA.setEditable(false);
}
JScrollPane logSP = new JScrollPane(logTA);
JRootPane mainPnl = this.getRootPane();
mainPnl.setLayout(new BorderLayout());
mainPnl.add(logSP, BorderLayout.CENTER);
// Close button
JPanel btnPnl = new JPanel(new FlowLayout());
closeBtn = new JButton("Close");
closeBtn.addActionListener(this);
btnPnl.add(closeBtn);
mainPnl.add(btnPnl, BorderLayout.SOUTH);
// Build the toolbar
toolBar = new JToolBar();
JPanel toolBarPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
ImageIcon cleanIcon = new ImageIcon(ErrorLogDialog.class.getResource("/delete.png"));
cleanAllBtn = new JButton("<HTML><Font size=\"-1\">Clean</FONT></HTML>", cleanIcon);
cleanAllBtn.addActionListener(this);
cleanAllBtn.setToolTipText("Delete log");
ImageIcon saveIcon = new ImageIcon(ErrorLogDialog.class.getResource("/disk.png"));
saveAllBtn = new JButton("<HTML><Font size=\"-1\">Save</FONT></HTML>", saveIcon);
saveAllBtn.addActionListener(this);
saveAllBtn.setToolTipText("Save log");
toolBarPanel.add(cleanAllBtn);
toolBarPanel.add(saveAllBtn);
toolBar.add(toolBarPanel);
mainPnl.add(toolBar, BorderLayout.PAGE_START);
rationalizeButtons();
}
use of javax.swing.JToolBar in project adempiere by adempiere.
the class VTreePanel method barRemove.
// addToBar
/**
* Remove from Bar
*/
private void barRemove() {
//the button in on a JToolBar which is on a CPanel
JToolBar parentBar = (JToolBar) m_buttonSelected.getParent();
Container parentPanel = null;
if (parentBar != null) {
parentPanel = parentBar.getParent();
}
for (JToolBar jt : toolbar) {
jt.remove(m_buttonSelected);
}
if (parentPanel != null && parentBar.getComponentCount() == 1) {
//only label left
bar.remove(parentPanel);
//remove from toolBarMap..
toolbarMap.values().remove(parentBar);
}
bar.validate();
bar.repaint();
barDBupdate(false, Integer.parseInt(m_buttonSelected.getActionCommand()));
}
use of javax.swing.JToolBar in project JMRI by JMRI.
the class JToolBarUtil method loadToolBar.
public static JToolBar loadToolBar(String name, WindowInterface wi, Object context) {
Element root = rootFromName(name);
JToolBar retval = new JToolBar(root.getChild("name").getText());
for (Object item : root.getChildren("node")) {
Action act = actionFromNode((Element) item, wi, context);
if (act == null) {
continue;
}
if (act.getValue(javax.swing.Action.SMALL_ICON) != null) {
// icon present, add explicitly
JButton b = new JButton((javax.swing.Icon) act.getValue(javax.swing.Action.SMALL_ICON));
b.setAction(act);
retval.add(b);
} else {
retval.add(new JButton(act));
}
}
return retval;
}
use of javax.swing.JToolBar in project jdk8u_jdk by JetBrains.
the class InsetsEncapsulation method run.
@Override
public void run() {
runTest(new JLabel("hi"));
runTest(new JMenu());
runTest(new JTree());
runTest(new JTable());
runTest(new JMenuItem());
runTest(new JCheckBoxMenuItem());
runTest(new JToggleButton());
runTest(new JSpinner());
runTest(new JSlider());
runTest(Box.createVerticalBox());
runTest(Box.createHorizontalBox());
runTest(new JTextField());
runTest(new JTextArea());
runTest(new JTextPane());
runTest(new JPasswordField());
runTest(new JFormattedTextField());
runTest(new JEditorPane());
runTest(new JButton());
runTest(new JColorChooser());
runTest(new JFileChooser());
runTest(new JCheckBox());
runTest(new JInternalFrame());
runTest(new JDesktopPane());
runTest(new JTableHeader());
runTest(new JLayeredPane());
runTest(new JRootPane());
runTest(new JMenuBar());
runTest(new JOptionPane());
runTest(new JRadioButton());
runTest(new JRadioButtonMenuItem());
runTest(new JPopupMenu());
runTest(new JScrollBar());
runTest(new JScrollPane());
runTest(new JViewport());
runTest(new JSplitPane());
runTest(new JTabbedPane());
runTest(new JToolBar());
runTest(new JSeparator());
runTest(new JProgressBar());
if (!failures.isEmpty()) {
System.out.println("These classes failed");
for (final Component failure : failures) {
System.out.println(failure.getClass());
}
throw new RuntimeException("Test failed");
}
}
Aggregations