mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-14 20:45:22 +02:00
[261019] New File/Folder actions available in Work Offline mode
This commit is contained in:
parent
ef55e61199
commit
e863f9e6ae
7 changed files with 160 additions and 70 deletions
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2006, 2008 IBM Corporation and others. All rights reserved.
|
Copyright (c) 2008 IBM Corporation and others. All rights reserved.
|
||||||
This program and the accompanying materials are made available under the terms
|
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
|
of the Eclipse Public License v1.0 which accompanies this distribution, and is
|
||||||
available at http://www.eclipse.org/legal/epl-v10.html
|
available at http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
@ -12,12 +12,7 @@ Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
|
|
||||||
Contributors:
|
Contributors:
|
||||||
Martin Oberhuber (Wind River) - [180519] declaratively register adapter factories
|
David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
|
||||||
Martin Oberhuber (Wind River) - [186748] Move ISubSystemConfigurationAdapter from UI/rse.core.subsystems.util
|
|
||||||
David McKnight (IBM) - [187711] Link with Editor action for System View
|
|
||||||
David McKnight (IBM) - [209593] [api] add support for "file permissions" and "owner" properties for unix files
|
|
||||||
Johnson Ma (Wind River) - [195402] Add tar.gz archive support
|
|
||||||
-->
|
-->
|
||||||
<?eclipse version="3.0"?>
|
<?eclipse version="3.0"?>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
@ -448,14 +443,17 @@ Johnson Ma (Wind River) - [195402] Add tar.gz archive support
|
||||||
objectClass="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"
|
objectClass="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"
|
||||||
id="org.eclipse.rse.files.ui.actions.synchronizeCache">
|
id="org.eclipse.rse.files.ui.actions.synchronizeCache">
|
||||||
<visibility>
|
<visibility>
|
||||||
<objectState name="isdirectory" value="true"/>
|
<objectState name="isdirectory" value="true"/>
|
||||||
</visibility>
|
</visibility>
|
||||||
<action
|
<action
|
||||||
label="%synchronizeCache.label"
|
label="%synchronizeCache.label"
|
||||||
tooltip="%synchronizeCache.tooltip"
|
tooltip="%synchronizeCache.tooltip"
|
||||||
class="org.eclipse.rse.internal.files.ui.actions.SynchronizeCacheActionDelegate"
|
class="org.eclipse.rse.internal.files.ui.actions.SynchronizeCacheActionDelegate"
|
||||||
menubarPath="group.importexport"
|
menubarPath="group.importexport"
|
||||||
id="synchronizeCache">
|
id="synchronizeCache">
|
||||||
|
<enablement>
|
||||||
|
<objectState name="offline" value="false"/>
|
||||||
|
</enablement>
|
||||||
</action>
|
</action>
|
||||||
</objectContribution>
|
</objectContribution>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
* David McKnight (IBM) - [224313] [api] Create RSE Events for MOVE and COPY holding both source and destination fields
|
* 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
|
* David McKnight (IBM) - [224377] "open with" menu does not have "other" option
|
||||||
* David Dykstal (IBM) [230821] fix IRemoteFileSubSystem API to be consistent with IFileService
|
* David Dykstal (IBM) [230821] fix IRemoteFileSubSystem API to be consistent with IFileService
|
||||||
|
* David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.actions;
|
package org.eclipse.rse.internal.files.ui.actions;
|
||||||
|
@ -130,6 +131,9 @@ implements IValidatorRemoteSelection
|
||||||
Object selectedObject = e.next();
|
Object selectedObject = e.next();
|
||||||
if (!(selectedObject instanceof IRemoteFile))
|
if (!(selectedObject instanceof IRemoteFile))
|
||||||
enable = false;
|
enable = false;
|
||||||
|
else {
|
||||||
|
enable = !((IRemoteFile)selectedObject).getParentRemoteFileSubSystem().isOffline();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return enable;
|
return enable;
|
||||||
}
|
}
|
||||||
|
@ -588,4 +592,7 @@ implements IValidatorRemoteSelection
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -12,18 +12,21 @@
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.actions;
|
package org.eclipse.rse.internal.files.ui.actions;
|
||||||
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.jface.wizard.IWizard;
|
import org.eclipse.jface.wizard.IWizard;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.internal.files.ui.wizards.SystemNewFileWizard;
|
import org.eclipse.rse.internal.files.ui.wizards.SystemNewFileWizard;
|
||||||
import org.eclipse.rse.internal.ui.SystemResources;
|
import org.eclipse.rse.internal.ui.SystemResources;
|
||||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
import org.eclipse.rse.ui.actions.SystemBaseWizardAction;
|
import org.eclipse.rse.ui.actions.SystemBaseWizardAction;
|
||||||
|
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,5 +68,21 @@ public class SystemNewFileAction extends SystemBaseWizardAction
|
||||||
// newFileWizard.setInputObject(getValue());
|
// newFileWizard.setInputObject(getValue());
|
||||||
return newFileWizard;
|
return newFileWizard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkObjectType(Object selectedObject)
|
||||||
|
{
|
||||||
|
if (selectedObject instanceof IAdaptable){
|
||||||
|
ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)((IAdaptable)selectedObject).getAdapter(ISystemViewElementAdapter.class);
|
||||||
|
if (adapter != null){
|
||||||
|
ISubSystem ss = adapter.getSubSystem(selectedObject);
|
||||||
|
if (ss != null){
|
||||||
|
if (ss.isOffline()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,19 +12,22 @@
|
||||||
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
* Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* {Name} (company) - description of contribution.
|
* David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.actions;
|
package org.eclipse.rse.internal.files.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
import org.eclipse.jface.resource.ImageDescriptor;
|
import org.eclipse.jface.resource.ImageDescriptor;
|
||||||
import org.eclipse.jface.wizard.IWizard;
|
import org.eclipse.jface.wizard.IWizard;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.internal.files.ui.FileResources;
|
import org.eclipse.rse.internal.files.ui.FileResources;
|
||||||
import org.eclipse.rse.internal.files.ui.wizards.SystemNewFolderWizard;
|
import org.eclipse.rse.internal.files.ui.wizards.SystemNewFolderWizard;
|
||||||
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
import org.eclipse.rse.ui.ISystemContextMenuConstants;
|
||||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
import org.eclipse.rse.ui.actions.SystemBaseWizardAction;
|
import org.eclipse.rse.ui.actions.SystemBaseWizardAction;
|
||||||
|
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
|
||||||
|
@ -65,4 +68,19 @@ public class SystemNewFolderAction extends SystemBaseWizardAction
|
||||||
return newFolderWizard;
|
return newFolderWizard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkObjectType(Object selectedObject)
|
||||||
|
{
|
||||||
|
if (selectedObject instanceof IAdaptable){
|
||||||
|
ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)((IAdaptable)selectedObject).getAdapter(ISystemViewElementAdapter.class);
|
||||||
|
if (adapter != null){
|
||||||
|
ISubSystem ss = adapter.getSubSystem(selectedObject);
|
||||||
|
if (ss != null){
|
||||||
|
if (ss.isOffline()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,16 +12,20 @@
|
||||||
*
|
*
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
|
* Martin Oberhuber (Wind River) - [168870] refactor org.eclipse.rse.core package of the UI plugin
|
||||||
|
* David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
********************************************************************************/
|
********************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.actions;
|
package org.eclipse.rse.internal.files.ui.actions;
|
||||||
|
|
||||||
|
import org.eclipse.core.runtime.IAdaptable;
|
||||||
|
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||||
import org.eclipse.rse.internal.files.ui.search.SystemSearchPage;
|
import org.eclipse.rse.internal.files.ui.search.SystemSearchPage;
|
||||||
import org.eclipse.rse.internal.ui.SystemResources;
|
import org.eclipse.rse.internal.ui.SystemResources;
|
||||||
import org.eclipse.rse.ui.ISystemIconConstants;
|
import org.eclipse.rse.ui.ISystemIconConstants;
|
||||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||||
import org.eclipse.rse.ui.SystemBasePlugin;
|
import org.eclipse.rse.ui.SystemBasePlugin;
|
||||||
import org.eclipse.rse.ui.actions.SystemBaseAction;
|
import org.eclipse.rse.ui.actions.SystemBaseAction;
|
||||||
|
import org.eclipse.rse.ui.view.ISystemViewElementAdapter;
|
||||||
import org.eclipse.search.ui.NewSearchUI;
|
import org.eclipse.search.ui.NewSearchUI;
|
||||||
import org.eclipse.swt.widgets.Shell;
|
import org.eclipse.swt.widgets.Shell;
|
||||||
|
|
||||||
|
@ -41,4 +45,20 @@ public class SystemSearchAction extends SystemBaseAction {
|
||||||
public void run() {
|
public void run() {
|
||||||
NewSearchUI.openSearchDialog(SystemBasePlugin.getActiveWorkbenchWindow(), SystemSearchPage.SYSTEM_SEARCH_PAGE_ID);
|
NewSearchUI.openSearchDialog(SystemBasePlugin.getActiveWorkbenchWindow(), SystemSearchPage.SYSTEM_SEARCH_PAGE_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean checkObjectType(Object selectedObject)
|
||||||
|
{
|
||||||
|
if (selectedObject instanceof IAdaptable){
|
||||||
|
ISystemViewElementAdapter adapter = (ISystemViewElementAdapter)((IAdaptable)selectedObject).getAdapter(ISystemViewElementAdapter.class);
|
||||||
|
if (adapter != null){
|
||||||
|
ISubSystem ss = adapter.getSubSystem(selectedObject);
|
||||||
|
if (ss != null){
|
||||||
|
if (ss.isOffline()){
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -58,6 +58,7 @@
|
||||||
* Anna Dushistova (MontaVista) - [226550] [api] Launch Shell and Launch Terminal actions should be contributed declaratively
|
* Anna Dushistova (MontaVista) - [226550] [api] Launch Shell and Launch Terminal actions should be contributed declaratively
|
||||||
* Martin Oberhuber (Wind River) - [234215] improve API documentation for doDelete and doDeleteBatch
|
* Martin Oberhuber (Wind River) - [234215] improve API documentation for doDelete and doDeleteBatch
|
||||||
* David McKnight (IBM) - [251860] Rename a file/folder to a hidden file causes problems
|
* David McKnight (IBM) - [251860] Rename a file/folder to a hidden file causes problems
|
||||||
|
* David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.rse.internal.files.ui.view;
|
package org.eclipse.rse.internal.files.ui.view;
|
||||||
|
@ -317,7 +318,8 @@ public class SystemViewRemoteFileAdapter
|
||||||
boolean canRead = true;
|
boolean canRead = true;
|
||||||
boolean supportsSearch = true;
|
boolean supportsSearch = true;
|
||||||
boolean supportsArchiveManagement = false;
|
boolean supportsArchiveManagement = false;
|
||||||
|
boolean offline = false;
|
||||||
|
|
||||||
// perf improvement... phil
|
// perf improvement... phil
|
||||||
Object firstSelection = selection.getFirstElement();
|
Object firstSelection = selection.getFirstElement();
|
||||||
IRemoteFile firstFile = null;
|
IRemoteFile firstFile = null;
|
||||||
|
@ -327,9 +329,13 @@ public class SystemViewRemoteFileAdapter
|
||||||
elementType = firstFile.isDirectory() || firstFile.isRoot() ? 1 : 0;
|
elementType = firstFile.isDirectory() || firstFile.isRoot() ? 1 : 0;
|
||||||
isArchive = firstFile.isArchive();
|
isArchive = firstFile.isArchive();
|
||||||
canRead = firstFile.canRead();
|
canRead = firstFile.canRead();
|
||||||
|
|
||||||
|
IRemoteFileSubSystem fileSubSystem = firstFile.getParentRemoteFileSubSystem();
|
||||||
|
|
||||||
|
offline = fileSubSystem.isOffline();
|
||||||
|
|
||||||
supportsSearch = firstFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsSearch();
|
supportsSearch = fileSubSystem.getParentRemoteFileSubSystemConfiguration().supportsSearch();
|
||||||
supportsArchiveManagement = firstFile.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
|
supportsArchiveManagement = fileSubSystem.getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
return;
|
||||||
|
@ -353,25 +359,24 @@ public class SystemViewRemoteFileAdapter
|
||||||
|
|
||||||
if ((elementType == 1 || (isArchive && supportsArchiveManagement)))
|
if ((elementType == 1 || (isArchive && supportsArchiveManagement)))
|
||||||
{
|
{
|
||||||
if (!foldersOnly && canRead)
|
if (!foldersOnly)
|
||||||
{
|
{
|
||||||
if (addNewFile == null)
|
if (addNewFile == null)
|
||||||
{
|
{
|
||||||
addNewFile = new SystemNewFileAction(shell);
|
addNewFile = new SystemNewFileAction(shell);
|
||||||
}
|
}
|
||||||
|
addNewFile.setEnabled(canRead && !offline);
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_NEW, addNewFile);
|
menu.add(ISystemContextMenuConstants.GROUP_NEW, addNewFile);
|
||||||
}
|
}
|
||||||
if (!filesOnly)
|
if (!filesOnly)
|
||||||
{
|
{
|
||||||
if (canRead)
|
if (addNewFolder == null)
|
||||||
{
|
{
|
||||||
if (addNewFolder == null)
|
addNewFolder = new SystemNewFolderAction(shell);
|
||||||
{
|
}
|
||||||
addNewFolder = new SystemNewFolderAction(shell);
|
addNewFolder.setEnabled(canRead && !offline);
|
||||||
}
|
menu.add(ISystemContextMenuConstants.GROUP_NEW, addNewFolder);
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_NEW, addNewFolder);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addNewFilter == null)
|
if (addNewFilter == null)
|
||||||
{
|
{
|
||||||
addNewFilter = new SystemNewFileFilterFromFolderAction(shell);
|
addNewFilter = new SystemNewFileFilterFromFolderAction(shell);
|
||||||
|
@ -382,33 +387,27 @@ public class SystemViewRemoteFileAdapter
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else {
|
||||||
{
|
// open
|
||||||
if (canRead)
|
String label = SystemResources.ACTION_CASCADING_OPEN_LABEL;
|
||||||
{
|
String tooltip = SystemResources.ACTION_CASCADING_OPEN_TOOLTIP;
|
||||||
// open
|
SystemEditFilesAction action = new SystemEditFilesAction(label, tooltip, shell);
|
||||||
String label = SystemResources.ACTION_CASCADING_OPEN_LABEL;
|
menu.add(ISystemContextMenuConstants.GROUP_OPEN, action);
|
||||||
String tooltip = SystemResources.ACTION_CASCADING_OPEN_TOOLTIP;
|
action.setEnabled(canRead && !offline);
|
||||||
SystemEditFilesAction action = new SystemEditFilesAction(label, tooltip, shell);
|
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_OPEN, action);
|
|
||||||
|
|
||||||
// open with ->
|
// open with ->
|
||||||
|
|
||||||
MenuManager submenu =
|
MenuManager submenu =
|
||||||
new MenuManager(FileResources.ResourceNavigator_openWith,
|
new MenuManager(FileResources.ResourceNavigator_openWith,
|
||||||
ISystemContextMenuConstants.GROUP_OPENWITH);
|
ISystemContextMenuConstants.GROUP_OPENWITH);
|
||||||
|
|
||||||
if (openWithMenu == null)
|
if (openWithMenu == null)
|
||||||
{
|
{
|
||||||
openWithMenu = new SystemRemoteFileOpenWithMenu();
|
openWithMenu = new SystemRemoteFileOpenWithMenu();
|
||||||
}
|
}
|
||||||
openWithMenu.updateSelection(selection);
|
openWithMenu.updateSelection(selection);
|
||||||
submenu.add(openWithMenu);
|
submenu.add(openWithMenu);
|
||||||
menu.getMenuManager().appendToGroup(ISystemContextMenuConstants.GROUP_OPENWITH, submenu);
|
menu.getMenuManager().appendToGroup(ISystemContextMenuConstants.GROUP_OPENWITH, submenu);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -444,35 +443,40 @@ public class SystemViewRemoteFileAdapter
|
||||||
{
|
{
|
||||||
replaceEditionAction = new SystemReplaceWithEditionAction(shell);
|
replaceEditionAction = new SystemReplaceWithEditionAction(shell);
|
||||||
}
|
}
|
||||||
if (canRead && supportsSearch)
|
if (supportsSearch)
|
||||||
{
|
{
|
||||||
//menu.add(ISystemContextMenuConstants.GROUP_IMPORTEXPORT, addToArchiveAction);
|
//menu.add(ISystemContextMenuConstants.GROUP_IMPORTEXPORT, addToArchiveAction);
|
||||||
|
|
||||||
// add search action
|
// add search action
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_SEARCH, searchAction);
|
menu.add(ISystemContextMenuConstants.GROUP_SEARCH, searchAction);
|
||||||
|
searchAction.setEnabled(canRead && !offline);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!firstFile.isRoot() && canRead)
|
if (!firstFile.isRoot())
|
||||||
{
|
{
|
||||||
menu.add(menuGroup, copyClipboardAction);
|
menu.add(menuGroup, copyClipboardAction);
|
||||||
|
copyClipboardAction.setEnabled(canRead && !offline);
|
||||||
if (elementType == 0)
|
if (elementType == 0)
|
||||||
{
|
{
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_COMPAREWITH, compareFilesAction);
|
menu.add(ISystemContextMenuConstants.GROUP_COMPAREWITH, compareFilesAction);
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_COMPAREWITH, compareEditionAction);
|
menu.add(ISystemContextMenuConstants.GROUP_COMPAREWITH, compareEditionAction);
|
||||||
menu.add(ISystemContextMenuConstants.GROUP_REPLACEWITH, replaceEditionAction);
|
menu.add(ISystemContextMenuConstants.GROUP_REPLACEWITH, replaceEditionAction);
|
||||||
|
|
||||||
|
compareFilesAction.setEnabled(canRead && !offline);
|
||||||
|
compareEditionAction.setEnabled(canRead && !offline);
|
||||||
|
replaceEditionAction.setEnabled(canRead && !offline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (elementType == 1 || (isArchive && supportsArchiveManagement))
|
if (elementType == 1 || (isArchive && supportsArchiveManagement))
|
||||||
{
|
{
|
||||||
if (canRead)
|
menu.add(menuGroup, pasteClipboardAction);
|
||||||
{
|
pasteClipboardAction.setEnabled(canRead && !offline);
|
||||||
menu.add(menuGroup, pasteClipboardAction);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (!firstFile.isRoot() && canRead)
|
if (!firstFile.isRoot())
|
||||||
{
|
{
|
||||||
menu.add(menuGroup, moveAction);
|
menu.add(menuGroup, moveAction);
|
||||||
|
moveAction.setEnabled(canRead && !offline);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1491,7 +1495,9 @@ public class SystemViewRemoteFileAdapter
|
||||||
{
|
{
|
||||||
if (element instanceof IRemoteFile)
|
if (element instanceof IRemoteFile)
|
||||||
{
|
{
|
||||||
return ((IRemoteFile)element).canRead();
|
IRemoteFile file = (IRemoteFile)element;
|
||||||
|
boolean offline = file.getParentRemoteFileSubSystem().isOffline();
|
||||||
|
return file.canRead() && !offline;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1506,8 +1512,9 @@ public class SystemViewRemoteFileAdapter
|
||||||
if (element instanceof IRemoteFile)
|
if (element instanceof IRemoteFile)
|
||||||
{
|
{
|
||||||
IRemoteFile file = (IRemoteFile) element;
|
IRemoteFile file = (IRemoteFile) element;
|
||||||
|
boolean offline = file.getParentRemoteFileSubSystem().isOffline();
|
||||||
boolean supportsArchiveManagement = file.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
|
boolean supportsArchiveManagement = file.getParentRemoteFileSubSystem().getParentRemoteFileSubSystemConfiguration().supportsArchiveManagement();
|
||||||
return file.canRead() && file.canWrite() && (file.isDirectory() || file.isRoot() || (file.isArchive() && supportsArchiveManagement));
|
return !offline && file.canRead() && file.canWrite() && (file.isDirectory() || file.isRoot() || (file.isArchive() && supportsArchiveManagement));
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@ -2727,8 +2734,8 @@ public class SystemViewRemoteFileAdapter
|
||||||
public boolean canDelete(Object element)
|
public boolean canDelete(Object element)
|
||||||
{
|
{
|
||||||
IRemoteFile file = (IRemoteFile) element;
|
IRemoteFile file = (IRemoteFile) element;
|
||||||
//System.out.println("INSIDE CANDELETE FOR ADAPTER: RETURNING " + !file.isRoot());
|
boolean offline = file.getParentRemoteFileSubSystem().isOffline();
|
||||||
return !file.isRoot() && file.canRead();
|
return !file.isRoot() && file.canRead() && !offline;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2861,7 +2868,8 @@ public class SystemViewRemoteFileAdapter
|
||||||
public boolean canRename(Object element)
|
public boolean canRename(Object element)
|
||||||
{
|
{
|
||||||
IRemoteFile file = (IRemoteFile) element;
|
IRemoteFile file = (IRemoteFile) element;
|
||||||
return !file.isRoot() && file.canRead();
|
boolean offline = file.getParentRemoteFileSubSystem().isOffline();
|
||||||
|
return !file.isRoot() && file.canRead() && !offline;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void moveTempResource(IResource localResource, IPath newLocalPath, IRemoteFileSubSystem ss, String newRemotePath)
|
private void moveTempResource(IResource localResource, IPath newLocalPath, IRemoteFileSubSystem ss, String newRemotePath)
|
||||||
|
@ -3357,7 +3365,8 @@ public class SystemViewRemoteFileAdapter
|
||||||
IRemoteFile remoteFile = (IRemoteFile) element;
|
IRemoteFile remoteFile = (IRemoteFile) element;
|
||||||
if (remoteFile.isFile())
|
if (remoteFile.isFile())
|
||||||
{
|
{
|
||||||
return remoteFile.canRead();
|
boolean offline = remoteFile.getParentRemoteFileSubSystem().isOffline();
|
||||||
|
return remoteFile.canRead() && !offline;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,20 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2008 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
|
||||||
|
|
||||||
|
Initial Contributors:
|
||||||
|
The following IBM employees contributed to the Remote System Explorer
|
||||||
|
component that contains this file: David McKnight, Kushal Munir,
|
||||||
|
Michael Berger, David Dykstal, Phil Coulthard, Don Yantzi, Eric Simpson,
|
||||||
|
Emily Bruner, Mazen Faraj, Adrian Storisteanu, Li Ding, and Kent Hawley.
|
||||||
|
|
||||||
|
Contributors:
|
||||||
|
David McKnight (IBM) - [261019] New File/Folder actions available in Work Offline mode
|
||||||
|
-->
|
||||||
|
|
||||||
<?eclipse version="3.0"?>
|
<?eclipse version="3.0"?>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
||||||
|
@ -100,19 +116,19 @@
|
||||||
point="org.eclipse.ui.popupMenus">
|
point="org.eclipse.ui.popupMenus">
|
||||||
<objectContribution
|
<objectContribution
|
||||||
objectClass="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"
|
objectClass="org.eclipse.rse.subsystems.files.core.subsystems.IRemoteFile"
|
||||||
id="org.eclipse.rse.files.importexport.projectImportExport">
|
id="org.eclipse.rse.files.importexport.projectImportExport">
|
||||||
<filter
|
<filter name="isDirectory" value="true"/>
|
||||||
name="isDirectory"
|
|
||||||
value="true">
|
|
||||||
</filter>
|
|
||||||
|
|
||||||
<action
|
<action
|
||||||
label="%ImportToProject.label"
|
label="%ImportToProject.label"
|
||||||
tooltip="%ImportToProject.tooltip"
|
tooltip="%ImportToProject.tooltip"
|
||||||
class="org.eclipse.rse.internal.importexport.files.RemoteFileImportToProjectActionDelegate"
|
class="org.eclipse.rse.internal.importexport.files.RemoteFileImportToProjectActionDelegate"
|
||||||
menubarPath="group.importexport"
|
menubarPath="group.importexport"
|
||||||
enablesFor="1"
|
enablesFor="1"
|
||||||
id="importToProject">
|
id="importToProject">
|
||||||
|
<enablement>
|
||||||
|
<objectState name="offline" value="false"/>
|
||||||
|
</enablement>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action
|
<action
|
||||||
|
@ -122,6 +138,9 @@
|
||||||
menubarPath="group.importexport"
|
menubarPath="group.importexport"
|
||||||
enablesFor="1"
|
enablesFor="1"
|
||||||
id="exportFromProject">
|
id="exportFromProject">
|
||||||
|
<enablement>
|
||||||
|
<objectState name="offline" value="false"/>
|
||||||
|
</enablement>
|
||||||
</action>
|
</action>
|
||||||
</objectContribution>
|
</objectContribution>
|
||||||
</extension>
|
</extension>
|
||||||
|
|
Loading…
Add table
Reference in a new issue