本文整理汇总了Java中org.eclipse.gef.GraphicalViewer.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalViewer.getProperty方法的具体用法?Java GraphicalViewer.getProperty怎么用?Java GraphicalViewer.getProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.GraphicalViewer
的用法示例。
在下文中一共展示了GraphicalViewer.getProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: contributeItemsToEditorTopToolbar
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
public void contributeItemsToEditorTopToolbar(IToolBarManager toolbarManager) {
toolbarManager.add(getActionRegistry().getAction(CompileAction.ID));
toolbarManager.add(getActionRegistry().getAction(DatasetAction.ID));
toolbarManager.add(new Separator());
toolbarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
toolbarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));
RZoomComboContributionItem zoomItem = new RZoomComboContributionItem(getEditorSite().getPage());
GraphicalViewer graphicalViewer = getGraphicalViewer();
ZoomManager property = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());
if (property != null)
zoomItem.setZoomManager(property);
zoomItem.setEnabled(true);
toolbarManager.add(zoomItem);
toolbarManager.add(new Separator());
// Contributed actions
List<AContributorAction> contributedActions = JaspersoftStudioPlugin.getExtensionManager().getActions();
for (AContributorAction a : contributedActions) {
a.setJrConfig((JasperReportsConfiguration) getGraphicalViewer().getProperty("JRCONTEXT"));
toolbarManager.add(a);
}
// Global "View" menu items
toolbarManager.add(new ViewSettingsDropDownAction(getActionRegistry()));
}
示例2: configureGraphicalViewer
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer graphicalViewer = getGraphicalViewer();
MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();
graphicalViewer.setRootEditPart(rootEditPart);
// set EditPartFactory
graphicalViewer.setEditPartFactory(createEditParFactory());
graphicalViewer.setKeyHandler(new GraphicalViewerKeyHandler(graphicalViewer));
graphicalViewer.setContextMenu(createContextMenuProvider(graphicalViewer));
ZoomManager zoomManager = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());
getActionRegistry().registerAction(new ZoomInAction(zoomManager));
getActionRegistry().registerAction(new ZoomOutAction(zoomManager));
getActionRegistry().registerAction(new ZoomActualAction(zoomManager));
graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
graphicalViewer.setProperty("JRCONTEXT", jrContext);
}
示例3: createAdditionalActions
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* Creates the additional actions.
*/
protected void createAdditionalActions() {
GraphicalViewer graphicalViewer = getGraphicalViewer();
// Show Grid Action
Boolean isGridVisible = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWGRID, true);
Boolean isSnapToGuides = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGUIDES, true);
Boolean isSnapToGrid = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGRID, true);
Boolean isSnapToGeometry = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SNAPTOGEOMETRY,
true);
int gspaceX = jrContext.getPropertyInteger(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEX, 10);
int gspaceY = jrContext.getPropertyInteger(RulersGridPreferencePage.P_PAGE_RULERGRID_GRIDSPACEY, 10);
graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_ENABLED, isSnapToGrid.booleanValue());
graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_VISIBLE, isGridVisible.booleanValue());
graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_ORIGIN, new Point(30, 30));
graphicalViewer.setProperty(SnapToGrid.PROPERTY_GRID_SPACING, new Dimension(gspaceX, gspaceY));
graphicalViewer.setProperty(SnapToGuidesAction.ID, isSnapToGuides);
graphicalViewer.setProperty(SnapToGeometry.PROPERTY_SNAP_ENABLED, isSnapToGeometry.booleanValue());
IAction showGrid = new ShowGridAction(jrContext);
getActionRegistry().registerAction(showGrid);
SnapToGridAction snapGridAction = new SnapToGridAction(jrContext);
getActionRegistry().registerAction(snapGridAction);
SizeGridAction sizeGridAction = new SizeGridAction(jrContext);
getActionRegistry().registerAction(sizeGridAction);
// snap to geometry
IAction snapAction = new SnapToGeometryAction(jrContext);
getActionRegistry().registerAction(snapAction);
snapAction = new SnapToGuidesAction(jrContext);
getActionRegistry().registerAction(snapAction);
// show rullers
IAction showRulers = new ShowRullersAction(jrContext);
getActionRegistry().registerAction(showRulers);
// zoom manager actions
ZoomManager zoomManager = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());
getActionRegistry().registerAction(new ZoomInAction(zoomManager));
getActionRegistry().registerAction(new ZoomOutAction(zoomManager));
getActionRegistry().registerAction(new ZoomActualAction(zoomManager));
graphicalViewer.setProperty(MouseWheelHandler.KeyGenerator.getKey(SWT.MOD1), MouseWheelZoomHandler.SINGLETON);
// set context menu
graphicalViewer.setContextMenu(new AppContextMenuProvider(graphicalViewer, getActionRegistry()));
graphicalViewer.setProperty("JRCONTEXT", jrContext);
LayoutManager.addActions(getActionRegistry(), this, getSelectionActions());
JaspersoftStudioPlugin.getDecoratorManager().registerActions(getActionRegistry(), getSelectionActions(),
getGraphicalViewer(), this);
JaspersoftStudioPlugin.getEditorSettingsManager().registerActions(getActionRegistry(), jrContext);
}
示例4: contributeItemsToEditorTopToolbar
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* Contributes items to the specified toolbar that is supposed to be put on the top right of the current visual editor
* (i.e: ReportEditor, CrosstabEditor, TableEditor, ListEditor).
* <p>
*
* Default behavior contributes the following items:
* <ul>
* <li>Zoom In</li>
* <li>Zoom Out</li>
* <li>Zoom Combo</li>
* <li>Global "View" settings drop down menu</li>
* </ul>
*
* Sub-classes may want to override this method to modify the toolbar.
*
* @param toolbarManager
* the toolbar manager to be enriched
*/
public void contributeItemsToEditorTopToolbar(IToolBarManager toolbarManager) {
toolbarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_IN));
toolbarManager.add(getActionRegistry().getAction(GEFActionConstants.ZOOM_OUT));
RZoomComboContributionItem zoomItem = new RZoomComboContributionItem(getEditorSite().getPage());
GraphicalViewer graphicalViewer = getGraphicalViewer();
ZoomManager property = (ZoomManager) graphicalViewer.getProperty(ZoomManager.class.toString());
if (property != null)
zoomItem.setZoomManager(property);
zoomItem.setEnabled(true);
toolbarManager.add(zoomItem);
toolbarManager.add(new Separator());
// Global "View" menu items
toolbarManager.add(new ViewSettingsDropDownAction(getActionRegistry()));
}