本文整理匯總了Java中org.eclipse.jface.action.Separator類的典型用法代碼示例。如果您正苦於以下問題:Java Separator類的具體用法?Java Separator怎麽用?Java Separator使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
Separator類屬於org.eclipse.jface.action包,在下文中一共展示了Separator類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createPartControl
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
@Override
public void createPartControl ( final Composite parent )
{
this.container = parent;
createEditingDomain ();
parent.setLayout ( new FillLayout () );
this.viewer = new TreeViewer ( parent );
this.viewer.setAutoExpandLevel ( 2 );
this.viewer.setContentProvider ( new AdapterFactoryContentProvider ( this.factory ) );
this.viewer.setLabelProvider ( new AdapterFactoryLabelProvider ( this.factory ) );
createContextMenuFor ( this.viewer );
new AdapterFactoryTreeEditor ( this.viewer.getTree (), this.factory );
getViewSite ().setSelectionProvider ( this.viewer );
attachSelectionService ();
getViewSite ().getActionBars ().getMenuManager ().add ( new Separator ( "additions" ) );
this.actionBarContributor.init ( getViewSite ().getActionBars () );
this.actionBarContributor.setViewPart ( this );
}
示例2: addImageHyperlinkToolBarContribution
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
protected void addImageHyperlinkToolBarContribution(final IManagedForm headerForm,
final IToolBarManager toolBarManager, final BaseControlContribution baseControlContribution,
final DataModel<?, ?, ?> model) {
final Separator separator = new Separator();
toolBarManager.add(separator);
toolBarManager.add(baseControlContribution);
baseControlContribution.addControlDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (!model.isDestroyed()) {
// Only do this clean up when the model destruction caused the widget disposal
// WARNING: toolBarManager.update(true); throws a NullPointer if called during app exit.
return;
}
toolBarManager.remove(separator);
separator.dispose();
toolBarManager.remove(baseControlContribution);
toolBarManager.update(true);
}
});
}
示例3: fillContextMenu
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
private void fillContextMenu(IMenuManager manager) {
if (_TableViewer.getSelection().isEmpty()) {
return;
}
manager.add(_NewZnodeAction);
manager.add(new Separator());
manager.add(_OpenAction);
manager.add(new Separator());
manager.add(_TableEditAction);
manager.add(_TableEditChildrenAction);
manager.add(new Separator());
if (_DeleteAction.isEnabled()) {
manager.add(_DeleteAction);
}
manager.add(new Separator());
manager.add(_RefreshAction);
}
示例4: fillContextMenu
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
@Override
public void fillContextMenu(IMenuManager manager) {
ZooKeeperOpenAction openAction = getOpenAction();
if (openAction != null && openAction.isEnabled()) {
manager.add(openAction);
}
ZooKeeperDeleteAction deleteAction = getDeleteAction();
if (deleteAction != null && deleteAction.isEnabled()) {
manager.add(new Separator());
manager.add(deleteAction);
}
RefreshAction refreshAction = getRefreshAction();
if (refreshAction != null && refreshAction.isEnabled()) {
manager.add(new Separator());
manager.add(refreshAction);
}
}
示例5: fillToolbar
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
private void fillToolbar ( final IContributionManager contributionManager )
{
contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.MINUTES, "<1m>", "Scale to one minute" ) );
contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.HOURS, "<1h>", "Scale to one hour" ) );
contributionManager.add ( new SetTimespanAction ( 1, TimeUnit.DAYS, "<1d>", "Scale to one day" ) );
contributionManager.add ( new CenterNowAction () );
contributionManager.add ( new Separator () );
contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.DAYS, "<1d", "Move back 1 day" ) );
contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.HOURS, "<1h", "Move back 1 hour" ) );
contributionManager.add ( new PageTimespanAction ( -1, TimeUnit.MINUTES, "<1m", "Move back 1 minute" ) );
contributionManager.add ( new Separator () );
contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.MINUTES, "1m>", "Move forward 1 minute" ) );
contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.HOURS, "1h>", "Move forward 1 hour" ) );
contributionManager.add ( new PageTimespanAction ( 1, TimeUnit.DAYS, "1d>", "Move forward 1 day" ) );
contributionManager.add ( new Separator () );
contributionManager.add ( new HelpAction () );
}
示例6: createContextMenuFor
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
/**
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createContextMenuFor ( StructuredViewer viewer )
{
MenuManager contextMenu = new MenuManager ( "#PopUp" ); //$NON-NLS-1$
contextMenu.add ( new Separator ( "additions" ) ); //$NON-NLS-1$
contextMenu.setRemoveAllWhenShown ( true );
contextMenu.addMenuListener ( this );
Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
viewer.getControl ().setMenu ( menu );
getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () };
viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) );
}
示例7: createViewMenu
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
private void createViewMenu(MenuManager menuManager) {
MenuManager viewMenu = createMenu(menuManager, MenuConstants.VIEW);
menuManager.add(viewMenu);
viewMenu.setVisible(true);
if (actionFactory == null) {
actionFactory = new ActionFactory(this);
}
viewMenu.add(actionFactory.getAction(GridViewAction.class.getName()));
viewMenu.add(actionFactory.getAction(FormattedViewAction.class.getName()));
viewMenu.add(actionFactory.getAction(UnformattedViewAction.class.getName()));
viewMenu.add(new Separator());
viewMenu.add(actionFactory.getAction(ReloadAction.class.getName()));
viewDataPreferencesVO = getViewDataPreferencesFromPreferenceFile();
viewMenu.add(actionFactory.getAction(PreferencesAction.class.getName()));
}
示例8: createContextMenuFor
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
/**
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createContextMenuFor ( StructuredViewer viewer )
{
MenuManager contextMenu = new MenuManager ( "#PopUp" );
contextMenu.add ( new Separator ( "additions" ) );
contextMenu.setRemoveAllWhenShown ( true );
contextMenu.addMenuListener ( this );
Menu menu = contextMenu.createContextMenu ( viewer.getControl () );
viewer.getControl ().setMenu ( menu );
getSite ().registerContextMenu ( contextMenu, new UnwrappingSelectionProvider ( viewer ) );
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance (), LocalSelectionTransfer.getTransfer (), FileTransfer.getInstance () };
viewer.addDragSupport ( dndOperations, transfers, new ViewerDragAdapter ( viewer ) );
viewer.addDropSupport ( dndOperations, transfers, new EditingDomainViewerDropAdapter ( editingDomain, viewer ) );
}
示例9: addGlobalActions
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void addGlobalActions(IMenuManager menuManager) {
menuManager.insertAfter("additions-end", new Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
menuManager.insertAfter("ui-actions", refreshViewerAction);
super.addGlobalActions(menuManager);
}
示例10: fillContextMenu
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
private void fillContextMenu(IMenuManager manager) {
manager.add(actionRelaunch);
manager.add(actionRelaunchFailed);
manager.add(actionStop);
manager.add(new Separator());
manager.add(actionLock);
manager.add(new Separator());
// Other plug-ins can contribute their actions here
manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
}
示例11: fillLocalToolBar
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
private void fillLocalToolBar(IToolBarManager manager) {
manager.add(actionShowHistory);
manager.add(new Separator());
manager.add(actionLock);
manager.add(new Separator());
manager.add(actionRelaunch);
manager.add(actionRelaunchFailed);
manager.add(actionStop);
}
示例12: createContextMenuFor
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
/**
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createContextMenuFor(StructuredViewer viewer) {
MenuManager contextMenu = new MenuManager("#PopUp");
contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
Menu menu= contextMenu.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
示例13: addGlobalActions
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
/**
* This inserts global actions before the "additions-end" separator.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
@Override
protected void addGlobalActions(IMenuManager menuManager) {
menuManager.insertAfter("additions-end", new Separator("ui-actions"));
menuManager.insertAfter("ui-actions", showPropertiesViewAction);
refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
menuManager.insertAfter("ui-actions", refreshViewerAction);
super.addGlobalActions(menuManager);
}
示例14: createContextMenuFor
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
/**
* This creates a context menu for the viewer and adds a listener as well registering the menu for extension.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/
protected void createContextMenuFor(StructuredViewer viewer) {
MenuManager contextMenu = new MenuManager("#PopUp");
contextMenu.add(new Separator("additions"));
contextMenu.setRemoveAllWhenShown(true);
contextMenu.addMenuListener(this);
Menu menu= contextMenu.createContextMenu(viewer.getControl());
viewer.getControl().setMenu(menu);
getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer));
int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK;
Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), FileTransfer.getInstance() };
viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer));
viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer));
}
示例15: createControl
import org.eclipse.jface.action.Separator; //導入依賴的package包/類
public void createControl(Composite parent) {
super.createControl(parent);
labelProvider = new BatchEditorOutlineLabelProvider();
TreeViewer viewer = getTreeViewer();
viewer.setContentProvider(contentProvider);
viewer.addDoubleClickListener(this);
viewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
viewer.addSelectionChangedListener(this);
/* it can happen that input is already updated before control created */
if (input != null) {
viewer.setInput(input);
}
toggleLinkingAction = new ToggleLinkingAction();
toggleLinkingAction.setActionDefinitionId(IWorkbenchCommandConstants.NAVIGATE_TOGGLE_LINK_WITH_EDITOR);
IActionBars actionBars = getSite().getActionBars();
IToolBarManager toolBarManager = actionBars.getToolBarManager();
toolBarManager.add(toggleLinkingAction);
IMenuManager viewMenuManager = actionBars.getMenuManager();
viewMenuManager.add(new Separator("EndFilterGroup")); //$NON-NLS-1$
viewMenuManager.add(new Separator("treeGroup")); //$NON-NLS-1$
viewMenuManager.add(toggleLinkingAction);
/*
* when no input is set on init state - let the editor rebuild outline
* (async)
*/
if (input == null && editor != null) {
editor.rebuildOutline();
}
}