1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-08-05 07:15:39 +02:00

[224377] "open with" menu does not have "other" option

This commit is contained in:
David McKnight 2008-03-28 17:26:22 +00:00
parent 669b79655c
commit 6201d0e1ad
18 changed files with 160 additions and 144 deletions

View file

@ -28,6 +28,7 @@
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* David McKnight (IBM) - [222406] Need to be able to override local encoding
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.files.ui.resources;
@ -98,6 +99,7 @@ import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.actions.WorkspaceModifyOperation;
import org.eclipse.ui.ide.IDE;
import org.eclipse.ui.internal.WorkbenchPage;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.texteditor.IDocumentProvider;
import org.eclipse.ui.texteditor.ITextEditor;
@ -200,7 +202,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
}
}
private String _editorId = null;
private IEditorDescriptor _editorDescriptor = null;
private boolean _isRemoteFileMounted = false;
private String _actualRemoteHost = null;
private String _actualRemotePath = null;
@ -208,7 +210,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
/**
* Constructor for SystemEditableRemoteFile
*/
public SystemEditableRemoteFile(IWorkbenchPage page, IRemoteFile remoteFile, String editorId)
public SystemEditableRemoteFile(IWorkbenchPage page, IRemoteFile remoteFile, IEditorDescriptor editorDescriptor)
{
super();
this.page = page;
@ -223,15 +225,15 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
this.root = mgr.getRemoteEditProjectLocation().makeAbsolute().toOSString();
this.localPath = getDownloadPath();
this._editorId = editorId;
this._editorDescriptor = editorDescriptor;
}
/**
* Constructor for SystemEditableRemoteFile
*/
public SystemEditableRemoteFile(IRemoteFile remoteFile, String editorId)
public SystemEditableRemoteFile(IRemoteFile remoteFile, IEditorDescriptor editorDescriptor)
{
this(null, remoteFile, editorId);
this(null, remoteFile, editorDescriptor);
}
/**
@ -256,8 +258,7 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
{
descriptor = getDefaultTextEditor();
}
String id = descriptor.getId();
this._editorId = id;
this._editorDescriptor = descriptor;
}
protected IEditorRegistry getEditorRegistry()
@ -1596,7 +1597,12 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
}
// set editor as preferred editor for this file
IDE.setDefaultEditor(file, _editorId);
String editorId = null;
if (_editorDescriptor != null)
_editorDescriptor.getId();
IDE.setDefaultEditor(file, editorId);
FileEditorInput finput = new FileEditorInput(file);
@ -1605,7 +1611,13 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
// DKM - when _editorId is not lpex, this causes problem
// DY - changed editor from SystemTextEditor to IEditorPart
//editor = (SystemTextEditor)activePage.openEditor(file, _editorId);
editor = activePage.openEditor(finput, _editorId);
if (_editorDescriptor != null && _editorDescriptor.isOpenExternal()){
editor = ((WorkbenchPage)activePage).openEditorFromDescriptor(new FileEditorInput(file), _editorDescriptor, true, null);
}
else {
editor = activePage.openEditor(finput, _editorDescriptor.getId());
}
SystemIFileProperties properties = new SystemIFileProperties(file);
properties.setRemoteFileObject(this);
@ -1624,7 +1636,10 @@ public class SystemEditableRemoteFile implements ISystemEditableRemoteObject, IP
IFile file = getLocalResource();
// set editor as preferred editor for this file
IDE.setDefaultEditor(file, _editorId);
String editorId = null;
if (_editorDescriptor != null)
editorId = _editorDescriptor.getId();
IDE.setDefaultEditor(file, editorId);
FileEditorInput fileInput = new FileEditorInput(file);
activePage.openEditor(fileInput, IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);

View file

@ -19,6 +19,7 @@
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* David McKnight (IBM) - [223103] [cleanup] fix broken externalized strings
* David McKnight (IBM) - [223204] [cleanup] fix broken nls strings in files.ui and others
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui;
@ -403,6 +404,9 @@ public class FileResources extends NLS
public static String EditorManager_saveResourcesTitle;
public static String OpenWithMenu_Other;
public static String OpenWithMenu_OtherDialogDescription;
static
{
// load message values from bundle file

View file

@ -19,6 +19,7 @@
# David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
# David McKnight (IBM) - [223103] [cleanup] fix broken externalized strings
# David McKnight (IBM) - [223204] [cleanup] fix broken nls strings in files.ui and others
# David McKnight (IBM) - [224377] "open with" menu does not have "other" option
###############################################################################
# NLS_MESSAGEFORMAT_VAR
@ -392,3 +393,7 @@ MSG_ERROR_FILENAME_INVALID = File type extension must not contain '*' or '.'
EditorManager_saveResourcesTitle = Save Resources
OpenWithMenu_Other=Other...
OpenWithMenu_OtherDialogDescription=Choose the editor for opening {0}:

View file

@ -12,6 +12,7 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -21,6 +22,7 @@ import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
/**
@ -35,17 +37,17 @@ public class SystemBrowseFileAction extends SystemEditFileAction {
* @param tooltip
* @param image
* @param parent
* @param editorId
* @param editorDescriptor
*/
public SystemBrowseFileAction(String text, String tooltip, ImageDescriptor image, Shell parent, String editorId) {
super(text, tooltip, image, parent, editorId);
public SystemBrowseFileAction(String text, String tooltip, ImageDescriptor image, Shell parent, IEditorDescriptor editorDescriptor) {
super(text, tooltip, image, parent, editorDescriptor);
}
/**
* @see org.eclipse.rse.internal.files.ui.actions.SystemEditFileAction#process(IRemoteFile)
*/
protected void process(IRemoteFile remoteFile) {
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorId);
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorDescriptor);
editableFile.open(SystemBasePlugin.getActiveWorkbenchShell(), true);
}

View file

@ -12,6 +12,7 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -21,6 +22,7 @@ import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
/**
* Open a remote file as read-only
@ -36,16 +38,16 @@ public class SystemBrowseFileLineAction extends SystemEditFileLineAction {
* @param editorId
* @param line
*/
public SystemBrowseFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, String editorId,
public SystemBrowseFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, IEditorDescriptor editorDescriptor,
IRemoteFile remoteFile, int line, int charStart, int charEnd) {
super(text, tooltip, image, parent, editorId, remoteFile, line, charStart, charEnd);
super(text, tooltip, image, parent, editorDescriptor, remoteFile, line, charStart, charEnd);
}
/**
* @see org.eclipse.rse.internal.files.ui.actions.SystemEditFileAction#process(IRemoteFile)
*/
protected void process(IRemoteFile remoteFile) {
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorId);
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorDescriptor);
editableFile.open(SystemBasePlugin.getActiveWorkbenchShell(), true);
handleGotoLine();
}

View file

@ -21,6 +21,8 @@
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* Rupen Mardirossian (IBM) - [210682] created checkForCollision method that returns a boolean for SystemCopyDialog enhancement
* David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -50,7 +52,6 @@ import org.eclipse.rse.internal.files.ui.FileResources;
import org.eclipse.rse.internal.files.ui.ISystemFileConstants;
import org.eclipse.rse.internal.files.ui.resources.SystemRemoteEditManager;
import org.eclipse.rse.internal.ui.SystemResources;
import org.eclipse.rse.internal.ui.view.SystemView;
import org.eclipse.rse.services.clientserver.SystemEncodingUtil;
import org.eclipse.rse.services.clientserver.messages.SimpleSystemMessage;
import org.eclipse.rse.services.clientserver.messages.SystemMessage;
@ -391,6 +392,18 @@ implements IValidatorRemoteSelection
}
/**
* @see SystemBaseCopyAction#getOldAbsoluteNames()
*/
protected String[] getOldAbsoluteNames()
{
IRemoteFile[] files = getSelectedFiles();
String[] names = new String[files.length];
for (int idx=0; idx<files.length; idx++)
names[idx] = files[idx].getAbsolutePath();
return names;
}
/**
* Override of parent.
* Return the dialog that will be used to prompt for the copy/move target location.
@ -524,7 +537,7 @@ implements IValidatorRemoteSelection
* Called after all the copy/move operations end, be it successfully or not.
* Your opportunity to display completion or do post-copy selections/refreshes
*/
public void copyComplete()
public void copyComplete(String operation)
{
if (copiedFiles.size() == 0)
return;
@ -532,74 +545,20 @@ implements IValidatorRemoteSelection
// refresh all instances of this parent, and all affected filters...
ISubSystem fileSS = targetFolder.getParentRemoteFileSubSystem();
Viewer originatingViewer = getViewer();
if (originatingViewer != null)
{
if (!targetFolder.getAbsolutePath().equals(firstSelectionParent.getAbsolutePath()))
{
// we select the first instance of the target folder now so that the copied members will be selected in it
// after it is refreshed via the remote_resource_created event.
if (originatingViewer instanceof SystemView)
{
// boolean selectedOk = ((SystemView)originatingViewer).selectRemoteObjects(targetFolder.getAbsolutePath(), fileSS, null);
//System.out.println(targetFolder.getAbsolutePath()+" selectedOK? " + selectedOk);
//if (selectedOk)
// return;
}
}
}
targetFolder.markStale(true);
// invalidate filters
invalidateFilterReferences(targetFolder);
if (operation == null){
operation = ISystemRemoteChangeEvents.SYSTEM_REMOTE_OPERATION_COPY;
}
RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED, copiedFiles, targetFolder.getAbsolutePath(), fileSS, null, originatingViewer);
/* Old release 1.0 way...
// did they copy to the same parent? Just refresh that parent, whatever it is...
if (targetFolder.getAbsolutePath().equals(firstSelectionParent.getAbsolutePath()))
{
Viewer v = getViewer();
if (v instanceof ISystemTree)
{
SystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISystemTree tree = (ISystemTree)v;
Object parent = tree.getSelectedParent();
if (parent == null)
return;
if (parent instanceof IRemoteFile)
// refresh parent in all views...
sr.fireEvent(
new org.eclipse.rse.ui.model.SystemResourceChangeEvent(
parent,ISystemResourceChangeEvent.EVENT_REFRESH_REMOTE, null)
);
else
// refresh parent in all views...
sr.fireEvent(
new org.eclipse.rse.ui.model.SystemResourceChangeEvent(
parent,ISystemResourceChangeEvent.EVENT_REFRESH, null)
);
// select new files in this view only
sr.fireEvent((ISystemResourceChangeListener)v,
new org.eclipse.rse.ui.model.SystemResourceChangeEvent(
copiedFiles,ISystemResourceChangeEvent.EVENT_SELECT_REMOTE, targetFolder)
);
}
}
// they copied somewhere else... a little more work...
else
{
// refresh target folder in all views, but only select new files in this view...
org.eclipse.rse.ui.model.SystemResourceChangeEvent event =
new org.eclipse.rse.ui.model.SystemResourceChangeEvent(
targetFolder,ISystemResourceChangeEvent.EVENT_REFRESH_REMOTE, copiedFiles);
event.setOriginatingViewer(getViewer());
sr.fireEvent(event);
}
*/
RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(operation,
ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED, copiedFiles, targetFolder.getAbsolutePath(), fileSS, getOldAbsoluteNames(), originatingViewer);
}
// ------------------

View file

@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -204,7 +204,7 @@ public class SystemCreateEditActions
ImageDescriptor image = getImageDescriptor(remoteFile, descriptor);
// create action
SystemEditFileAction action = new SystemEditFileAction(label, label, image, IAction.AS_RADIO_BUTTON, shell, editorId);
SystemEditFileAction action = new SystemEditFileAction(label, label, image, IAction.AS_RADIO_BUTTON, shell, descriptor);
// check if editor is the preferred editor
boolean isPreferred = preferredEditor != null && editorId.equals(preferredEditor.getId());

View file

@ -12,7 +12,7 @@
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
*
* Contributors:
* {Name} (company) - description of contribution.
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -90,8 +90,7 @@ public class SystemDoubleClickEditAction extends SystemBaseAction
descriptor = registry.findEditor(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
}
String id = descriptor.getId();
SystemEditFileAction editAction = new SystemEditFileAction(null, null, null, null, id);
SystemEditFileAction editAction = new SystemEditFileAction(null, null, null, null, descriptor);
editAction.setSelection(new StructuredSelection(element));
editAction.run();
}

View file

@ -14,6 +14,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [189873] DownloadJob changed to DownloadAndOpenJob
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -30,30 +31,31 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFileSubSystem;
import org.eclipse.rse.ui.actions.SystemBaseAction;
import org.eclipse.rse.ui.view.ISystemEditableRemoteObject;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
public class SystemEditFileAction extends SystemBaseAction {
protected String _editorId;
protected IEditorDescriptor _editorDescriptor;
/**
* Constructor for SystemEditFileAction
*/
public SystemEditFileAction(String text, String tooltip, ImageDescriptor image, Shell parent, String editorId) {
public SystemEditFileAction(String text, String tooltip, ImageDescriptor image, Shell parent, IEditorDescriptor editorDescriptor) {
super(text, tooltip, null, image, parent);
init();
_editorId = editorId;
_editorDescriptor = editorDescriptor;
}
/**
* Constructor for SystemEditFileAction
*/
public SystemEditFileAction(String text, String tooltip, ImageDescriptor image, int style, Shell parent, String editorId) {
public SystemEditFileAction(String text, String tooltip, ImageDescriptor image, int style, Shell parent, IEditorDescriptor editorDescriptor) {
super(text, tooltip, null, image, style, parent);
init();
_editorId = editorId;
_editorDescriptor = editorDescriptor;
}
/**
@ -146,7 +148,7 @@ public class SystemEditFileAction extends SystemBaseAction {
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorId);
editableFile.open(SystemBasePlugin.getActiveWorkbenchShell());
*/
SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile, _editorId);
SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile, _editorDescriptor);
{
try
{

View file

@ -13,6 +13,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -25,6 +26,7 @@ import org.eclipse.rse.subsystems.files.core.SystemIFileProperties;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
@ -46,8 +48,8 @@ public class SystemEditFileLineAction extends SystemEditFileAction {
/**
* Constructor for SystemEditFileAction.
*/
public SystemEditFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, String editorId, IRemoteFile remoteFile, int line, int charStart, int charEnd) {
super(text, tooltip, image, parent, editorId);
public SystemEditFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, IEditorDescriptor editorDescriptor, IRemoteFile remoteFile, int line, int charStart, int charEnd) {
super(text, tooltip, image, parent, editorDescriptor);
_line = line;
_remoteFile = remoteFile;
_charStart = charStart;

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [209660] check for changed encoding before using cached file
* David McKnight (IBM) - [189873] DownloadJob changed to DownloadAndOpenJob
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -173,7 +174,7 @@ public class SystemEditFilesAction extends SystemBaseAction {
editorId = "org.eclipse.ui.DefaultTextEditor"; //$NON-NLS-1$
}
SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile, editorId);
SystemEditableRemoteFile editable = new SystemEditableRemoteFile(remoteFile, des);
{
try
{

View file

@ -22,6 +22,8 @@
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* Rupen Mardirossian (IBM) - [210682] Modified MoveRemoteFileJob.runInWorkspace to use SystemCopyDialog for collisions in move operations
* David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -188,7 +190,7 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction
}
if (movedFiles.size() > 0)
{
copyComplete(); //Need to reflect the views.
copyComplete(ISystemRemoteChangeEvents.SYSTEM_REMOTE_OPERATION_MOVE); //Need to reflect the views.
}
return status;
@ -359,52 +361,23 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction
* Called after all the copy/move operations end, be it successfully or not.
* Your opportunity to display completion or do post-copy selections/refreshes
*/
public void copyComplete()
public void copyComplete(String operation)
{
// we want to do the super.copyComplete() to refresh the target, but first we must do refresh the
// source to reflect the deletion...
// refresh all instances of the source parent, and all affected filters...
ISubSystem fileSS = targetFolder.getParentRemoteFileSubSystem();
//RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
// ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, copiedFiles, firstSelectionParent.getAbsolutePath(), fileSS, null, null);
if (operation == null){
operation = ISystemRemoteChangeEvents.SYSTEM_REMOTE_OPERATION_MOVE;
}
Viewer originatingViewer = getViewer();
RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, movedFiles, firstSelectionParent.getAbsolutePath(), fileSS, null, originatingViewer);
RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(operation,
ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, movedFiles, firstSelectionParent.getAbsolutePath(), fileSS, getOldAbsoluteNames(), originatingViewer);
/* old release 1.0 way of doing it...
Viewer v = getViewer();
if (v instanceof ISystemTree)
{
SystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
ISystemTree tree = (ISystemTree)v;
Object parent = tree.getSelectedParent();
if (parent != null)
{
if (parent instanceof IRemoteFile)
{
//System.out.println("Firing REFRESH_REMOTE");
sr.fireEvent(
new org.eclipse.rse.ui.model.impl.SystemResourceChangeEvent(
parent,ISystemResourceChangeEvent.EVENT_REFRESH_REMOTE, null) );
}
else
{
//System.out.println("MOVE OPERATION: Firing REFRESH");
// FIRST REFRESH EXPANDED FILTER
sr.fireEvent(
new org.eclipse.rse.ui.model.impl.SystemResourceChangeEvent(
parent,ISystemResourceChangeEvent.EVENT_REFRESH, null) );
// NEXT REFRESH ALL OTHER PLACES THAT MIGHT BE SHOWING THE SOURCE FOLDER
sr.fireEvent(
new org.eclipse.rse.ui.model.impl.SystemResourceChangeEvent(
firstSelectionParent,ISystemResourceChangeEvent.EVENT_REFRESH_REMOTE, null) );
}
}
else
RSEUIPlugin.logWarning("Hmm, selected parent is null on a move operation!");
}*/
super.copyComplete();
super.copyComplete(operation);
}
}

View file

@ -13,6 +13,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -137,7 +138,7 @@ public class SystemRemoteFileLineOpenWithMenu extends SystemRemoteFileOpenWithMe
protected void openEditor(IRemoteFile file, IEditorDescriptor descriptor)
{
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(file, descriptor.getId());
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(file, descriptor);
editableFile.open(SystemBasePlugin.getActiveWorkbenchShell());
handleGotoLine();
}

View file

@ -15,6 +15,7 @@
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [189873] DownloadJob changed to DownloadAndOpenJob
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -30,6 +31,8 @@ import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.jface.action.ContributionItem;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.window.Window;
import org.eclipse.osgi.util.NLS;
import org.eclipse.rse.files.ui.resources.SystemEditableRemoteFile;
import org.eclipse.rse.files.ui.resources.UniversalFileTransferUtility;
import org.eclipse.rse.internal.files.ui.FileResources;
@ -51,6 +54,7 @@ import org.eclipse.ui.IEditorRegistry;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.EditorSelectionDialog;
import org.eclipse.ui.ide.IDE;
@ -181,6 +185,40 @@ protected void createMenuItem(Menu menu, final IEditorDescriptor descriptor, fin
menuItem.addListener(SWT.Selection, listener);
}
/**
* Creates the Other... menu item
*
* @param menu the menu to add the item to
*/
private void createOtherMenuItem(final Menu menu, final IRemoteFile remoteFile) {
new MenuItem(menu, SWT.SEPARATOR);
final MenuItem menuItem = new MenuItem(menu, SWT.PUSH);
menuItem.setText(FileResources.OpenWithMenu_Other);
Listener listener = new Listener() {
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Selection:
EditorSelectionDialog dialog = new EditorSelectionDialog(
menu.getShell());
dialog
.setMessage(NLS
.bind(
FileResources.OpenWithMenu_OtherDialogDescription,
remoteFile.getName()));
if (dialog.open() == Window.OK) {
IEditorDescriptor editor = dialog.getSelectedEditor();
if (editor != null) {
openEditor(remoteFile, editor);
}
}
break;
}
}
};
menuItem.addListener(SWT.Selection, listener);
}
protected void openEditor(IRemoteFile remoteFile, IEditorDescriptor descriptor) {
@ -192,7 +230,7 @@ protected void openEditor(IRemoteFile remoteFile, IEditorDescriptor descriptor)
}
else
{
editable = new SystemEditableRemoteFile(remoteFile, descriptor.getId());
editable = new SystemEditableRemoteFile(remoteFile, descriptor);
}
boolean systemEditor = descriptor != null && descriptor.getId().equals(IEditorRegistry.SYSTEM_EXTERNAL_EDITOR_ID);
@ -392,6 +430,10 @@ public void fill(Menu menu, int index)
}
*/
createDefaultMenuItem(menu, _remoteFile);
// create other menu
createOtherMenuItem(menu, _remoteFile);
}

View file

@ -12,6 +12,7 @@
*
* Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -22,6 +23,7 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteSearchResult;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
public class SystemSearchBrowseFileLineAction extends SystemSearchEditFileLineAction {
@ -32,19 +34,19 @@ public class SystemSearchBrowseFileLineAction extends SystemSearchEditFileLineAc
* @param tooltip the tooltip for the action.
* @param image the image for the action.
* @param parent the parent shell.
* @param editorId the editor id.
* @param editorDescriptor the editor id.
* @param remoteFile the remote file that is to be opened.
* @param searchResult the line number.
*/
public SystemSearchBrowseFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, String editorId, IRemoteFile remoteFile, IRemoteSearchResult searchResult) {
super(text, tooltip, image, parent, editorId, remoteFile, searchResult);
public SystemSearchBrowseFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, IEditorDescriptor editorDescriptor, IRemoteFile remoteFile, IRemoteSearchResult searchResult) {
super(text, tooltip, image, parent, editorDescriptor, remoteFile, searchResult);
}
/**
* @see org.eclipse.rse.internal.files.ui.actions.SystemEditFileAction#process(IRemoteFile)
*/
protected void process(IRemoteFile remoteFile) {
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorId);
SystemEditableRemoteFile editableFile = new SystemEditableRemoteFile(remoteFile, _editorDescriptor);
editableFile.open(SystemBasePlugin.getActiveWorkbenchShell(), true);
handleGotoLine(_remoteFile, _searchResult);
}

View file

@ -13,6 +13,7 @@
* Contributors:
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -26,6 +27,7 @@ import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile;
import org.eclipse.rse.subsystems.files.core.subsystems.IRemoteSearchResult;
import org.eclipse.rse.ui.SystemBasePlugin;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorReference;
@ -54,8 +56,8 @@ public class SystemSearchEditFileLineAction extends SystemEditFileAction {
* @param remoteFile the remote file that is to be opened.
* @param searchResult the line number.
*/
public SystemSearchEditFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, String editorId, IRemoteFile remoteFile, IRemoteSearchResult searchResult) {
super(text, tooltip, image, parent, editorId);
public SystemSearchEditFileLineAction(String text, String tooltip, ImageDescriptor image, Shell parent, IEditorDescriptor editorDescriptor, IRemoteFile remoteFile, IRemoteSearchResult searchResult) {
super(text, tooltip, image, parent, editorDescriptor);
this._remoteFile = remoteFile;
this._searchResult = searchResult;
}

View file

@ -17,6 +17,7 @@
* Martin Oberhuber (Wind River) - [189130] Move SystemIFileProperties from UI to Core
* David McKnight (IBM) - [216252] [api][nls] Resource Strings specific to subsystems should be moved from rse.ui into files.ui / shells.ui / processes.ui where possible
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
********************************************************************************/
package org.eclipse.rse.internal.files.ui.actions;
@ -533,7 +534,7 @@ public class SystemUploadConflictAction extends SystemBaseAction implements Runn
String id = editor.getEditorSite().getId();
// open editor on new file
SystemEditableRemoteFile edit = new SystemEditableRemoteFile(_saveasFile, id);
SystemEditableRemoteFile edit = new SystemEditableRemoteFile(_saveasFile);
try
{
edit.download(getShell());

View file

@ -49,6 +49,7 @@
* David McKnight (IBM) - [220547] [api][breaking] SimpleSystemMessage needs to specify a message id and some messages should be shared
* Xuan Chen (IBM) - [223126] [api][breaking] Remove API related to User Actions in RSE Core/UI
* Rupen Mardirossian (IBM) - [210682] Copy collisions will use SystemCopyDialog now instead of renameDialog when there is a copy collision within the same connection
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
*******************************************************************************/
package org.eclipse.rse.internal.files.ui.view;
@ -395,6 +396,9 @@ public class SystemViewRemoteFileAdapter
openWithMenu.updateSelection(selection);
submenu.add(openWithMenu);
menu.getMenuManager().appendToGroup(ISystemContextMenuConstants.GROUP_OPENWITH, submenu);
}
}