blob: e3d232f072a4effa6b1a3713cdd55a914d32b39e [file] [log] [blame]
kchong38cbf172006-03-29 03:38:21 +00001/*******************************************************************************
2 * Copyright (c) 2001, 2006 IBM Corporation and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
7 *
8 * Contributors:
9 * IBM Corporation - initial API and implementation
10 *******************************************************************************/
kchong2be71b32006-04-11 16:32:03 +000011package org.eclipse.wst.xsd.ui.internal.adt.actions;
kchong38cbf172006-03-29 03:38:21 +000012
13import org.eclipse.jface.resource.ImageDescriptor;
14import org.eclipse.ui.IWorkbenchPart;
15import org.eclipse.ui.PartInitException;
kchong83beb0b2006-04-12 21:55:41 +000016import org.eclipse.wst.xsd.ui.internal.adt.editor.Messages;
kchong2be71b32006-04-11 16:32:03 +000017import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
kchong38cbf172006-03-29 03:38:21 +000018
19
20/**
21 * Show the properties view in the current perspective.
22 */
23public class ShowPropertiesViewAction extends BaseSelectionAction
24{
kchong2be71b32006-04-11 16:32:03 +000025 public static final String ID = "org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction"; //$NON-NLS-1$
kchong38cbf172006-03-29 03:38:21 +000026 public static final String PROPERTIES_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
27
28 protected static ImageDescriptor enabledImage, disabledImage;
29
30 public ShowPropertiesViewAction(IWorkbenchPart part)
31 {
32 super(part);
33 setId(ID);
kchong83beb0b2006-04-12 21:55:41 +000034 setText(Messages._UI_ACTION_SHOW_PROPERTIES);
kchong38cbf172006-03-29 03:38:21 +000035 setToolTipText(getText());
kchong83beb0b2006-04-12 21:55:41 +000036 setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/elcl16/showproperties_obj.gif") ); //$NON-NLS-1$
37 setDisabledImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/dlcl16/showproperties_obj.gif") ); //$NON-NLS-1$
kchong38cbf172006-03-29 03:38:21 +000038 }
39
40 protected boolean calculateEnabled()
41 {
42 return true;
43 }
44
45 public void run()
46 {
47 try
48 {
49 getWorkbenchPart().getSite().getPage().showView(PROPERTIES_VIEW_ID);
50 }
51 catch (PartInitException pie)
52 {
53
54 }
55 }
56}