本文整理了Java中javax.swing.JToolBar.removeAll()
方法的一些代码示例,展示了JToolBar.removeAll()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JToolBar.removeAll()
方法的具体详情如下:
包路径:javax.swing.JToolBar
类名称:JToolBar
方法名:removeAll
暂无
代码示例来源:origin: stanfordnlp/CoreNLP
private void buildTagPanel() {
if (tagPanel == null) {
tagPanel = new JToolBar(SwingConstants.VERTICAL);
tagPanel.setFloatable(false);
frame.getContentPane().add(tagPanel, BorderLayout.EAST);
} else {
tagPanel.removeAll();
}
if (classifier != null) {
makeTagMaps();
Set<String> tags = classifier.labels();
String backgroundSymbol = classifier.backgroundSymbol();
for (String tag : tags) {
if (backgroundSymbol.equals(tag)) { continue; }
Color color = tagToColorMap.get(tag);
JButton b = new JButton(tag, new ColorIcon(color));
tagPanel.add(b);
}
}
tagPanel.revalidate();
tagPanel.repaint();
}
代码示例来源:origin: stanfordnlp/CoreNLP
private void buildTagPanel() {
if (tagPanel == null) {
tagPanel = new JToolBar(SwingConstants.VERTICAL);
tagPanel.setFloatable(false);
frame.getContentPane().add(tagPanel, BorderLayout.EAST);
} else {
tagPanel.removeAll();
}
if (classifier != null) {
makeTagMaps();
Set<String> tags = classifier.labels();
String backgroundSymbol = classifier.backgroundSymbol();
for (String tag : tags) {
if (backgroundSymbol.equals(tag)) { continue; }
Color color = tagToColorMap.get(tag);
JButton b = new JButton(tag, new ColorIcon(color));
tagPanel.add(b);
}
}
tagPanel.revalidate();
tagPanel.repaint();
}
代码示例来源:origin: org.netbeans.api/org-openide-awt
@Override
public void removeAll() {
super.removeAll();
overflowToolbar.removeAll();
}
代码示例来源:origin: org.netbeans.api/org-openide-awt
private void handleOverflowRemoval() {
if (overflowToolbar.getComponents().length > 0) {
remove(overflowButton);
handleIconResize();
for (Component comp : overflowToolbar.getComponents()) {
add(comp);
}
overflowToolbar.removeAll();
popup.removeAll();
}
}
代码示例来源:origin: edu.stanford.protege/org.protege.editor.core.application
/**
* Removes all actions from the header.
*/
public void removeAllActions() {
toolBar.removeAll();
}
代码示例来源:origin: net.sf.doolin/doolin-gui
@Override
public void clear() {
this.toolBar.removeAll();
}
代码示例来源:origin: protegeproject/protege
/**
* Removes all actions from the header.
*/
public void removeAllActions() {
toolBar.removeAll();
}
代码示例来源:origin: org.protege/protege-editor-core-application
/**
* Removes all actions from the header.
*/
public void removeAllActions() {
toolBar.removeAll();
}
代码示例来源:origin: net.sf.squirrel-sql.thirdparty-non-maven/openide-loaders
/** Removes all ACTION components. */
public void removeAll () {
super.removeAll();
addGrip();
}
代码示例来源:origin: net.sf.taverna.t2.ui-exts/perspective-biocatalogue
/**
* Resets the action toolbar to the original state.
*/
public void resetTreeActionToolbar()
{
tbFilterTreeToolbar.removeAll();
tbFilterTreeToolbar.repaint();
}
代码示例来源:origin: org.java.net.substance/substance
public void removeAllColorChooserPanels() {
Component[] tb = toolBar.getComponents();
for (int i = 0; i < tb.length; i++) {
if (tb[i] instanceof AbstractButton) {
toolBarButtonGroup.remove((AbstractButton) tb[i]);
}
}
toolBar.removeAll();
chooserPanelHolder.removeAll();
northPanel.removeAll();
northPanel.add(previewPanelHolder);
}
代码示例来源:origin: com.github.insubstantial/substance
public void removeAllColorChooserPanels() {
Component[] tb = toolBar.getComponents();
for (int i = 0; i < tb.length; i++) {
if (tb[i] instanceof AbstractButton) {
toolBarButtonGroup.remove((AbstractButton) tb[i]);
}
}
toolBar.removeAll();
chooserPanelHolder.removeAll();
northPanel.removeAll();
northPanel.add(previewPanelHolder);
}
代码示例来源:origin: org.zaproxy/zap
private void disableComponent(HttpPanelComponentInterface component) {
toolBarComponents.remove(component.getButton());
enabledComponents.remove(component);
if (enabledComponents.size() == 0) {
toolBarComponents.removeAll();
}
}
代码示例来源:origin: org.apache.airavata/airavata-xbaya-gui
private void rearrangeToolbarButtons(){
toolbar.removeAll();
String[] groupIds = getSortedGroupIdList();
Map<String, List<ToolbarButton>> tempToolbarButtons=new HashMap<String, List<ToolbarButton>>();
tempToolbarButtons.putAll(toolbarButtons);
for (String groupId : groupIds) {
tempToolbarButtons.remove(groupId);
if (toolbarButtons.containsKey(groupId) && toolbarButtons.get(groupId)!=null) {
List<ToolbarButton> buttons = toolbarButtons.get(groupId);
addButtonsToToolbar(buttons);
}
}
for (String groupId : tempToolbarButtons.keySet()) {
List<ToolbarButton> buttons = tempToolbarButtons.get(groupId);
addButtonsToToolbar(buttons);
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
protected void recreateExtraEditingControls() {
extraTools.removeAll();
if (onSelect != null) {
JButton btnSelectingField = new JButton();
btnSelectingField.setAction(new ModelComponentDecorator.ValueSelectorAction(onSelect));
btnSelectingField.setPreferredSize(new Dimension(EXTRA_BUTTON_WIDTH, EXTRA_BUTTON_WIDTH));
btnSelectingField.setFocusable(false);
extraTools.add(btnSelectingField);
}
if (nullable) {
JButton btnNullingField = new JButton();
btnNullingField.setAction(new NullerAction());
btnNullingField.setPreferredSize(new Dimension(EXTRA_BUTTON_WIDTH, EXTRA_BUTTON_WIDTH));
//btnNullingField.setFocusable(false);
extraTools.add(btnNullingField);
}
for (Component comp : extraTools.getComponents()) {
comp.setEnabled(isEnabled());
checkEvents(comp);
}
}
代码示例来源:origin: com.eas.platypus/platypus-js-forms
@ScriptFunction(jsDoc = CLEAR_JSDOC)
@Override
public void clear() {
super.removeAll();
super.revalidate();
super.repaint();
}
代码示例来源:origin: uk.org.mygrid.taverna/taverna-workbench
/**
* Recreates the toolbar buttons. Useful if a perspective has been removed.
*/
private void refreshPerspectives() {
toolBar.removeAll();
toolBar.repaint();
try {
saveAll();
perspectiveVisibilityMap.clear();
perspectiveVisibilityMenu.removeAll();
initialisePerspectives();
} catch (IOException e) {
logger.error("Error saving perspectives whilst doing a refresh.", e);
}
}
代码示例来源:origin: de.sciss/jsyntaxpane
private void jCmbLangsItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_jCmbLangsItemStateChanged
if (evt.getStateChange() == ItemEvent.SELECTED) {
String lang = jCmbLangs.getSelectedItem().toString();
// save the state of the current JEditorPane, as it's Document is about
// to be replaced.
String oldText = jEdtTest.getText();
// install a new DefaultSyntaxKit on the JEditorPane for the requested language.
jEdtTest.setContentType(lang);
// Recreate the Toolbar
jToolBar1.removeAll();
EditorKit kit = jEdtTest.getEditorKit();
if (kit instanceof DefaultSyntaxKit) {
DefaultSyntaxKit defaultSyntaxKit = (DefaultSyntaxKit) kit;
defaultSyntaxKit.addToolBarActions(jEdtTest, jToolBar1);
}
jToolBar1.validate();
try {
// setText should not be called (read the JavaDocs). Better use the read
// method and create a new document.
jEdtTest.read(new StringReader(oldText), lang);
} catch (IOException ex) {
Logger.getLogger(SyntaxTester.class.getName()).log(Level.SEVERE, null, ex);
}
}
jEdtTest.requestFocusInWindow();
}//GEN-LAST:event_jCmbLangsItemStateChanged
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-terminal-nb
private void setButtons(Action[] actions) {
if (actions == null)
actions = new Action[0];
JButton[] buttons = new JButton[actions.length];
for (int ax = 0; ax < actions.length; ax++) {
Action a = actions[ax];
JButton b = new JButton(a);
buttons[ax] = adjustButton(b);
}
actionBar.removeAll();
if (buttons.length != 0) {
actionBar.setVisible(true);
for (JButton b : buttons) {
actionBar.add(b);
}
} else {
actionBar.setVisible(false);
}
actionBar.revalidate();
actionBar.repaint();
}
代码示例来源:origin: freeplane/freeplane
private void updateIconToolbar(ModeController modeController) {
iconToolBar.removeAll();
iconToolBar.add(modeController.getAction("RemoveIcon_0_Action"))
.setAlignmentX(JComponent.CENTER_ALIGNMENT);
iconToolBar.add(modeController.getAction("RemoveIconAction")).setAlignmentX(JComponent.CENTER_ALIGNMENT);
iconToolBar.add(modeController.getAction("RemoveAllIconsAction")).setAlignmentX(
JComponent.CENTER_ALIGNMENT);
iconToolBar.addSeparator();
if (ResourceController.getResourceController().getBooleanProperty("structured_icon_toolbar")) {
insertSubmenus(iconToolBar);
return;
}
final String[] fpIcons = ResourceController.getResourceController().getProperty("icons.list").split(";");
for (final String icon : fpIcons) {
final MindIcon mindIcon = STORE.getMindIcon(icon);
final AFreeplaneAction iconAction = iconActions.get(mindIcon);
iconToolBar.add(iconAction).setAlignmentX(JComponent.CENTER_ALIGNMENT);
}
final Collection<MindIcon> userIcons = STORE.getUserIcons();
for (final MindIcon icon : userIcons) {
final AFreeplaneAction iconAction = iconActions.get(icon);
iconToolBar.add(iconAction).setAlignmentX(JComponent.CENTER_ALIGNMENT);
}
}
内容来源于网络,如有侵权,请联系作者删除!