Search in sources :

Example 1 with XSDEditPartFactory

use of org.eclipse.wst.xsd.ui.internal.design.editparts.XSDEditPartFactory 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;
}
Also used : ScrollingGraphicalViewer(org.eclipse.gef.ui.parts.ScrollingGraphicalViewer) Composite(org.eclipse.swt.widgets.Composite) XSDEditPartFactory(org.eclipse.wst.xsd.ui.internal.design.editparts.XSDEditPartFactory) EditPartFactory(org.eclipse.gef.EditPartFactory) FillLayout(org.eclipse.swt.layout.FillLayout) RootContentEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart) TypeVizFigureFactory(org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.TypeVizFigureFactory) RootEditPart(org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootEditPart) XSDEditPartFactory(org.eclipse.wst.xsd.ui.internal.design.editparts.XSDEditPartFactory)

Aggregations

EditPartFactory (org.eclipse.gef.EditPartFactory)1 ScrollingGraphicalViewer (org.eclipse.gef.ui.parts.ScrollingGraphicalViewer)1 FillLayout (org.eclipse.swt.layout.FillLayout)1 Composite (org.eclipse.swt.widgets.Composite)1 RootContentEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart)1 RootEditPart (org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootEditPart)1 TypeVizFigureFactory (org.eclipse.wst.xsd.ui.internal.adt.typeviz.design.figures.TypeVizFigureFactory)1 XSDEditPartFactory (org.eclipse.wst.xsd.ui.internal.design.editparts.XSDEditPartFactory)1