本文整理汇总了Java中org.eclipse.gef.ui.actions.ZoomComboContributionItem.setZoomManager方法的典型用法代码示例。如果您正苦于以下问题:Java ZoomComboContributionItem.setZoomManager方法的具体用法?Java ZoomComboContributionItem.setZoomManager怎么用?Java ZoomComboContributionItem.setZoomManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.ui.actions.ZoomComboContributionItem
的用法示例。
在下文中一共展示了ZoomComboContributionItem.setZoomManager方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setActivePage
import org.eclipse.gef.ui.actions.ZoomComboContributionItem; //导入方法依赖的package包/类
@Override
public void setActivePage(IEditorPart activeEditor) {
final MainDiagramEditor editor = (MainDiagramEditor) activeEditor;
final ERDiagramActionBarContributor actionBarContributor = editor.getActionBarContributor();
final IActionBars actionBars = getActionBars();
actionBars.clearGlobalActionHandlers();
actionBars.getToolBarManager().removeAll();
actionBarContributor.init(actionBars, editor.getEditorSite().getPage());
actionBarContributor.setActiveEditor(editor);
final ZoomComboContributionItem item =
(ZoomComboContributionItem) getActionBars().getToolBarManager().find(GEFActionConstants.ZOOM_TOOLBAR_WIDGET);
if (item != null) {
final ZoomManager zoomManager = (ZoomManager) editor.getAdapter(ZoomManager.class);
item.setZoomManager(zoomManager);
}
getActionBars().updateActionBars();
}
示例2: setActivePage
import org.eclipse.gef.ui.actions.ZoomComboContributionItem; //导入方法依赖的package包/类
@Override
public void setActivePage(IEditorPart activeEditor) {
IActionBars actionBars = this.getActionBars();
actionBars.clearGlobalActionHandlers();
actionBars.getToolBarManager().removeAll();
BODesignerEditor editor = (BODesignerEditor) activeEditor;
BODiagramActionBarContributor activeContributor =editor.getActionBarContributor();
if (this.zoomComboContributionItem == null) {
this.zoomComboContributionItem = new ZoomComboContributionItem(
this.getPage());
}
activeContributor.contributeToToolBar(actionBars.getToolBarManager(),
this.zoomComboContributionItem);
activeContributor.setActiveEditor(editor);
ZoomComboContributionItem item = (ZoomComboContributionItem) getActionBars()
.getToolBarManager().find(
GEFActionConstants.ZOOM_TOOLBAR_WIDGET);
if (item != null) {
ZoomManager zoomManager = (ZoomManager) editor
.getAdapter(ZoomManager.class);
item.setZoomManager(zoomManager);
}
actionBars.updateActionBars();
}
示例3: setActivePage
import org.eclipse.gef.ui.actions.ZoomComboContributionItem; //导入方法依赖的package包/类
@Override
public void setActivePage(IEditorPart activeEditor) {
IActionBars actionBars = this.getActionBars();
actionBars.clearGlobalActionHandlers();
actionBars.getToolBarManager().removeAll();
ERDiagramEditor editor = (ERDiagramEditor) activeEditor;
ERDiagramActionBarContributor activeContributor = editor
.getActionBarContributor();
if (this.zoomComboContributionItem == null) {
this.zoomComboContributionItem = new ZoomComboContributionItem(
this.getPage());
}
activeContributor.setActiveEditor(editor);
EditPart editPart = editor.getGraphicalViewer().getContents();
ERDiagram diagram = (ERDiagram) editPart.getModel();
activeContributor.contributeToToolBar(diagram,
actionBars.getToolBarManager(), this.zoomComboContributionItem);
ZoomComboContributionItem item = (ZoomComboContributionItem) getActionBars()
.getToolBarManager().find(
GEFActionConstants.ZOOM_TOOLBAR_WIDGET);
if (item != null) {
ZoomManager zoomManager = (ZoomManager) editor
.getAdapter(ZoomManager.class);
item.setZoomManager(zoomManager);
}
actionBars.updateActionBars();
}
示例4: contributeToToolBar
import org.eclipse.gef.ui.actions.ZoomComboContributionItem; //导入方法依赖的package包/类
public void contributeToToolBar( IToolBarManager tbm )
{
tbm.add( new Separator( ) );
String[] zoomStrings = new String[]{
ZoomManager.FIT_ALL,
ZoomManager.FIT_HEIGHT,
ZoomManager.FIT_WIDTH
};
ZoomComboContributionItem zoomComboContributionItem = new ZoomComboContributionItem( getPage( ),
zoomStrings ) {
protected Control createControl( Composite parent )
{
Control control = super.createControl( parent );
control.setToolTipText( Messages.getString( "DesignerActionBarContributor.menu.zoomCombo.tooltip" ) );
return control;
}
};
if ( getPage( ) != null && getPage( ).getActivePart( ) != null )
{
zoomComboContributionItem.setZoomManager( (ZoomManager) getPage( ).getActivePart( )
.getAdapter( ZoomManager.class ) );
}
zoomComboContributionItem.setVisible( true );
tbm.add( zoomComboContributionItem );
toggleBreadcrumbAction = new ToggleBreadcrumbAction( getPage( ) );
tbm.add( toggleBreadcrumbAction );
}