javax.swing.JToolBar.addSeparator()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(203)

本文整理了Java中javax.swing.JToolBar.addSeparator()方法的一些代码示例,展示了JToolBar.addSeparator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.addSeparator()方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:addSeparator

JToolBar.addSeparator介绍

暂无

代码示例

代码示例来源:origin: org.netbeans.api/org-openide-util

/** Create the default toolbar representation of an array of actions.
* Null items in the array will add a separator to the toolbar.
*
* @param actions actions to show in the generated toolbar
* @return a toolbar instance displaying them
*/
public static JToolBar createToolbarPresenter(SystemAction[] actions) {
  JToolBar p = new JToolBar();
  for (SystemAction action : actions) {
    if (action == null) {
      p.addSeparator();
    } else if (action instanceof Presenter.Toolbar) {
      p.add(((Presenter.Toolbar) action).getToolbarPresenter());
    }
  }
  return p;
}

代码示例来源:origin: log4j/log4j

tb.add(fontCombo);
tb.add(fontSizeCombo);
tb.addSeparator();
tb.addSeparator();
tb.add(newButton);

代码示例来源:origin: skylot/jadx

toolbar.add(saveAllAction);
toolbar.add(exportAction);
toolbar.addSeparator();
toolbar.add(syncAction);
toolbar.add(flatPkgButton);
toolbar.addSeparator();
toolbar.add(textSearchAction);
toolbar.add(clsSearchAction);
toolbar.addSeparator();
toolbar.add(backAction);
toolbar.add(forwardAction);
toolbar.addSeparator();
toolbar.add(deobfToggleBtn);
toolbar.addSeparator();
toolbar.add(logAction);
toolbar.addSeparator();
toolbar.add(prefsAction);
toolbar.addSeparator();
toolbar.add(Box.createHorizontalGlue());
toolbar.add(updateLink);

代码示例来源:origin: 4thline/cling

portMappingToolBar.addSeparator();
portMappingToolBar.add(addButton);
portMappingToolBar.add(deleteButton);

代码示例来源:origin: org.netbeans.api/org-openide-util-ui

/** Create the default toolbar representation of an array of actions.
* Null items in the array will add a separator to the toolbar.
*
* @param actions actions to show in the generated toolbar
* @return a toolbar instance displaying them
*/
public static JToolBar createToolbarPresenter(SystemAction[] actions) {
  JToolBar p = new JToolBar();
  for (SystemAction action : actions) {
    if (action == null) {
      p.addSeparator();
    } else if (action instanceof Presenter.Toolbar) {
      p.add(((Presenter.Toolbar) action).getToolbarPresenter());
    }
  }
  return p;
}

代码示例来源:origin: camunda/camunda-bpm-platform

tb.add(fontCombo);
tb.add(fontSizeCombo);
tb.addSeparator();
tb.addSeparator();
tb.add(newButton);

代码示例来源:origin: stackoverflow.com

tools.add(new JButton("Save")); // TODO - add functionality!
tools.add(new JButton("Restore")); // TODO - add functionality!
tools.addSeparator();
tools.add(new JButton("Resign")); // TODO - add functionality!
tools.addSeparator();
tools.add(message);

代码示例来源:origin: jshiell/checkstyle-idea

progressPanel.add(configurationOverrideCombo);
progressPanel.add(Box.createHorizontalStrut(4));
progressPanel.addSeparator();
progressPanel.add(Box.createHorizontalStrut(4));
progressPanel.add(progressLabel);

代码示例来源:origin: Nepxion/Discovery

private void initializeToolBar() {
  JSecurityAction addServiceAction = createAddServiceAction();
  comboBox = new JBasicComboBox();
  comboBox.setPreferredSize(new Dimension(300, comboBox.getPreferredSize().height));
  comboBox.addItemListener(new ItemListener() {
    public void itemStateChanged(ItemEvent e) {
      if (comboBox.getSelectedItem() != e.getItem()) {
        addServiceAction.execute(null);
      }
    }
  });
  textField = new JBasicTextField();
  textField.setPreferredSize(new Dimension(650, textField.getPreferredSize().height));
  JToolBar toolBar = getGraph().getToolbar();
  toolBar.addSeparator();
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(new JLabel(ConsoleLocale.getString("service_list")));
  toolBar.add(Box.createHorizontalStrut(5));
  toolBar.add(comboBox);
  toolBar.add(new JClassicButton(addServiceAction));
  toolBar.add(new JClassicButton(createDeleteServiceAction()));
  toolBar.add(textField);
  toolBar.add(new JClassicButton(createExecuteRouterAction()));
  toolBar.add(new JClassicButton(createClearRouterAction()));
  ButtonManager.updateUI(toolBar);
}

代码示例来源:origin: geotools/geotools

cursorToolGrp.add(btn);
toolBar.addSeparator();
cursorToolGrp.add(btn);
toolBar.addSeparator();
toolBar.add(btn);
toolBar.addSeparator();

代码示例来源:origin: Nepxion/Discovery

toolBar.addSeparator();
toolBar.add(Box.createHorizontalStrut(5));
toolBar.add(new JClassicButton(createShowTopologyAction()));
toolBar.addSeparator();
toolBar.add(new JClassicButton(createExecuteGrayReleaseAction()));
toolBar.add(new JClassicButton(createExecuteGrayRouterAction()));
toolBar.add(new JClassicButton(createPushGlobalConfigAction()));
toolBar.add(pushControllMenubutton);
toolBar.addSeparator();
toolBar.add(createConfigButton(true));

代码示例来源:origin: pentaho/mondrian

jToolBar1.add(addPropertyButton);
jToolBar1.add(addCalculatedMemberPropertyButton);
jToolBar1.addSeparator();
jToolBar1.add(addVirtualCubeButton);
jToolBar1.add(addVirtualCubeDimensionButton);
jToolBar1.add(addVirtualCubeMeasureButton);
jToolBar1.addSeparator();
jToolBar1.add(addRoleButton);
jToolBar1.addSeparator();
jToolBar1.addSeparator();
jToolBar1.add(deleteButton);
jToolBar1.addSeparator();
jToolBar1.add(editModeButton);

代码示例来源:origin: com.synaptix/SynaptixSwing

private JComponent buildStatusEditor() {
  JToolBar toolBar = new JToolBar();
  toolBar.setFloatable(false);
  toolBar.add(menuSelectionAction);
  toolBar.addSeparator();
  toolBar.add(allSelectionAction);
  toolBar.addSeparator();
  toolBar.add(noneSelectionAction);
  return toolBar;
}

代码示例来源:origin: org.zaproxy/zap

private void enableComponent(HttpPanelComponentInterface component) {
  enabledComponents.add(component);
  Collections.sort(enabledComponents, getComponentsComparator());
  if (enabledComponents.size() == 1) {
    toolBarComponents.addSeparator();
    toolBarComponents.addSeparator();
  }
  toolBarComponents.add(component.getButton(), enabledComponents.indexOf(component)+1);
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

@Override
public void addSeparator() {
  toolbar.addSeparator();
  toolbar.repaint();
}

代码示例来源:origin: org.netbeans.modules/org-netbeans-lib-profiler-ui

@Override
public void addSpace(int width) {
  toolbar.addSeparator(new Dimension(width, 0));
  toolbar.repaint();
}

代码示例来源:origin: ribomation/DroidAtScreen1

public static JToolBar createToolbar(String... commandNames) {
  JToolBar tb = new JToolBar();
  for (String cmdName : commandNames) {
    if (cmdName.equals("-")) {
      tb.addSeparator();
    } else {
      tb.add(Command.get(cmdName).createButton());
    }
  }
  return tb;
}

代码示例来源:origin: org.xworker/xworker_core

public static void createSeparator(ActionContext actionContext){
  Thing self = (Thing) actionContext.get("self");
  JToolBar parent = (JToolBar) actionContext.get("parent");
  
  Dimension size = AwtCreator.createDimension(self, "size", actionContext);
  if(size == null){
    parent.addSeparator();
  }else{
    parent.addSeparator(size);
  }
}

代码示例来源:origin: edu.stanford.protege/ca.uvic.cs.chisel.cajun

public void addToolBarComponent(Component component) {
  if (component == null) {
    getToolBar().addSeparator();
  } else {
    getToolBar().add(component);
  }
}

代码示例来源:origin: Audiveris/audiveris

/**
 * The separator will be inserted only if it is really necessary
 */
@Override
public void addSeparator ()
{
  int count = super.getComponentCount();
  if ((count > 0) && !(getComponent(count - 1) instanceof JSeparator)) {
    super.addSeparator(gap);
  }
}

相关文章

JToolBar类方法