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


Java GraphicalViewer.getProperty方法代码示例

本文整理汇总了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()));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:25,代码来源:ReportEditor.java

示例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);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:AGraphicEditor.java

示例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);
	

}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:63,代码来源:AbstractVisualEditor.java

示例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()));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:33,代码来源:AbstractVisualEditor.java


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