blob: 9f02e439a6283bfce6c8d1bdc87b203b47d86e37 [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;
kchong2be71b32006-04-11 16:32:03 +000016import org.eclipse.wst.xsd.ui.internal.editor.XSDEditorPlugin;
kchong38cbf172006-03-29 03:38:21 +000017
18
19/**
20 * Show the properties view in the current perspective.
21 */
22public class ShowPropertiesViewAction extends BaseSelectionAction
23{
kchong2be71b32006-04-11 16:32:03 +000024 public static final String ID = "org.eclipse.wst.xsd.ui.internal.adt.actions.ShowPropertiesViewAction"; //$NON-NLS-1$
kchong38cbf172006-03-29 03:38:21 +000025 public static final String PROPERTIES_VIEW_ID = "org.eclipse.ui.views.PropertySheet"; //$NON-NLS-1$
26
27 protected static ImageDescriptor enabledImage, disabledImage;
28
29 public ShowPropertiesViewAction(IWorkbenchPart part)
30 {
31 super(part);
32 setId(ID);
33 setText("Show properties");
34 setToolTipText(getText());
35 setImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/elcl16/showproperties_obj.gif") );
36 setDisabledImageDescriptor(XSDEditorPlugin.getImageDescriptor("icons/dlcl16/showproperties_obj.gif") );
37 }
38
39 protected boolean calculateEnabled()
40 {
41 return true;
42 }
43
44 public void run()
45 {
46 try
47 {
48 getWorkbenchPart().getSite().getPage().showView(PROPERTIES_VIEW_ID);
49 }
50 catch (PartInitException pie)
51 {
52
53 }
54 }
55}