blob: d8db09cead92e3287c7047b1a044f3502596ab5d [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 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.debug.internal.ui.views.memory;
import org.eclipse.debug.internal.ui.DebugPluginImages;
import org.eclipse.debug.internal.ui.DebugUIMessages;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.PlatformUI;
class ViewPaneOrientationAction extends Action
{
private MemoryView fView;
private int fOrientation;
ViewPaneOrientationAction(MemoryView view, int orientation)
{
super("", AS_RADIO_BUTTON); //$NON-NLS-1$
fView = view;
fOrientation = orientation;
if (orientation == MemoryView.HORIZONTAL_VIEW_ORIENTATION) {
setText(DebugUIMessages.ViewPaneOrientationAction_0);
setToolTipText(DebugUIMessages.ViewPaneOrientationAction_1);
setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_UNDER));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_UNDER));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_UNDER));
} else if (orientation == MemoryView.VERTICAL_VIEW_ORIENTATION) {
setText(DebugUIMessages.ViewPaneOrientationAction_2);
setToolTipText(DebugUIMessages.ViewPaneOrientationAction_3);
setImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_ELCL_DETAIL_PANE_RIGHT));
setDisabledImageDescriptor(DebugPluginImages.getImageDescriptor(IInternalDebugUIConstants.IMG_DLCL_DETAIL_PANE_RIGHT));
setHoverImageDescriptor(DebugPluginImages.getImageDescriptor(IDebugUIConstants.IMG_LCL_DETAIL_PANE_RIGHT));
}
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.MEMORY_VIEW_PANE_ORIENTATION_ACTION);
}
public void run() {
fView.setViewPanesOrientation(fOrientation);
}
public int getOrientation()
{
return fOrientation;
}
}