use of org.eclipse.gef.EditPartFactory in project webtools.sourceediting by eclipse.
the class InternalXSDMultiPageEditor method configureGraphicalViewer.
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
graphicalViewer.getKeyHandler().put(KeyStroke.getPressed(SWT.F2, 0), getActionRegistry().getAction(GEFActionConstants.DIRECT_EDIT));
// get edit part factory from extension
EditPartFactory editPartFactory = getEditorModeManager().getCurrentMode().getEditPartFactory();
graphicalViewer.setEditPartFactory(editPartFactory);
}
use of org.eclipse.gef.EditPartFactory in project webtools.sourceediting by eclipse.
the class InternalXSDMultiPageEditor method editorModeChanged.
public void editorModeChanged(EditorMode newEditorMode) {
// if (isInitializing)
// return;
EditPartFactory editPartFactory = newEditorMode.getEditPartFactory();
if (editPartFactory != null) {
graphicalViewer.setEditPartFactory(editPartFactory);
if (graphicalViewer instanceof DesignViewGraphicalViewer) {
DesignViewGraphicalViewer viewer = (DesignViewGraphicalViewer) graphicalViewer;
IADTObject input = viewer.getInput();
viewer.setInput(null);
// viewer.getRootEditPart().refresh();
// viewer.getRootEditPart().getContents().refresh();
viewer.setInput(input);
floatingToolbar.setEditPartFactory(editPartFactory);
floatingToolbar.setModel(getModel());
floatingToolbar.refresh(!(input instanceof IModel));
Control control = graphicalViewer.getControl();
if (control instanceof Composite) {
Composite parent = ((Composite) control).getParent();
parent.layout();
}
}
}
IContentProvider provider = newEditorMode.getOutlineProvider();
if (provider != null) {
ADTContentOutlinePage outline = (ADTContentOutlinePage) getContentOutlinePage();
if (outline != null) {
TreeViewer treeViewer = outline.getTreeViewer();
if (treeViewer != null) {
outline.getTreeViewer().setContentProvider(provider);
outline.getTreeViewer().refresh();
}
}
}
}
use of org.eclipse.gef.EditPartFactory in project webtools.sourceediting by eclipse.
the class ADTMultiPageEditor method createGraphPageComposite.
protected Composite createGraphPageComposite() {
Composite parent = new Composite(getContainer(), SWT.FLAT);
parent.setBackground(ColorConstants.white);
parent.setLayout(new InternalLayout());
floatingToolbar = new ADTFloatingToolbar(getModel());
floatingToolbar.createControl(parent);
floatingToolbar.getControl().setVisible(true);
EditPartFactory editPartFactory = getEditorModeManager().getCurrentMode().getEditPartFactory();
floatingToolbar.setEditPartFactory(editPartFactory);
createViewModeToolbar(parent);
return parent;
}
use of org.eclipse.gef.EditPartFactory in project webtools.sourceediting by eclipse.
the class ConnectableEditPart method getExtendedFigureFactory.
public IExtendedFigureFactory getExtendedFigureFactory() {
EditPartFactory factory = getViewer().getEditPartFactory();
// $NON-NLS-1$
Assert.isTrue(factory instanceof IExtendedFigureFactory, "EditPartFactory must be an instanceof of IExtendedFigureFactory");
return (IExtendedFigureFactory) factory;
}
use of org.eclipse.gef.EditPartFactory in project webtools.sourceediting by eclipse.
the class XSDGraphViewerDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
viewer = new ScrollingGraphicalViewer();
Composite c = (Composite) super.createDialogArea(parent);
if (isHighContrast) {
c.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
} else {
c.setBackground(ColorConstants.white);
}
c.setLayout(new FillLayout());
RootEditPart root = new RootEditPart();
viewer.setRootEditPart(root);
viewer.createControl(c);
// The graphical viewer tool tip processing creates an extra shell which
// interferes with the PopupDialog's deactivation logic.
removeMouseListeners(viewer.getControl());
if (isHighContrast) {
viewer.getControl().setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
} else {
viewer.getControl().setBackground(ColorConstants.white);
}
EditPartFactory editPartFactory = new XSDEditPartFactory(new TypeVizFigureFactory());
viewer.setEditPartFactory(editPartFactory);
RootContentEditPart rootContentEditPart = new RootContentEditPart();
rootContentEditPart.setModel(model);
viewer.setContents(rootContentEditPart);
getShell().addControlListener(moveListener);
return c;
}
Aggregations