Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.ui.actions
Class OpenWithMenu

java.lang.Object
  extended by 

org.eclipse.jface.action.ContributionItem
      extended by 
org.eclipse.ui.actions.OpenWithMenu
All Implemented Interfaces:
IContributionItem

public class OpenWithMenu
extends ContributionItem

A menu for opening files in the workbench.

An OpenWithMenu is used to populate a menu with "Open With" actions. One action is added for each editor which is applicable to the selected file. If the user selects one of these items, the corresponding editor is opened on the file.

This class may be instantiated; it is not intended to be subclassed.

Restriction:
This class is not intended to be subclassed by clients.

Field Summary
static  String ID
          The id of this action.
 
Constructor Summary
OpenWithMenu ( IWorkbenchPage page)
          Deprecated. As there is no way to set the file with this constructor use a different constructor.
OpenWithMenu ( IWorkbenchPage page, IAdaptable file)
          Constructs a new instance of OpenWithMenu.
 
Method Summary
 void fill ( Menu menu, int index)
          The default implementation of this IContributionItem method does nothing.
 boolean isDynamic ()
          The default implementation of this IContributionItem method returns false.
protected  void openEditor ( IEditorDescriptor editorDescriptor, boolean openUsingDescriptor)
          Opens the given editor on the selected file.
 
Methods inherited from class org.eclipse.jface.action. ContributionItem
dispose, fill, fill, fill, getId, getParent, isDirty, isEnabled, isGroupMarker, isSeparator, isVisible, saveWidgetState, setId, setParent, setVisible, toString, update, update
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID

public static final 
String ID
The id of this action.

See Also:
Constant Field Values
Constructor Detail

OpenWithMenu

public OpenWithMenu(
IWorkbenchPage page)
Deprecated. As there is no way to set the file with this constructor use a different constructor.

Constructs a new instance of OpenWithMenu.

Parameters:
page - the page where the editor is opened if an item within the menu is selected

OpenWithMenu

public OpenWithMenu(
IWorkbenchPage page,
                    
IAdaptable file)
Constructs a new instance of OpenWithMenu.

Parameters:
page - the page where the editor is opened if an item within the menu is selected
file - the selected file
Method Detail

fill

public void fill(
Menu menu,
                 int index)
Description copied from class: ContributionItem
The default implementation of this IContributionItem method does nothing. Subclasses may override.

Specified by:
fill in interface IContributionItem
Overrides:
fill in class ContributionItem
Parameters:
menu - the parent menu
index - the index where the controls are inserted, or -1 to insert at the end

isDynamic

public boolean isDynamic()
Description copied from class: ContributionItem
The default implementation of this IContributionItem method returns false. Subclasses may override.

Specified by:
isDynamic in interface IContributionItem
Overrides:
isDynamic in class ContributionItem
Returns:
true if this item is dynamic, and false for normal items

openEditor

protected void openEditor(
IEditorDescriptor editorDescriptor,
                          boolean openUsingDescriptor)
Opens the given editor on the selected file.

Parameters:
editorDescriptor - the editor descriptor, or null for the system editor
openUsingDescriptor - use the descriptor's editor ID for opening if false (normal case), or use the descriptor itself if true (needed to fix bug 178235).
Since:
3.5

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire