Remote Systems
v6.4.1

com.ibm.etools.systems.files.ui.actions
Class SystemRemoteFileOpenWithMenu

java.lang.Object
  extended byContributionItem
      extended bycom.ibm.etools.systems.files.ui.actions.SystemRemoteFileOpenWithMenu
Direct Known Subclasses:
SystemRemoteFileLineOpenWithMenu

public class SystemRemoteFileOpenWithMenu
extends ContributionItem

Open with menu class for remote files

See Also:
Serialized Form

Field Summary
protected  IRemoteFile _remoteFile
           
static String ID
          The id of this action.
protected  IWorkbenchPage page
           
protected  IEditorRegistry registry
           
 
Constructor Summary
SystemRemoteFileOpenWithMenu()
          Constructs a new instance of SystemOpenWithMenu.
 
Method Summary
protected  void createDefaultMenuItem(Menu menu, IRemoteFile file)
          Creates the menu item for clearing the current selection.
protected  void createMenuItem(Menu menu, IEditorDescriptor descriptor, IEditorDescriptor preferredEditor)
          Creates the menu item for the editor descriptor.
 void fill(Menu menu, int index)
           
protected  IEditorDescriptor getDefaultEditor(IRemoteFile remoteFile)
           
protected  Image getImage(IEditorDescriptor editorDesc)
          Returns an image to show for the corresponding editor descriptor.
protected  IEditorDescriptor getPreferredEditor(IRemoteFile remoteFile)
          Returns the preferred editor for the remote file.
 boolean isDynamic()
           
protected  void openEditor(IRemoteFile file, IEditorDescriptor descriptor)
           
protected  void setDefaultEditor(IRemoteFile remoteFile, String editorId)
           
 void updateSelection(IStructuredSelection selection)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

page

protected IWorkbenchPage page

_remoteFile

protected IRemoteFile _remoteFile

registry

protected IEditorRegistry registry

ID

public static final String ID
The id of this action.

Constructor Detail

SystemRemoteFileOpenWithMenu

public SystemRemoteFileOpenWithMenu()
Constructs a new instance of SystemOpenWithMenu.

Method Detail

updateSelection

public void updateSelection(IStructuredSelection selection)

getImage

protected Image getImage(IEditorDescriptor editorDesc)
Returns an image to show for the corresponding editor descriptor.

Parameters:
editorDesc - the editor descriptor, or null for the system editor
Returns:
the image or null

createMenuItem

protected void createMenuItem(Menu menu,
                              IEditorDescriptor descriptor,
                              IEditorDescriptor preferredEditor)
Creates the menu item for the editor descriptor.

Parameters:
menu - the menu to add the item to
descriptor - the editor descriptor, or null for the system editor
preferredEditor - the descriptor of the preferred editor, or null

openEditor

protected void openEditor(IRemoteFile file,
                          IEditorDescriptor descriptor)

getPreferredEditor

protected IEditorDescriptor getPreferredEditor(IRemoteFile remoteFile)
Returns the preferred editor for the remote file. If the remote file has a cached local resource, then returns the default editor associated with that resource, by calling IDE.getDefaultEditor(IFile). Otherwise, get the default editor associated with that remote file name from the editor registry.

Parameters:
remoteFile - the remote file.
Returns:
the preferred editor for the remote file, or null if none.

getDefaultEditor

protected IEditorDescriptor getDefaultEditor(IRemoteFile remoteFile)

setDefaultEditor

protected void setDefaultEditor(IRemoteFile remoteFile,
                                String editorId)

fill

public void fill(Menu menu,
                 int index)

isDynamic

public boolean isDynamic()

createDefaultMenuItem

protected void createDefaultMenuItem(Menu menu,
                                     IRemoteFile file)
Creates the menu item for clearing the current selection.

Parameters:
menu - the menu to add the item to
file - the file bing edited

Remote Systems
v6.4.1

Copyright © 2005 IBM Corp. All Rights Reserved.

Note: This documentation is for part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.