/******************************************************************************* * Copyright (c) 2000, 2005 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.rubypeople.rdt.internal.ui.infoviews; import org.eclipse.jface.action.Action; import org.eclipse.jface.util.Assert; import org.eclipse.ui.PlatformUI; import org.rubypeople.rdt.core.IRubyElement; import org.rubypeople.rdt.internal.ui.IRubyHelpContextIds; import org.rubypeople.rdt.internal.ui.RubyPluginImages; import org.rubypeople.rdt.ui.actions.OpenAction; class GotoInputAction extends Action { private AbstractInfoView fInfoView; public GotoInputAction(AbstractInfoView infoView) { Assert.isNotNull(infoView); fInfoView= infoView; RubyPluginImages.setLocalImageDescriptors(this, "goto_input.gif"); //$NON-NLS-1$ setText(InfoViewMessages.GotoInputAction_label); setToolTipText(InfoViewMessages.GotoInputAction_tooltip); setDescription(InfoViewMessages.GotoInputAction_description); PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IRubyHelpContextIds.OPEN_INPUT_ACTION); } public void run() { IRubyElement inputElement= fInfoView.getInput(); new OpenAction(fInfoView.getViewSite()).run(new Object[] { inputElement }); } }