/** * コンストラクタ. * * @param diagram * ERDiagram * @param editPartFactory * ERDiagramEditPartFactory * @param outlinePage * ERDiagramOutlinePage * @param editDomain * DefaultEditDomain */ public ERDiagramEditor(ERDiagram diagram, ERDiagramEditPartFactory editPartFactory, ERDiagramOutlinePage outlinePage, DefaultEditDomain editDomain, ERDiagramPaletteRoot palette) { this.diagram = diagram; this.editPartFactory = editPartFactory; this.outlinePage = outlinePage; this.palette = palette; this.setEditDomain(editDomain); try { this.extensionLoader = new ExtensionLoader(this); } catch (CoreException e) { ERDiagramActivator.showExceptionDialog(e); } }
/** * Returns the file associated. * <p> * Given the current edit part belonging to the active JRXML editor (report designer) the related file is returned. * * @return the associated file resource */ public IResource getAssociatedFile() { IEditorInput edinput = null; if (getViewer() != null && getViewer().getEditDomain() instanceof DefaultEditDomain) { IEditorPart ip = ((DefaultEditDomain) getViewer().getEditDomain()).getEditorPart(); edinput = ip.getEditorInput(); } else { IEditorPart ep = SelectionHelper.getActiveJRXMLEditor(); if (ep != null) edinput = ep.getEditorInput(); } if (edinput instanceof IFileEditorInput) { return ((IFileEditorInput) edinput).getFile(); } return null; }
public MainDiagramEditor(ERDiagram diagram, ERDiagramEditPartFactory editPartFactory, ZoomComboContributionItem zoomComboContributionItem, ERDiagramOutlinePage outlinePage) { Activator.debug(this, "constructor", "...Creating diagram editor: " + diagram); this.diagram = diagram; this.editPartFactory = editPartFactory; this.zoomComboContributionItem = zoomComboContributionItem; this.propertySheetPage = new PropertySheetPage(); this.propertySheetPage.setPropertySourceProvider(new ERDiagramPropertySourceProvider()); try { this.extensionLoader = new ExtensionLoader(this); } catch (final CoreException e) { Activator.showExceptionDialog(e); } setEditDomain(new DefaultEditDomain(this)); initializeOutlinePage(outlinePage); }
/** * {@inheritDoc} A Shape from type compartmenttype has as a figure a * {@link ORMCompartmentV1Figure}, when the user didn't step in it, and a * {@link ORMCompartmentV2Figure}, when the user did step in it. */ @Override protected IFigure createFigure() { final ORMGraphicalEditor editorPart = (ORMGraphicalEditor) ((DefaultEditDomain) getViewer() .getEditDomain()).getEditorPart(); Figure fig = ORMFigureFactory.createFigure(this); // when this compartment editpart is not "opened"(steped in) use as // figure // ORMCompartmentV1Figure if (fig instanceof ORMCompartmentV1Figure) { return fig; } // when this edit part is "opened"(steped in) use ORMCompartmentV2Figure else { return completeORMCompartmentV2Figure((Shape) getModel(), editorPart.getIsEditorData(), fig); } }
/** * * Execute the command that performs the StepIn or the StepOut. * * It is assumed that this method is executed directly after {@link Step#calculateEnabled() * calculateEnabled()} */ @Override public void run() { // get the editorpart to get the selection manager and with the selection manager you can // deselect the selected element after the creation of the attribute or the method ORMGraphicalEditor editorPart = (ORMGraphicalEditor) ((DefaultEditDomain) editPart.getViewer().getEditDomain()) .getEditorPart(); SaveAction save = new SaveAction(editorPart); // send the request to the editpart for execution. execute(editPart.getCommand(request)); save.run(); // deselect the selected element for case that the user forget to deselect the element // when not deselected the shortcut behaviour and the contextmenu behaviour can confuse the user editorPart.getOwnViewer().getSelectionManager().deselectAll(); }
@Override protected void initializeViewer(final Composite parent) { parent.setLayout(new FillLayout()); // Create the viewer using the supplied parent viewer = createGraphicalViewer(); final Control c = viewer.createControl(parent); c.setBackground(ColorConstants.white); // Create and initialize the root edit part final ScalableRootEditPart root = new ScalableRootEditPart(); viewer.setRootEditPart(root); viewer.setEditDomain(new DefaultEditDomain(null)); // Create and initialize the edit part factory final EditPartFactory factory = createEditPartFactory(); viewer.setEditPartFactory(factory); // Register the viewer as a selection provider getSite().setSelectionProvider(viewer); }
/** * コンストラクタ. * * @param diagram * ERDiagram * @param editPartFactory * ERDiagramEditPartFactory * @param outlinePage * ERDiagramOutlinePage * @param editDomain * DefaultEditDomain */ public ERDiagramEditor(final ERDiagram diagram, final ERDiagramEditPartFactory editPartFactory, final ERDiagramOutlinePage outlinePage, final DefaultEditDomain editDomain, final ERDiagramPaletteRoot palette) { this.diagram = diagram; this.editPartFactory = editPartFactory; this.outlinePage = outlinePage; this.palette = palette; setEditDomain(editDomain); try { extensionLoader = new ExtensionLoader(this); } catch (final CoreException e) { ERDiagramActivator.showExceptionDialog(e); } }
public ERDiagramMultiPageEditor() { propertySheetPage = new PropertySheetPage(); propertySheetPage.setPropertySourceProvider(new ERDiagramPropertySourceProvider(this)); gotoMaker = new ERDiagramGotoMarker(this); editDomain = new DefaultEditDomain(this); pallet = new ERDiagramPaletteRoot(); }
public ERDiagramMultiPageEditor() { this.propertySheetPage = new PropertySheetPage(); this.propertySheetPage .setPropertySourceProvider(new ERDiagramPropertySourceProvider( this)); this.gotoMaker = new ERDiagramGotoMarker(this); this.editDomain = new DefaultEditDomain(this); this.pallet = new ERDiagramPaletteRoot(); }
@Override public void performRequest(Request req) { if (RequestConstants.REQ_OPEN.equals(req.getType())) { Object value = ((ANode) getModel()).getValue(); IEditorPart editorPart = ((DefaultEditDomain) getViewer().getEditDomain()).getEditorPart(); openEditor(value, editorPart, ((ANode) getModel())); } super.performRequest(req); }
@Override public void run() { for(Object selectedElement : getSelectedObjects()){ if (selectedElement instanceof SubreportFigureEditPart){ SubreportFigureEditPart subReport = (SubreportFigureEditPart)selectedElement; Object value = ((ANode) subReport.getModel()).getValue(); IEditorPart editorPart = ((DefaultEditDomain) subReport.getViewer().getEditDomain()).getEditorPart(); EditableFigureEditPart.openEditor(value, editorPart, (ANode) subReport.getModel()); } } }
/** * The constructor of this class. This class is initialized through calling the constructor of the * parent class and through setting the global variables. * */ public ORMShapeComponentEditPolicy(EditPart host) { super(); ORMGraphicalEditor editor = (ORMGraphicalEditor) ((DefaultEditDomain) host.getViewer().getEditDomain()).getEditorPart(); editorPart = (ORMMultiPageEditor) editor.getParentEditor(); hostEditPart = (AbstractGraphicalEditPart) host; hostModel = hostEditPart.getModel(); }
/** * {@inheritDoc} In this method we get the {@link ORMGraphicalEditor}, which owns the * {@link RelationshipConstraintsAction}. After we got the editor we derive from it the * {@link RelationshipConstraintsAction}, set the action up and run the action through calling the * run method. */ @Override public void execute() { final ORMGraphicalEditor editorPart = (ORMGraphicalEditor) ((DefaultEditDomain) editPart.getViewer().getEditDomain()) .getEditorPart(); action = (RelationshipConstraintsAction) editorPart.getEditorActionRegistry().getAction( RelationshipConstraintsAction.RLSHIP_CONSTRAINTS_ID); action.setEditPart(editPart); action.run(); }
/** * The constructor of this class. The most of the gloabal variables are * initialized here and the {@link EditDomain} ot the editor is set here as * well. * */ public ORMGraphicalEditor(final IEditorPart editor, final Resource resource, final boolean flag) { isEditorData = flag; parentEditor = editor; cdResource = resource; changeNotifier = new EditorChangeNotifier(this); editorType = EditorType.COMPARTMENT; // standard is compartment setEditDomain(new DefaultEditDomain(this)); }
/** * This method creates and send the creation request for a attribute, when the user selected a * attribute, or a operation, when the user selected a operation, to the editpart to which the * attribute or operation should be added. The editpart to which the attribute or operation is * added is the parenteditpart of the selected attribute or opeartion. * * */ @Override public void run() { // get the editorpart to get the selection manager and with the selection manager you can // deselect the selected element after the creation of the attribute or the method ORMGraphicalEditor editorPart = (ORMGraphicalEditor) ((DefaultEditDomain) editPart.getViewer().getEditDomain()) .getEditorPart(); CreateRequest request = new CreateRequest(); // decide and setup the creation request for attribute or opeartion Segment segment = (Segment) editPart.getModel(); Shape shape = (Shape) editPart.getParent().getModel(); if (shape.getFirstSegment().equals(segment)) { request.setFactory(new ORMAttributeFactory()); } if (shape.getSecondSegment().equals(segment)) { request.setFactory(new ORMOperationFactory()); } // send the creation request to the editpart execute(editPart.getCommand(request)); // get the editpart of the newly created attribute or method for starting the initial edit of // the name of the element final Object o = editorPart.getOwnViewer().getEditPartRegistry().get(request.getNewObject()); if (o instanceof EditPart) { EditPart part = (EditPart) o; Request directrequest = new DirectEditRequest(); // start initial edit of the name of the attribute or the method part.performRequest(directrequest); }; // deselect the selected element for case that the user forget to deselect the element // when not deselected the shortcut behaviour and the contextmenu behaviour can confuse the user editorPart.getOwnViewer().getSelectionManager().deselectAll(); }
public ProcessDesignerEditor(SnakerFlowDesignerEditor parent, IFile file) { super(parent); try { parent.model = ((BaseElement) this.model); } catch (Exception e) { e.printStackTrace(); } DefaultEditDomain defaultEditDomain = new DefaultEditDomain(this); setEditDomain(defaultEditDomain); }
protected void configGraphicalViewer( ) { viewer = new DeferredGraphicalViewer( ) { protected void fireSelectionChanged( ) { // do nothing } }; DeferredGraphicalViewer reportViewer = (DeferredGraphicalViewer) viewer; // reportViewer.hookRefreshListener( getRefreshManager( ) ); if (model instanceof ReportDesignHandle) { String orientation = ((ReportDesignHandle)model).getBidiOrientation( ); if (DesignChoiceConstants.BIDI_DIRECTION_RTL.equals( orientation )) { hostShell = new Shell( SWT.RIGHT_TO_LEFT ); } else { hostShell = new Shell( SWT.LEFT_TO_RIGHT ); } } else { hostShell = new Shell( ); } reportViewer.createControl( hostShell ); reportViewer.setEditDomain( new DefaultEditDomain( null ) ); reportViewer.setRootEditPart( new ReportRootEditPart( ) ); reportViewer.setEditPartFactory( new GraphicalPartFactory( ) ); reportViewer.setContents( model ); reportViewer.flush( ); }
public BODesignerEditor(BOModelDiagram diagram, BODesignerEditorPartFactory partFactory, BODesignerOutlinePage outlinePage) { DefaultEditDomain domain = new DefaultEditDomain(this); this.setEditDomain(domain); this.diagram = diagram; this.editPartFactory = partFactory; this.outlinePage = outlinePage; }
public FunctionDesignerEditor(PartFactory part,Diagram pageDiagram) { DefaultEditDomain domain = new DefaultEditDomain(this); this.setEditDomain(domain); this.diagram = new BOModelDiagram(); HdbTableModel table=new HdbTableModel(); table.setTitle(pageDiagram.getName()); table.setRectangle(new Rectangle(20,20,200,200)); diagram.addTableModel(table); this.editPartFactory = new BODesignerEditorPartFactory(); //this.outlinePage = new BODesignerOutlinePage(); }
@Override public void init(IEditorSite site, IEditorInput input) throws PartInitException { setEditDomain(new DefaultEditDomain(this)); if (input instanceof GraphicalEditorInput) { GraphicalEditorInput modelInput = (GraphicalEditorInput) input; if (modelInput.getDescriptor() != null) { setPartName(Labels.getDisplayName(modelInput.getDescriptor())); } } super.init(site, input); }
public SankeyDiagram(FullResultProvider result, DQResult dqResult, CalculationSetup setup) { this.dqResult = dqResult; setEditDomain(new DefaultEditDomain(this)); this.result = result; productSystem = setup.productSystem; linkSearchMap = new ProcessLinkSearchMap(productSystem.getProcessLinks()); sankeyResult = new SankeyResult(productSystem, result); if (productSystem != null) setPartName(productSystem.getName()); }
/** * Constructs a new Viewer object, using the default edit domain. */ public MouseWheelEvents() { setEditDomain(new DefaultEditDomain(this)); this.addMouseWheelListener(new ZoomHandler()); //This code is not working now, it should be listing to the current active page //addListener(); }
public IntLogicalSysEditor() { super(); setEditDomain(new DefaultEditDomain(this)); }
public IntFinalAssemblyEditor() { super(); setEditDomain(new DefaultEditDomain(this)); }
public IntDeploymentEditor() { super(); setEditDomain(new DefaultEditDomain(this)); }
public CompImplEditor() { super(); setEditDomain(new DefaultEditDomain(this)); }
public InitAssemblyEditor() { super(); setEditDomain(new DefaultEditDomain(this)); }
public GW4EEditor() { setEditDomain(new DefaultEditDomain(this)); getPalettePreferences().setPaletteState(FlyoutPaletteComposite.STATE_PINNED_OPEN); }
/** * Instantiates a new ETL graphical editor. */ public ELTGraphicalEditor() { setEditDomain(new DefaultEditDomain(this)); }
public GraphicalEditorPage(StructuredTextEditor xmlEditor){ this.setEditDomain(new DefaultEditDomain(this)); this.xmlEditor=xmlEditor; }
public DbToolGefEditor() { setEditDomain(new DefaultEditDomain(this)); }
public DefaultEditDomain getEditDomain() { return super.getEditDomain(); }
public DwGraphicalFeatureModelViewer(){ setEditDomain(new DefaultEditDomain(this)); }
public GUIEditor() { setEditDomain(new DefaultEditDomain(this)); }
public DefaultEditDomain getEditorEditDomain() { return getEditDomain(); }
public AGraphicEditor(JasperReportsConfiguration jrContext) { super(); setEditDomain(new DefaultEditDomain(this)); this.jrContext = jrContext; }
@Override public DefaultEditDomain getEditDomain() { return super.getEditDomain(); }