diff options
Diffstat (limited to 'bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java')
-rw-r--r-- | bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java b/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java deleted file mode 100644 index 60b4e69618..0000000000 --- a/bundles/org.eclipse.wst.xsd.ui/src-adt/org/eclipse/wst/xsd/ui/internal/adt/actions/SetInputToGraphView.java +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2001, 2006 IBM Corporation and others. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * IBM Corporation - initial API and implementation - *******************************************************************************/ -package org.eclipse.wst.xsd.ui.internal.adt.actions; - -import org.eclipse.gef.EditPart; -import org.eclipse.gef.GraphicalViewer; -import org.eclipse.jface.viewers.IStructuredSelection; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.wst.xsd.ui.internal.adt.design.DesignViewGraphicalViewer; -import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.RootContentEditPart; -import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages; -import org.eclipse.wst.xsd.ui.internal.adt.facade.IADTObject; - -public class SetInputToGraphView extends BaseSelectionAction -{ - public static String ID = "SetAsFocus"; //$NON-NLS-1$ - IEditorPart editorPart; - Object input; - - public SetInputToGraphView(IWorkbenchPart part) - { - this(part, null); - } - - public SetInputToGraphView(IWorkbenchPart part, Object input) - { - super(part); - this.input = input; - setId(ID); - setText(Messages._UI_ACTION_SET_AS_FOCUS); - if (part instanceof IEditorPart) - { - editorPart = (IEditorPart)part; - } - } - - protected boolean calculateEnabled() - { - return true; - } - - public void run() - { - Object selection = input; - if (selection == null) - { - selection = ((IStructuredSelection) getSelection()).getFirstElement(); - } - Object adapter = getWorkbenchPart().getAdapter(GraphicalViewer.class); - - if (selection instanceof IADTObject) - { - IADTObject obj = (IADTObject) selection; - if (adapter instanceof DesignViewGraphicalViewer) - { - DesignViewGraphicalViewer graphicalViewer = (DesignViewGraphicalViewer) adapter; - EditPart editPart = graphicalViewer.getInputEditPart(); - if (editPart instanceof RootContentEditPart) - { - if (editorPart != null) - { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart); - } - graphicalViewer.setInput(obj); - //((RootContentEditPart) editPart).refresh(); - if (editorPart != null) - { - PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getNavigationHistory().markLocation(editorPart); - } - } - } - } - } -} |