当前位置: 首页>>代码示例>>Java>>正文


Java ToolBarManager.add方法代码示例

本文整理汇总了Java中org.eclipse.jface.action.ToolBarManager.add方法的典型用法代码示例。如果您正苦于以下问题:Java ToolBarManager.add方法的具体用法?Java ToolBarManager.add怎么用?Java ToolBarManager.add使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.jface.action.ToolBarManager的用法示例。


在下文中一共展示了ToolBarManager.add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addResourcesArea

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
private void addResourcesArea(Composite composite) {  
	ResourceSelectionTree.IToolbarControlCreator toolbarControlCreator = new ResourceSelectionTree.IToolbarControlCreator() {
  public void createToolbarControls(ToolBarManager toolbarManager) {
    toolbarManager.add(new ControlContribution("stealLock") {
      protected Control createControl(Composite parent) {
        stealButton = new Button(parent, SWT.CHECK);
        stealButton.setText(Policy.bind("LockDialog.stealLock")); //$NON-NLS-1$		
        return stealButton;
      }
    });
  }
  public int getControlCount() {
    return 1;
  }
};
	resourceSelectionTree = new ResourceSelectionTree(composite, SWT.NONE, "These files will be locked:", files, new HashMap(), null, false, toolbarControlCreator, null); //$NON-NLS-1$    	
	resourceSelectionTree.setShowRemoveFromViewAction(false);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:19,代码来源:SvnWizardLockPage.java

示例2: createToolBarManager

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
/**
 * @see org.eclipse.jface.window.ApplicationWindow#createToolBarManager(int)
 */
@Override
protected ToolBarManager createToolBarManager(final int style) {
	final ToolBarManager toolBarManager = new ToolBarManager(style);

	toolBarManager.add(newFileAction);
	toolBarManager.add(openFileAction);
	toolBarManager.add(saveFileAction);
	toolBarManager.add(new Separator());
	toolBarManager.add(copyUsernameAction);
	toolBarManager.add(copyPasswordAction);
	toolBarManager.add(copyURLAction);
	toolBarManager.add(openUrlAction);
	toolBarManager.add(clearClipboardAction);
	toolBarManager.add(new Separator());
	toolBarManager.add(addRecordAction);
	toolBarManager.add(editRecordAction);
	toolBarManager.add(deleteRecordAction);
	toolBarManager.add(new Separator());
	toolBarManager.add(helpAction);
	return toolBarManager;
}
 
开发者ID:nresare,项目名称:javapasswordsafe,代码行数:25,代码来源:PasswordSafeJFace.java

示例3: populateToolbarActions

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
	final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
	final OpenHelpAction openHelpAction = new OpenHelpAction(iControl);
	tbm.add(openDeclarationAction);
	tbm.add(openHelpAction);
	IInputChangedListener inputChangeListener = new IInputChangedListener()
	{
		public void inputChanged(Object newInput)
		{
			if (newInput instanceof BrowserInformationControlInput)
			{
				openDeclarationAction.update();
				openHelpAction.update();
			}
		}
	};
	iControl.addInputChangeListener(inputChangeListener);
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:21,代码来源:JSTextHover.java

示例4: createContents

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
@Override
protected Control createContents(Composite parent) {
  Composite c = new Composite(parent, SWT.BORDER);

  GridLayout gridLayout = new GridLayout(1, false);
  gridLayout.marginWidth = 0;
  gridLayout.marginHeight = 0;
  gridLayout.horizontalSpacing = 0;
  gridLayout.verticalSpacing = 0;
  c.setLayout(gridLayout);

  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  c.setLayoutData(gd);

  ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
  toolBarManager.add(new OpenFilesAction(this));
  toolBarManager.add(new ScreenshotAction(this, false));
  toolBarManager.add(new ScreenshotAction(this, true));
  toolBarManager.add(new SaveScreenShotAction(this));
  ToolBar tb = toolBarManager.createControl(c);
  tb.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  mUiAutomatorView = new UiAutomatorView(c, SWT.BORDER);
  mUiAutomatorView.setLayoutData(new GridData(GridData.FILL_BOTH));

  return parent;
}
 
开发者ID:DroidTesting,项目名称:android-uiautomatorviewer,代码行数:28,代码来源:UiAutomatorViewer.java

示例5: addtoolbarAction

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
private void addtoolbarAction(ToolBarManager toolBarManager, final ImagePathConstant imagePath, Action action) {

		ImageDescriptor exportImageDescriptor = new ImageDescriptor() {
			@Override
			public ImageData getImageData() {
				return imagePath.getImageFromRegistry().getImageData();
			}
		};
		action.setImageDescriptor(exportImageDescriptor);
		toolBarManager.add(action);
	}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:12,代码来源:DebugDataViewer.java

示例6: addtoolbarAction

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
/**
 * Addtoolbar action.
 *
 * @param toolBarManager the tool bar manager
 * @param imagePath the image path
 * @param action the action
 */
private void addtoolbarAction(ToolBarManager toolBarManager, final ImagePathConstant imagePath, Action action) {

	ImageDescriptor exportImageDescriptor = new ImageDescriptor() {
		@Override
		public ImageData getImageData() {
			return imagePath.getImageFromRegistry().getImageData();
		}
	};
	action.setImageDescriptor(exportImageDescriptor);
	toolBarManager.add(action);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:19,代码来源:ExecutionTrackingConsole.java

示例7: configureControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
protected void configureControl(
		IXtextBrowserInformationControl control, ToolBarManager tbm,
		String font) {
	OpenInHelpAction openHelpAction = new OpenInHelpAction();
	openHelpAction.setEnabled(true);
	tbm.add(openHelpAction);
	tbm.update(true);
}
 
开发者ID:Yakindu,项目名称:solidity-ide,代码行数:9,代码来源:CustomCSSHelpHoverProvider.java

示例8: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl iControl = new de.darwinspl.preferences.resource.dwprofile.ui.DwprofileBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) {
					de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput input = (de.darwinspl.preferences.resource.dwprofile.ui.DwprofileDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:DwprofileTextHover.java

示例9: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl iControl = new eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) {
					eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput input = (eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:HyexpressionTextHover.java

示例10: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl iControl = new eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) {
					eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput input = (eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:HyvalidityformulaTextHover.java

示例11: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl iControl = new eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) {
					eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput input = (eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavalueDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:HydatavalueTextHover.java

示例12: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl iControl = new eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) {
					eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput input = (eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:HymappingTextHover.java

示例13: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl iControl = new eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) {
					eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput input = (eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:HyconstraintsTextHover.java

示例14: doCreateInformationControl

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
public IInformationControl doCreateInformationControl(Shell parent) {
	if (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl.isAvailable(parent)) {
		ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
		eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl iControl = new eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestBrowserInformationControl(parent, FONT, tbm);
		final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(iControl);
		tbm.add(openDeclarationAction);
		final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
		
		IInputChangedListener inputChangeListener = new IInputChangedListener() {
			public void inputChanged(Object newInput) {
				if (newInput == null) {
					selectionProvider.setSelection(new StructuredSelection());
				} else if (newInput instanceof eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) {
					eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput input = (eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestDocBrowserInformationControlInput) newInput;
					Object inputElement = input.getInputElement();
					selectionProvider.setSelection(new StructuredSelection(inputElement));
					// If there is an element of type EObject in the input element, the button to open
					// the declaration will be set enable
					boolean isEObjectInput = inputElement instanceof EObject;
					openDeclarationAction.setEnabled(isEObjectInput);
					if (isEObjectInput) {
						String simpleName = inputElement.getClass().getSimpleName();
						simpleName = simpleName.substring(0, simpleName.length() - 4);
						openDeclarationAction.setText("Open " + simpleName);
					} else							openDeclarationAction.setText("Open Declaration");
				}
			}
		};
		iControl.addInputChangeListener(inputChangeListener);
		
		tbm.update(true);
		return iControl;
	} else {
		return new DefaultInformationControl(parent, true);
	}
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:37,代码来源:HymanifestTextHover.java

示例15: addActions

import org.eclipse.jface.action.ToolBarManager; //导入方法依赖的package包/类
private void addActions(final ToolBarManager manager, final CommonStructureControl cssControl) {
    manager.add(new NewNodeAction(cssControl));
    manager.add(new DeleteNodeAction(cssControl));
    manager.add(new Separator());
    manager.add(new MoveUpNodeAction(cssControl));
    manager.add(new MoveDownNodeAction(cssControl));
    manager.add(new PromoteNodeAction(cssControl));
    manager.add(new DemoteNodeAction(cssControl));

    manager.update(true);
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:12,代码来源:ClassificationAdminDialog.java


注:本文中的org.eclipse.jface.action.ToolBarManager.add方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。