org.eclipse.gef.EditDomain Java Examples

The following examples show how to use org.eclipse.gef.EditDomain. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CrossflowValidationDecoratorProvider.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof CrossflowDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
Example #2
Source File: ProcessValidationDecoratorProvider.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
* @generated
*/
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		Object model = editPart.getModel();
		if ((model instanceof View)) {
			View view = (View) model;
			if (!(view instanceof Edge) && !view.isSetElement()) {
				return;
			}
		}
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (((DiagramEditDomain) ed).getEditorPart() instanceof ProcessDiagramEditor) {
			decoratorTarget.installDecorator(KEY, new StatusDecorator(decoratorTarget));
		}
	}
}
 
Example #3
Source File: ERDiagramOutlinePage.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
public void setCategory(final EditDomain editDomain, final GraphicalViewer graphicalViewer, final MenuManager outlineMenuMgr, final ActionRegistry registry) {
    this.graphicalViewer = graphicalViewer;
    viewer.setContextMenu(outlineMenuMgr);

    // エディット・ドメインの設定
    viewer.setEditDomain(editDomain);
    this.registry = registry;

    if (getSite() != null) {
        resetView(registry);
    }
}
 
Example #4
Source File: StatechartValidationDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof BorderItemEditPart)
		return;
	if (editPart instanceof IPrimaryEditPart
			&& (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart)) {
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (shouldInstall(((DiagramEditDomain) ed).getEditorPart())) {
			decoratorTarget.installDecorator(getDecoratorKey(), createStatusDecorator(decoratorTarget, issueStore));
		}
	}
}
 
Example #5
Source File: TransitionPriorityDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (shouldInstall(((DiagramEditDomain) ed).getEditorPart()) && editPart instanceof TransitionEditPart) {
			IDecorator decorator = createStatusDecorator(decoratorTarget);
			decorators.add(decorator);
			decoratorTarget.installDecorator(getDecoratorKey(), decorator);
		}
	}
}
 
Example #6
Source File: RegionPriorityDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (shouldInstall(((DiagramEditDomain) ed).getEditorPart()) && editPart instanceof RegionEditPart) {
			IDecorator decorator = createStatusDecorator(decoratorTarget);
			decorators.add(decorator);
			decoratorTarget.installDecorator(getDecoratorKey(), decorator);
		}
	}
}
 
Example #7
Source File: AbstractMarkerBasedDecorationProvider.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public void createDecorators(IDecoratorTarget decoratorTarget) {
	EditPart editPart = (EditPart) decoratorTarget.getAdapter(EditPart.class);
	if (editPart instanceof GraphicalEditPart || editPart instanceof AbstractConnectionEditPart) {
		EditDomain ed = editPart.getViewer().getEditDomain();
		if (!(ed instanceof DiagramEditDomain)) {
			return;
		}
		if (shouldInstall(((DiagramEditDomain) ed).getEditorPart())) {
			decoratorTarget.installDecorator(getDecoratorKey(), createStatusDecorator(decoratorTarget));
		}
	}
}
 
Example #8
Source File: ERDiagramOutlinePage.java    From erflute with Apache License 2.0 5 votes vote down vote up
public void setCategory(EditDomain editDomain, GraphicalViewer graphicalViewer, ActionRegistry registry) {
    this.graphicalViewer = graphicalViewer;

    viewer.setEditDomain(editDomain);
    this.registry = registry;

    if (getSite() != null) {
        resetView(registry);
    }
}
 
Example #9
Source File: DeferredGraphicalViewer.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
public void setEditDomain( EditDomain domain )
{
	super.setEditDomain( domain );
	eventDispatcher = new ReportDomainEventDispatcher( domain, this );
	eventDispatcher.setEnableKeyTraversal( true );
	getLightweightSystem( ).setEventDispatcher( eventDispatcher );

}
 
Example #10
Source File: ERDiagramOutlinePage.java    From ermaster-b with Apache License 2.0 5 votes vote down vote up
public void setCategory(EditDomain editDomain,
		GraphicalViewer graphicalViewer, MenuManager outlineMenuMgr,
		ActionRegistry registry) {
	this.graphicalViewer = graphicalViewer;
	this.viewer.setContextMenu(outlineMenuMgr);

	// �G�f�B�b�g�E�h���C���̐ݒ�
	this.viewer.setEditDomain(editDomain);
	this.registry = registry;

	if (this.getSite() != null) {
		this.resetView(registry);
	}
}
 
Example #11
Source File: LinkGroupsPage.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private Composite createCubeArea( Composite parent )
{
	Composite viewerContent = new Composite( parent, SWT.BORDER );
	GridData gd = new GridData( GridData.FILL_BOTH );
	gd.widthHint = 500;
	gd.heightHint = 300;
	viewerContent.setLayoutData( gd );
	viewerContent.setLayout( new FillLayout( ) );
	viewer = new ScrollingGraphicalViewer( );
	EditDomain editDomain = new EditDomain( );
	ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart( );
	viewer.setRootEditPart( root );
	viewer.setEditDomain( editDomain );
	viewer.createControl( viewerContent );
	viewer.getControl( ).setBackground( ColorConstants.listBackground );
	factory = new GraphicalEditPartsFactory( );
	viewer.setEditPartFactory( factory );
	viewer.setKeyHandler( new GraphicalViewerKeyHandler( viewer ) );
	viewer.addSelectionChangedListener( new ISelectionChangedListener( ) {

		public void selectionChanged( SelectionChangedEvent event )
		{
			if ( event.getSelection( ) != null )
			{
				StructuredSelection selection = (StructuredSelection) event.getSelection( );
				if ( selection.getFirstElement( ) instanceof HierarchyNodeEditPart
						|| selection.getFirstElement( ) instanceof DatasetNodeEditPart )
				{
					Object obj = selection.getFirstElement( );
					if ( obj instanceof HierarchyNodeEditPart )
					{
						TabularHierarchyHandle hierarchy = (TabularHierarchyHandle) ( (HierarchyNodeEditPart) obj ).getModel( );
						if ( hierarchy.getPrimaryKeys( ) != null
								&& hierarchy.getPrimaryKeys( ).size( ) > 0 )
						{
							filterButton.setEnabled( false );
						}
						else
							filterButton.setEnabled( true );
					}
					else
						filterButton.setEnabled( true );
				}
				else
					filterButton.setEnabled( false );
			}
			else
				filterButton.setEnabled( false );
		}
	} );
	load( );
	return viewerContent;
}
 
Example #12
Source File: ReportDomainEventDispatcher.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * @param d
 * @param v
 */
public ReportDomainEventDispatcher( EditDomain d, EditPartViewer v )
{
	super( d, v );
}
 
Example #13
Source File: ProcessEditPolicyEntries.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ProcessEditPolicyEntries(EditDomain domain) {
	ProcessPaletteFactory paletteFactory = new ProcessPaletteFactory();
	paletteRoot = new PaletteRoot();
	paletteFactory.fillPalette(paletteRoot);
	this.domain = domain;
}
 
Example #14
Source File: OutlinePage.java    From olca-app with Mozilla Public License 2.0 4 votes vote down vote up
public void setEditDomain(EditDomain editDomain) {
	this.editDomain = editDomain;
}