本文整理匯總了Java中org.eclipse.jface.action.ToolBarManager類的典型用法代碼示例。如果您正苦於以下問題:Java ToolBarManager類的具體用法?Java ToolBarManager怎麽用?Java ToolBarManager使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ToolBarManager類屬於org.eclipse.jface.action包,在下文中一共展示了ToolBarManager類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCoolBarManager
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
/**
* Create the coolbar manager.
*
* @param style the style
* @return the coolbar manager
*/
@Override
protected CoolBarManager createCoolBarManager(int style) {
CoolBarManager coolBarManager = new CoolBarManager(style);
actionFactory = new ActionFactory(this);
ToolBarManager toolBarManager = new ToolBarManager();
coolBarManager.add(toolBarManager);
addtoolbarAction(toolBarManager, ImagePathConstant.CLEAR_EXEC_TRACKING_CONSOLE,
actionFactory.getAction(ClearConsoleAction.class.getName()));
addtoolbarAction(toolBarManager, ImagePathConstant.CONSOLE_SCROLL_LOCK,
actionFactory.getAction(ScrollLockAction.class.getName()));
return coolBarManager;
}
示例2: fillEditionToolBar
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
protected void fillEditionToolBar(ToolBarManager manager) {
// add element
AddContextualAction(manager,
new AddElementAction("Add new element", IAction.AS_PUSH_BUTTON, Notifications.notifyRefreshReveal(getContext())));
// remove element
AddContextualAction(manager,
new RemoveElementAction("Remove element(s)", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF));
// move up
AddContextualAction(manager,
new MoveInDirectionAction(MoveInDirectionAction.getLabel(Direction.UP), IAction.AS_PUSH_BUTTON, Direction.UP, Notifications.NOT_REF));
// move down
AddContextualAction(manager,
new MoveInDirectionAction(MoveInDirectionAction.getLabel(Direction.DOWN), IAction.AS_PUSH_BUTTON, Direction.DOWN, Notifications.NOT_REF));
// copy
AddContextualAction(manager,
new CopyElementAction("Copy element(s)", IAction.AS_PUSH_BUTTON, Notifications.NONE));
// paste
AddContextualAction(manager,
new PasteElementAction("Paste element(s)", IAction.AS_PUSH_BUTTON, Notifications.NOT_REF));
}
示例3: 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);
}
示例4: 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;
}
示例5: fillCoolBar
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
@Override
protected void fillCoolBar(ICoolBarManager coolBar) {
IToolBarManager toolBar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
coolBar.add(new ToolBarContributionItem(toolBar, "standard")); //$NON-NLS-1$
// For the Back and Forward actions, force their text to be shown on the toolbar,
// not just their image. For the remaining actions, the ActionContributionItem
// is created implicitly with the default presentation mode.
ActionContributionItem backCI = new ActionContributionItem(backAction);
backCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolBar.add(backCI);
ActionContributionItem forwardCI = new ActionContributionItem(forwardAction);
forwardCI.setMode(ActionContributionItem.MODE_FORCE_TEXT);
toolBar.add(forwardCI);
toolBar.add(stopAction);
toolBar.add(refreshAction);
}
示例6: TFContainer
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
public TFContainer(Composite parent, int style) {
super(parent, style);
GridLayout layout = new GridLayout(2,false);
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.verticalSpacing = 0;
setLayout(layout);
toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
additionalToolbar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
GridData additionalToolbarGD = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
additionalToolbar.setLayoutData(additionalToolbarGD);
additionalToolbarManager = new ToolBarManager(additionalToolbar);
content = new Composite(this, SWT.NONE);
stackLayout = new StackLayout();
stackLayout.marginWidth = 0;
stackLayout.marginHeight = 0;
content.setLayout(stackLayout);
content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
}
示例7: createToolBar
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
@Override
protected void createToolBar(Composite parent) {
prmtbar = new Composite(parent, SWT.NONE);
prmtbar.setLayout(new GridLayout(2, false));
prmtbar.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
label = new Label(prmtbar, SWT.NONE);
label.setText(Messages.LeftToolBarManager_label);
label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
topToolBar = new ToolBar(prmtbar, SWT.FLAT | SWT.WRAP | SWT.RIGHT);
tbManager = new ToolBarManager(topToolBar);
fillToolbar(tbManager);
refreshToolbar();
}
示例8: createEmptyWindowContents
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
public Control createEmptyWindowContents(Composite parent)
{
final IWorkbenchWindow window = getWindowConfigurer().getWindow();
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(2, false));
Display display = composite.getDisplay();
Color bgCol = display.getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND);
composite.setBackground(bgCol);
Label label = new Label(composite, SWT.WRAP);
label.setForeground(display
.getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));
label.setBackground(bgCol);
label.setFont(JFaceResources.getFontRegistry().getBold(
JFaceResources.DEFAULT_FONT));
String msg = IDEWorkbenchMessages.IDEWorkbenchAdvisor_noPerspective;
label.setText(msg);
ToolBarManager toolBarManager = new ToolBarManager();
// TODO: should obtain the open perspective action from ActionFactory
openPerspectiveAction =
ActionFactory.OPEN_PERSPECTIVE_DIALOG.create(window);
toolBarManager.add(openPerspectiveAction);
ToolBar toolBar = toolBarManager.createControl(composite);
toolBar.setBackground(bgCol);
return composite;
}
示例9: doCreateInformationControl
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
public IInformationControl doCreateInformationControl(Shell parent)
{
if (BrowserInformationControl.isAvailable(parent))
{
ToolBarManager tbm = new ToolBarManager(SWT.FLAT);
CustomBrowserInformationControl iControl = new CustomBrowserInformationControl(parent, null, tbm);
iControl.setBackgroundColor(documentationHover.getBackgroundColor());
iControl.setForegroundColor(documentationHover.getForegroundColor());
documentationHover.populateToolbarActions(tbm, iControl);
tbm.update(true);
documentationHover.installLinkListener(iControl);
return iControl;
}
else
{
return new DefaultInformationControl(parent, true);
}
}
示例10: createToolBar
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
private void createToolBar(ToolBarManager toolBarManager)
{
final Composite bars = new Composite(fStatusComposite, SWT.NONE);
bars.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
GridLayout layout = new GridLayout(3, false);
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.horizontalSpacing = 0;
layout.verticalSpacing = 0;
bars.setLayout(layout);
fToolBar = toolBarManager.createControl(bars);
GridData gd = new GridData(SWT.BEGINNING, SWT.BEGINNING, false, false);
fToolBar.setLayoutData(gd);
Composite spacer = new Composite(bars, SWT.NONE);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 0;
gd.heightHint = 0;
spacer.setLayoutData(gd);
addMoveSupport(spacer);
addResizeSupportIfNecessary(bars);
}
示例11: 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);
}
示例12: createNavigationBar
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
private void createNavigationBar(Composite parent)
{
toolBarManager = new ToolBarManager(SWT.FLAT);
toolBarManager.add(consoleAction);
toolBarManager.add(backAction);
toolBarManager.add(forwardAction);
toolBarManager.add(stopAction);
toolBarManager.add(refreshAction);
ToolBar toolbar = toolBarManager.createControl(parent);
toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
urlCombo = new Combo(parent, SWT.DROP_DOWN);
urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
urlCombo.addListener(SWT.DefaultSelection, new Listener() {
@Override
public void handleEvent(Event e) {
setURL(urlCombo.getText());
}
});
ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
toolBarManager2.add(goAction);
toolbar = toolBarManager2.createControl(parent);
toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
示例13: populateToolbarActions
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
@Override
public void populateToolbarActions(ToolBarManager tbm, CustomBrowserInformationControl iControl)
{
// @formatter:off
/*
final OpenDOMReferenceAction openReferenceAction = new OpenDOMReferenceAction(iControl);
tbm.add(openReferenceAction);
IInputChangedListener inputChangeListener = new IInputChangedListener()
{
public void inputChanged(Object newInput)
{
if (newInput instanceof BrowserInformationControlInput)
{
openReferenceAction.update();
}
}
};
iControl.addInputChangeListener(inputChangeListener);
*/
// @formatter:on
}
示例14: ctabFolderTest
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
@Test
public void ctabFolderTest() {
InteractiveTest.testCoat("Test coat mux layout behavior inside a CTabFolder.", cmp -> {
Layouts.setGrid(cmp);
CTabFolder folder = new CTabFolder(cmp, SWT.BORDER | SWT.CLOSE);
Layouts.setGridData(folder).grabAll();
ToolBarManager manager = new ToolBarManager();
manager.add(Actions.create("Add", () -> {
CTabItem item = new CTabItem(folder, SWT.NONE);
item.setText("New control");
Composite parent = new Composite(folder, SWT.NONE);
randomColorMux(parent);
item.setControl(parent);
item.addListener(SWT.Dispose, e -> item.getControl().dispose());
folder.setSelection(item);
}));
Layouts.setGridData(manager.createControl(cmp)).grabHorizontal();
});
}
示例15: createUI_20_Actions
import org.eclipse.jface.action.ToolBarManager; //導入依賴的package包/類
private void createUI_20_Actions(final Composite parent) {
final Composite container = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).applyTo(container);
GridLayoutFactory
.fillDefaults()//
.numColumns(2)
.extendedMargins(2, 0, 3, 2)
.applyTo(container);
{
final ToolBar toolbar = new ToolBar(container, SWT.FLAT);
final ToolBarManager tbm = new ToolBarManager(toolbar);
tbm.add(_actionAddColor);
tbm.add(_actionEditSelectedColor);
tbm.add(_actionEditAllColors);
tbm.update(true);
}
}