Java 类org.eclipse.gef.DefaultEditDomain 实例源码

项目:ermaster-k    文件:ERDiagramEditor.java   
/**
 * コンストラクタ.
 * 
 * @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);
    }
}
项目:PDFReporter-Studio    文件:AJDEditPart.java   
/**
 * 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;
}
项目:PDFReporter-Studio    文件:TreeEditPart.java   
/**
 * 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;
}
项目:erflute    文件:MainDiagramEditor.java   
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);
}
项目:ermaster-nhit    文件:ERDiagramEditor.java   
/**
 * コンストラクタ.
 * 
 * @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);
    }
}
项目:FRaMED    文件:ORMCompartmentEditPart.java   
/**
 * {@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);
    }
}
项目:FRaMED    文件:StepAction.java   
/**
 * 
 * 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();
}
项目:jive    文件:AbstractGraphicalJiveView.java   
@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);
}
项目:ermasterr    文件:ERDiagramEditor.java   
/**
 * コンストラクタ.
 * 
 * @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);
    }
}
项目:ermasterr    文件:ERDiagramMultiPageEditor.java   
public ERDiagramMultiPageEditor() {
    propertySheetPage = new PropertySheetPage();
    propertySheetPage.setPropertySourceProvider(new ERDiagramPropertySourceProvider(this));

    gotoMaker = new ERDiagramGotoMarker(this);
    editDomain = new DefaultEditDomain(this);
    pallet = new ERDiagramPaletteRoot();
}
项目:ermaster-k    文件:ERDiagramMultiPageEditor.java   
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();
}
项目:PDFReporter-Studio    文件:EditableFigureEditPart.java   
@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);
}
项目:PDFReporter-Studio    文件:OpenEditorAction.java   
@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());
        }
    }
}
项目:ermaster-nhit    文件:ERDiagramMultiPageEditor.java   
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();
}
项目:FRaMED    文件:ORMShapeComponentEditPolicy.java   
/**
 * 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();
}
项目:FRaMED    文件:CallRelationshipConstraintsActionCommand.java   
/**
 * {@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();

}
项目:FRaMED    文件:ORMGraphicalEditor.java   
/**
 * 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));
}
项目:FRaMED    文件:CreateAttributeOperationAction.java   
/**
 * 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();
}
项目:snaker-designer    文件:ProcessDesignerEditor.java   
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);
}
项目:birt    文件:ReportGraphicsViewPainter.java   
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( );
}
项目:wt-studio    文件:BODesignerEditor.java   
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;
}
项目:wt-studio    文件:FunctionDesignerEditor.java   
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();
}
项目:olca-app    文件:ProductSystemGraphEditor.java   
@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);
}
项目:olca-app    文件:SankeyDiagram.java   
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());
}
项目:OnionUmlVisualization    文件:MouseWheelEvents.java   
/**
     * 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();
   }
项目:Open_Source_ECOA_Toolset_AS5    文件:IntLogicalSysEditor.java   
public IntLogicalSysEditor() {
    super();
    setEditDomain(new DefaultEditDomain(this));
}
项目:Open_Source_ECOA_Toolset_AS5    文件:IntFinalAssemblyEditor.java   
public IntFinalAssemblyEditor() {
    super();
    setEditDomain(new DefaultEditDomain(this));
}
项目:Open_Source_ECOA_Toolset_AS5    文件:IntDeploymentEditor.java   
public IntDeploymentEditor() {
    super();
    setEditDomain(new DefaultEditDomain(this));
}
项目:Open_Source_ECOA_Toolset_AS5    文件:CompImplEditor.java   
public CompImplEditor() {
    super();
    setEditDomain(new DefaultEditDomain(this));
}
项目:Open_Source_ECOA_Toolset_AS5    文件:InitAssemblyEditor.java   
public InitAssemblyEditor() {
    super();
    setEditDomain(new DefaultEditDomain(this));
}
项目:gw4e.project    文件:GW4EEditor.java   
public GW4EEditor() {
    setEditDomain(new DefaultEditDomain(this));
    getPalettePreferences().setPaletteState(FlyoutPaletteComposite.STATE_PINNED_OPEN);
}
项目:Hydrograph    文件:ELTGraphicalEditor.java   
/**
 * Instantiates a new ETL graphical editor.
 */
public ELTGraphicalEditor() {
    setEditDomain(new DefaultEditDomain(this));
}
项目:bdf2    文件:GraphicalEditorPage.java   
public GraphicalEditorPage(StructuredTextEditor xmlEditor){
    this.setEditDomain(new DefaultEditDomain(this));
    this.xmlEditor=xmlEditor;
}
项目:bdf2    文件:DbToolGefEditor.java   
public DbToolGefEditor() {
    setEditDomain(new DefaultEditDomain(this));
}
项目:bdf2    文件:DbToolGefEditor.java   
public DefaultEditDomain getEditDomain() {
    return super.getEditDomain();
}
项目:DarwinSPL    文件:DwGraphicalFeatureModelViewer.java   
public DwGraphicalFeatureModelViewer(){
    setEditDomain(new DefaultEditDomain(this)); 
}
项目:ForgedUI-Eclipse    文件:GUIEditor.java   
public GUIEditor() {
    setEditDomain(new DefaultEditDomain(this));
}
项目:ForgedUI-Eclipse    文件:GUIEditor.java   
public DefaultEditDomain getEditorEditDomain() {
    return getEditDomain();
}
项目:PDFReporter-Studio    文件:AGraphicEditor.java   
public AGraphicEditor(JasperReportsConfiguration jrContext) {
    super();
    setEditDomain(new DefaultEditDomain(this));
    this.jrContext = jrContext;
}
项目:PDFReporter-Studio    文件:AGraphicEditor.java   
@Override
public DefaultEditDomain getEditDomain() {
    return super.getEditDomain();
}