Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/action/ShowPropertyViewAction.java')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/action/ShowPropertyViewAction.java120
1 files changed, 0 insertions, 120 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/action/ShowPropertyViewAction.java b/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/action/ShowPropertyViewAction.java
deleted file mode 100644
index 24fe9daaf..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.facesconfig.ui/src/org/eclipse/jst/jsf/facesconfig/ui/pageflow/action/ShowPropertyViewAction.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2005 Sybase, Inc. 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:
- * Sybase, Inc. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jst.jsf.facesconfig.ui.pageflow.action;
-
-import java.util.List;
-
-import org.eclipse.gef.EditPart;
-import org.eclipse.gef.ui.actions.SelectionAction;
-import org.eclipse.jst.jsf.common.ui.internal.logging.Logger;
-import org.eclipse.jst.jsf.facesconfig.ui.EditorPlugin;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.PageflowMessages;
-import org.eclipse.jst.jsf.facesconfig.ui.pageflow.model.PageflowElement;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-
-/**
- *
- * This is the Action for opening a JSP page in the default JSP Editor from a
- * Pageflow Diagram
- *
- * @author Xiao-guang Zhang
- */
-public class ShowPropertyViewAction extends SelectionAction {
- /** log instance */
- private static final Logger log = EditorPlugin
- .getLogger(ShowPropertyViewAction.class);
-
- /** The ID of the action */
- public static final String SHOW_PROPERTY_VIEW = "org.eclipse.jst.jsf.facesconfig.ui.pageflow.action.ShowPropertyViewAction"; //$NON-NLS-1$
-
- /**
- * The constructor
- *
- * @param part -
- * the IWorkbenchPart
- */
- public ShowPropertyViewAction(IWorkbenchPart part) {
- super(part);
- // Pageflow.Action.ShowPropertyView.Label = Properties
- setText(PageflowMessages.Pageflow_Action_ShowPropertyView_Label);
- setId(SHOW_PROPERTY_VIEW);
- // Pageflow.Action.ShowPropertyView.ToolTip = Show properties
- setToolTipText(PageflowMessages.Pageflow_Action_ShowPropertyView_ToolTip);
- }
-
- /**
- * Determines if the action can be enabled
- *
- * @return boolean - the enabled state
- */
- protected boolean calculateEnabled() {
- return canPerformAction();
- }
-
- /**
- * Determines if the action can be performed
- *
- * @return boolean - the perform state
- */
- private boolean canPerformAction() {
- if (getSelectedObjects().isEmpty()) {
- return false;
- }
- List parts = getSelectedObjects();
- for (int i = 0; i < parts.size(); i++) {
- Object o = parts.get(i);
- if (!(o instanceof EditPart)) {
- return false;
- }
- EditPart part = (EditPart) o;
- if (!((part.getModel() instanceof PageflowElement))) {
- return false;
- }
- }
- return true;
- }
-
- /**
- * Runs the command
- */
- public void run() {
- List editparts = getSelectedObjects();
- if (editparts.size() > 0) {
- EditPart part = (EditPart) editparts.get(0);
- // execute(getCommand());
- if (part.getModel() instanceof PageflowElement) {
- // ensure the visibility of the palette view and property veiw.
- IWorkbenchWindow dw = PlatformUI.getWorkbench()
- .getActiveWorkbenchWindow();
- IWorkbenchPage page = dw.getActivePage();
- if (page != null) {
- try {
- page.showView("org.eclipse.ui.views.PropertySheet"); //$NON-NLS-1$
- } catch (PartInitException e) {
- // Pageflow.PageflowEditor.Error.canNotShowPropertyView
- // = Failed to show property sheet view.
- log
- .error(
- "Pageflow.PageflowEditor.Error.canNotShowPropertyView", //$NON-NLS-1$
- e);
- }
-
- }
- }
- }
- }
-}

Back to the top