Search in sources :

Example 1 with SetInputToGraphView

use of org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView in project webtools.sourceediting by eclipse.

the class BackToSchemaEditPart method createFigure.

protected IFigure createFigure() {
    backToSchema = new CenteredIconFigure();
    backToSchema.setBackgroundColor(ColorConstants.white);
    backToSchema.image = XSDEditorPlugin.getPlugin().getIcon("elcl16/schemaview_co.gif");
    // TODO, look at why the editpolicy doesn't work
    mouseListener = new MouseListener() {

        public void mouseDoubleClicked(org.eclipse.draw2d.MouseEvent me) {
        }

        public void mousePressed(org.eclipse.draw2d.MouseEvent me) {
            if (isEnabled) {
                addFeedback();
            }
        }

        public void mouseReleased(org.eclipse.draw2d.MouseEvent me) {
            if (isEnabled) {
                removeFeedback();
                SetInputToGraphView action = new SetInputToGraphView(multipageEditor, getModel());
                action.run();
            }
        }
    };
    backToSchema.addMouseListener(mouseListener);
    return backToSchema;
}
Also used : MouseListener(org.eclipse.draw2d.MouseListener) CenteredIconFigure(org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure) SetInputToGraphView(org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView)

Example 2 with SetInputToGraphView

use of org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView in project webtools.sourceediting by eclipse.

the class BackToSchemaEditPart method performRequest.

public void performRequest(Request request) {
    if (request.getType() == RequestConstants.REQ_DIRECT_EDIT || request.getType() == RequestConstants.REQ_OPEN) {
        SetInputToGraphView action = new SetInputToGraphView(multipageEditor, getModel());
        action.run();
    }
}
Also used : SetInputToGraphView(org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView)

Example 3 with SetInputToGraphView

use of org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView in project webtools.sourceediting by eclipse.

the class ADTFloatingToolbarEditPart method doAction.

protected void doAction(org.eclipse.draw2d.KeyEvent ke) {
    IEditorPart editorPart = getActionEditorPart();
    SetInputToGraphView action = new SetInputToGraphView(editorPart, model);
    action.run();
}
Also used : IEditorPart(org.eclipse.ui.IEditorPart) SetInputToGraphView(org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView)

Example 4 with SetInputToGraphView

use of org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView in project webtools.sourceediting by eclipse.

the class ADTMultiPageEditor method createActions.

protected void createActions() {
    ActionRegistry registry = getActionRegistry();
    BaseSelectionAction action = new SetInputToGraphView(this);
    action.setSelectionProvider(getSelectionManager());
    registry.registerAction(action);
}
Also used : ActionRegistry(org.eclipse.gef.ui.actions.ActionRegistry) SetInputToGraphView(org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView) BaseSelectionAction(org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction)

Example 5 with SetInputToGraphView

use of org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView in project webtools.sourceediting by eclipse.

the class ADTFloatingToolbarEditPart method doAction.

protected void doAction(MouseEvent me) {
    IEditorPart editorPart = getActionEditorPart();
    if (backToSchema.getBounds().contains(me.getLocation())) {
        SetInputToGraphView action = new SetInputToGraphView(editorPart, model);
        action.run();
    }
}
Also used : IEditorPart(org.eclipse.ui.IEditorPart) SetInputToGraphView(org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView)

Aggregations

SetInputToGraphView (org.eclipse.wst.xsd.ui.internal.adt.actions.SetInputToGraphView)5 IEditorPart (org.eclipse.ui.IEditorPart)2 MouseListener (org.eclipse.draw2d.MouseListener)1 ActionRegistry (org.eclipse.gef.ui.actions.ActionRegistry)1 BaseSelectionAction (org.eclipse.wst.xsd.ui.internal.adt.actions.BaseSelectionAction)1 CenteredIconFigure (org.eclipse.wst.xsd.ui.internal.design.figures.CenteredIconFigure)1