本文整理汇总了Java中org.eclipse.gef.GraphicalViewer.setKeyHandler方法的典型用法代码示例。如果您正苦于以下问题:Java GraphicalViewer.setKeyHandler方法的具体用法?Java GraphicalViewer.setKeyHandler怎么用?Java GraphicalViewer.setKeyHandler使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.gef.GraphicalViewer
的用法示例。
在下文中一共展示了GraphicalViewer.setKeyHandler方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureGraphicalViewer
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
getGraphicalViewer().getControl().setBackground(ColorConstants.button);
GraphicalViewer graphicalViewer = getGraphicalViewer();
MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();
graphicalViewer.setRootEditPart(rootEditPart);
// set EditPartFactory
graphicalViewer.setEditPartFactory(new JasperDesignEditPartFactory());
// set rulers providers
RulerProvider provider = new ReportRulerProvider(new ReportRuler(true, RulerProvider.UNIT_PIXELS));
graphicalViewer.setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER, provider);
provider = new ReportRulerProvider(new ReportRuler(false, RulerProvider.UNIT_PIXELS));
graphicalViewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER, provider);
Boolean isRulerVisible = jrContext.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER);
graphicalViewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY, isRulerVisible);
createAdditionalActions();
graphicalViewer.setKeyHandler(new JSSGraphicalViewerKeyHandler(graphicalViewer));
}
示例2: initializeGraphicalViewer
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void initializeGraphicalViewer() {
super.initializeGraphicalViewer();
GraphicalViewer viewer=this.getGraphicalViewer();
viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer));
this.getActionRegistry().registerAction(new ToggleGridAction(viewer));
}
示例3: configureGraphicalViewer
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* Hook the evolution factory into the editor logic and override the standard edit part factory
*/
@Override
public void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
viewer.setEditPartFactory(new DwFeatureModelEditorEditPartFactory(viewer, this));
viewer.setContextMenu(new DwGraphicalFeatureModelEditorContextMenuProvider(getGraphicalViewer(), getActionRegistry()));
viewer.setKeyHandler(new GraphicalViewerKeyHandler(viewer).setParent(getCommonKeyHandler()));
}
示例4: configureGraphicalViewer
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.ui.parts.GraphicalEditor#configureGraphicalViewer()
*/
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
viewer.setEditPartFactory(createDiagramEditPartFactory());
viewer.setRootEditPart(createRootEditPart());
viewer.setKeyHandler(createKeyHandler(viewer));
viewer.setContextMenu(createContextMenuProvider(viewer, getActionRegistry()));
// viewer.getKeyHandler().put(KeyStroke.getPressed(SWT.DEL, 127, 0),
// getActionRegistry().getAction(GEFActionConstants.DELETE));
}
示例5: configureGraphicalViewer
import org.eclipse.gef.GraphicalViewer; //导入方法依赖的package包/类
@Override
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
getGraphicalViewer().getControl().setBackground(ColorConstants.button);
GraphicalViewer graphicalViewer = getGraphicalViewer();
MainDesignerRootEditPart rootEditPart = new MainDesignerRootEditPart();
graphicalViewer.setRootEditPart(rootEditPart);
// set EditPartFactory
graphicalViewer.setEditPartFactory(new JasperDesignEditPartFactory());
// set rulers providers
RulerProvider provider = new ReportRulerProvider(new ReportRuler(true,
RulerProvider.UNIT_PIXELS));
graphicalViewer.setProperty(RulerProvider.PROPERTY_HORIZONTAL_RULER,
provider);
provider = new ReportRulerProvider(new ReportRuler(false,
RulerProvider.UNIT_PIXELS));
graphicalViewer.setProperty(RulerProvider.PROPERTY_VERTICAL_RULER,
provider);
Boolean isRulerVisible = jrContext
.getPropertyBoolean(RulersGridPreferencePage.P_PAGE_RULERGRID_SHOWRULER);
graphicalViewer.setProperty(RulerProvider.PROPERTY_RULER_VISIBILITY,
isRulerVisible);
createAdditionalActions();
graphicalViewer.setKeyHandler(new JSSGraphicalViewerKeyHandler(
graphicalViewer));
}
示例6: 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);
}