mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-22 14:12:10 +02:00
[168975] Move ISystemRegistryUI#fireRemoteResourceChangedEvent from UI to Core
This commit is contained in:
parent
5fa355b830
commit
a05c47c834
14 changed files with 64 additions and 131 deletions
|
@ -3,7 +3,7 @@
|
|||
<head>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
|
||||
<META HTTP-EQUIV="Content-Style-Type" CONTENT="text/css">
|
||||
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2006. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
|
||||
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2002, 2007. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
|
||||
<LINK REL="STYLESHEET" HREF="../../book.css" TYPE="text/css">
|
||||
<title>RSE User Interface API</title>
|
||||
</head>
|
||||
|
@ -126,7 +126,7 @@ To get the system registry, use the
|
|||
original client's thread; or you may want to pass the originating viewer's ID
|
||||
with the resource change event. Such operations are only possible when the UI
|
||||
is loaded, and therefore you need to use
|
||||
<samp><A href="../../reference/api/org/eclipse/rse/ui/model/ISystemRegistryUI.html#fireRemoteResourceChangeEvent(int, java.lang.Object, java.lang.Object, org.eclipse.rse.core.subsystems.ISubSystem, java.lang.String, org.eclipse.jface.viewers.Viewer)">ISystemRegistryUI.fireEvent()</a></samp>
|
||||
<samp><A href="../../reference/api/org/eclipse/rse/core/model/ISystemRegistry.html#fireRemoteResourceChangeEvent(int, java.lang.Object, java.lang.Object, org.eclipse.rse.core.subsystems.ISubSystem, java.lang.String, java.lang.Object)">ISystemRegistry.fireEvent()</a></samp>
|
||||
method in that case. To get the system registry UI interface, use the
|
||||
<samp><A href="../../reference/api/org/eclipse/rse/ui/RSEUIPlugin.html#getTheSystemRegistry()">RSEUIPlugin.getTheSystemRegistry()</a></samp>
|
||||
method.
|
||||
|
|
|
@ -29,6 +29,7 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent
|
|||
private Object resource, parent;
|
||||
private String oldName;
|
||||
private ISubSystem subsystem;
|
||||
private Object originatingViewer;
|
||||
|
||||
/**
|
||||
* Constructor for non-rename event
|
||||
|
@ -154,4 +155,25 @@ public class SystemRemoteChangeEvent implements ISystemRemoteChangeEvent
|
|||
return oldName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the originating viewer.
|
||||
* Only this viewer is candidate for updating the selection. Eg, on a
|
||||
* create event, if this and the resource parent is set, the newly
|
||||
* created object is selected after the parent's contents are refreshed,
|
||||
* for the originating viewer.
|
||||
*/
|
||||
public void setOriginatingViewer(Object originatingViewer) {
|
||||
this.originatingViewer = originatingViewer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the originating viewer from which this remote resource change event
|
||||
* comes from. The combination of this, if non-null, plus the resource parent,
|
||||
* allows viewers to decide whether to update the selection within the
|
||||
* parent resource, after refreshing that resource.
|
||||
*/
|
||||
public Object getOriginatingViewer() {
|
||||
return originatingViewer;
|
||||
}
|
||||
|
||||
}
|
|
@ -806,6 +806,20 @@ public interface ISystemRegistry extends ISchedulingRule {
|
|||
*/
|
||||
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName);
|
||||
|
||||
/**
|
||||
* Notify all listeners of a change to a remote resource such as a file.
|
||||
* This one takes the information needed and creates the event for you.
|
||||
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
||||
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
||||
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
||||
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
||||
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
||||
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
||||
* @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
|
||||
* This saves sending a separate event to reveal and select the new created resource on a create event, for example.
|
||||
*/
|
||||
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Object originatingViewer);
|
||||
|
||||
/**
|
||||
* Notify a specific listener of a change to a remote resource such as a file.
|
||||
*/
|
||||
|
|
|
@ -26,6 +26,7 @@ import org.eclipse.core.runtime.NullProgressMonitor;
|
|||
import org.eclipse.jface.dialogs.Dialog;
|
||||
import org.eclipse.jface.viewers.IStructuredSelection;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvents;
|
||||
import org.eclipse.rse.core.filters.ISystemFilter;
|
||||
|
@ -474,7 +475,7 @@ public class SystemCopyRemoteFileAction extends SystemBaseCopyAction
|
|||
invalidateFilterReferences(targetFolder);
|
||||
|
||||
|
||||
RSEUIPlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
|
||||
RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
|
||||
ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_CREATED, copiedFiles, targetFolder.getAbsolutePath(), fileSS, null, originatingViewer);
|
||||
|
||||
/* Old release 1.0 way...
|
||||
|
|
|
@ -19,6 +19,7 @@ package org.eclipse.rse.internal.files.ui.actions;
|
|||
import java.util.Vector;
|
||||
|
||||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvents;
|
||||
import org.eclipse.rse.core.model.IHost;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
|
@ -155,7 +156,7 @@ public class SystemMoveRemoteFileAction extends SystemCopyRemoteFileAction
|
|||
ISubSystem fileSS = targetFolder.getParentRemoteFileSubSystem();
|
||||
//RSEUIPlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
|
||||
// ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, copiedFiles, firstSelectionParent.getAbsolutePath(), fileSS, null, null);
|
||||
RSEUIPlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
|
||||
RSECorePlugin.getTheSystemRegistry().fireRemoteResourceChangeEvent(
|
||||
ISystemRemoteChangeEvents.SYSTEM_REMOTE_RESOURCE_DELETED, movedFiles, firstSelectionParent.getAbsolutePath(), fileSS, null, null);
|
||||
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ import java.util.Vector;
|
|||
import org.eclipse.core.runtime.IProgressMonitor;
|
||||
import org.eclipse.core.runtime.NullProgressMonitor;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvents;
|
||||
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
||||
|
@ -28,6 +29,7 @@ import org.eclipse.rse.core.events.ISystemResourceChangeListener;
|
|||
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.core.filters.ISystemFilter;
|
||||
import org.eclipse.rse.core.filters.ISystemFilterReference;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.internal.files.ui.FileResources;
|
||||
import org.eclipse.rse.services.clientserver.archiveutils.ArchiveHandlerManager;
|
||||
|
@ -44,7 +46,6 @@ import org.eclipse.rse.ui.ISystemIconConstants;
|
|||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.rse.ui.view.ISystemTree;
|
||||
import org.eclipse.rse.ui.wizards.AbstractSystemWizard;
|
||||
|
||||
|
@ -282,7 +283,7 @@ public class SystemNewFileWizard
|
|||
protected static void updateGUI(IRemoteFile parentFolder, IRemoteFile newFileOrFolder, Viewer viewer,
|
||||
boolean isInputAFilter, ISystemFilterReference selectedFilterRef)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
if (selectedFilterRef != null)
|
||||
{
|
||||
selectedFilterRef.markStale(true);
|
||||
|
|
|
@ -29,11 +29,13 @@ import org.eclipse.core.runtime.IStatus;
|
|||
import org.eclipse.core.runtime.Status;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvents;
|
||||
import org.eclipse.rse.core.filters.ISystemFilterReference;
|
||||
import org.eclipse.rse.core.model.IHost;
|
||||
import org.eclipse.rse.core.model.ISystemContainer;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.core.model.ISystemResourceSet;
|
||||
import org.eclipse.rse.core.model.SystemRemoteResourceSet;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
|
@ -44,7 +46,6 @@ import org.eclipse.rse.services.clientserver.messages.SystemMessage;
|
|||
import org.eclipse.rse.ui.ISystemMessages;
|
||||
import org.eclipse.rse.ui.RSEUIPlugin;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.swt.widgets.Display;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
import org.eclipse.ui.progress.UIJob;
|
||||
|
@ -611,7 +612,7 @@ public class SystemDNDTransferRunnable extends WorkspaceJob
|
|||
|
||||
public IStatus runInUIThread(IProgressMonitor monitor)
|
||||
{
|
||||
ISystemRegistryUI registry = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry registry = RSECorePlugin.getTheSystemRegistry();
|
||||
if (_resultTgtObjects.size() > 0)
|
||||
{
|
||||
boolean doRefresh = _ok;
|
||||
|
|
|
@ -44,6 +44,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
|
|||
import org.eclipse.jface.viewers.TableLayout;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.window.SameShellProvider;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemAdapterHelpers;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvent;
|
||||
|
@ -77,7 +78,6 @@ import org.eclipse.rse.ui.actions.ISystemAction;
|
|||
import org.eclipse.rse.ui.actions.SystemRefreshAction;
|
||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.rse.ui.model.ISystemShellProvider;
|
||||
import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
|
||||
import org.eclipse.rse.ui.view.ContextObject;
|
||||
|
@ -1277,7 +1277,7 @@ public class SystemTableTreeView
|
|||
*/
|
||||
public boolean doDelete(IProgressMonitor monitor)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
//int selectedCount = selection.size();
|
||||
|
@ -1369,7 +1369,7 @@ public class SystemTableTreeView
|
|||
*/
|
||||
public boolean doRename(String[] newNames)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
//int selectedCount = selection.size();
|
||||
|
|
|
@ -124,7 +124,6 @@ import org.eclipse.rse.ui.dialogs.SystemPromptDialog;
|
|||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemPromptableObject;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.rse.ui.model.ISystemShellProvider;
|
||||
import org.eclipse.rse.ui.model.SystemRemoteElementResourceSet;
|
||||
import org.eclipse.rse.ui.model.SystemResourceChangeEventUI;
|
||||
|
@ -4603,7 +4602,7 @@ public class SystemView extends SafeTreeViewer
|
|||
* Required method from ISystemDeleteTarget
|
||||
*/
|
||||
public boolean doDelete(IProgressMonitor monitor) {
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
//int selectedCount = selection.size();
|
||||
|
@ -4731,7 +4730,7 @@ public class SystemView extends SafeTreeViewer
|
|||
* Required method from ISystemRenameTarget
|
||||
*/
|
||||
public boolean doRename(String[] newNames) {
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
Object element = null;
|
||||
|
|
|
@ -42,6 +42,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
|
|||
import org.eclipse.jface.viewers.TableLayout;
|
||||
import org.eclipse.jface.viewers.TreeViewer;
|
||||
import org.eclipse.jface.window.SameShellProvider;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemAdapterHelpers;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvent;
|
||||
|
@ -78,7 +79,6 @@ import org.eclipse.rse.ui.actions.SystemRefreshAction;
|
|||
import org.eclipse.rse.ui.internal.model.SystemRegistry;
|
||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.rse.ui.model.ISystemShellProvider;
|
||||
import org.eclipse.rse.ui.view.AbstractSystemViewAdapter;
|
||||
import org.eclipse.rse.ui.view.ContextObject;
|
||||
|
@ -823,7 +823,7 @@ public class SystemScratchpadView
|
|||
*/
|
||||
public boolean doDelete(IProgressMonitor monitor)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
//int selectedCount = selection.size();
|
||||
|
@ -915,7 +915,7 @@ public class SystemScratchpadView
|
|||
*/
|
||||
public boolean doRename(String[] newNames)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
//int selectedCount = selection.size();
|
||||
|
|
|
@ -43,6 +43,7 @@ import org.eclipse.jface.viewers.StructuredSelection;
|
|||
import org.eclipse.jface.viewers.TableLayout;
|
||||
import org.eclipse.jface.viewers.TableViewer;
|
||||
import org.eclipse.jface.window.SameShellProvider;
|
||||
import org.eclipse.rse.core.RSECorePlugin;
|
||||
import org.eclipse.rse.core.SystemAdapterHelpers;
|
||||
import org.eclipse.rse.core.SystemBasePlugin;
|
||||
import org.eclipse.rse.core.events.ISystemRemoteChangeEvent;
|
||||
|
@ -87,7 +88,6 @@ import org.eclipse.rse.ui.actions.ISystemAction;
|
|||
import org.eclipse.rse.ui.actions.SystemRefreshAction;
|
||||
import org.eclipse.rse.ui.messages.ISystemMessageLine;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.rse.ui.model.ISystemShellProvider;
|
||||
import org.eclipse.swt.SWT;
|
||||
import org.eclipse.swt.dnd.DND;
|
||||
|
@ -1408,7 +1408,7 @@ public class SystemTableView
|
|||
*/
|
||||
public boolean doDelete(IProgressMonitor monitor)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
//int selectedCount = selection.size();
|
||||
|
@ -1500,7 +1500,7 @@ public class SystemTableView
|
|||
*/
|
||||
public boolean doRename(String[] newNames)
|
||||
{
|
||||
ISystemRegistryUI sr = RSEUIPlugin.getTheSystemRegistry();
|
||||
ISystemRegistry sr = RSECorePlugin.getTheSystemRegistry();
|
||||
IStructuredSelection selection = (IStructuredSelection) getSelection();
|
||||
Iterator elements = selection.iterator();
|
||||
Object element = null;
|
||||
|
|
|
@ -55,6 +55,7 @@ import org.eclipse.rse.core.events.ISystemRemoteChangeListener;
|
|||
import org.eclipse.rse.core.events.ISystemResourceChangeEvent;
|
||||
import org.eclipse.rse.core.events.ISystemResourceChangeEvents;
|
||||
import org.eclipse.rse.core.events.ISystemResourceChangeListener;
|
||||
import org.eclipse.rse.core.events.SystemRemoteChangeEvent;
|
||||
import org.eclipse.rse.core.events.SystemResourceChangeEvent;
|
||||
import org.eclipse.rse.core.filters.ISystemFilter;
|
||||
import org.eclipse.rse.core.filters.ISystemFilterPoolReferenceManager;
|
||||
|
@ -95,7 +96,6 @@ import org.eclipse.rse.ui.RSEUIPlugin;
|
|||
import org.eclipse.rse.ui.SystemPreferencesManager;
|
||||
import org.eclipse.rse.ui.messages.SystemMessageDialog;
|
||||
import org.eclipse.rse.ui.model.ISystemRegistryUI;
|
||||
import org.eclipse.rse.ui.model.SystemRemoteChangeEventUI;
|
||||
import org.eclipse.rse.ui.subsystems.ISubSystemConfigurationAdapter;
|
||||
import org.eclipse.rse.ui.view.ISystemRemoteElementAdapter;
|
||||
import org.eclipse.rse.ui.view.ISystemViewInputProvider;
|
||||
|
@ -122,7 +122,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
|
|||
private SystemModelChangeEventManager modelListenerManager = null;
|
||||
private SystemModelChangeEvent modelEvent;
|
||||
private SystemRemoteChangeEventManager remoteListManager = null;
|
||||
private SystemRemoteChangeEventUI remoteEvent;
|
||||
private SystemRemoteChangeEvent remoteEvent;
|
||||
|
||||
private int listenerCount = 0;
|
||||
private int modelListenerCount = 0;
|
||||
|
@ -3027,7 +3027,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
|
|||
invalidateFiltersFor(resourceParent, subsystem);
|
||||
|
||||
if (remoteEvent == null)
|
||||
remoteEvent = new SystemRemoteChangeEventUI();
|
||||
remoteEvent = new SystemRemoteChangeEvent();
|
||||
remoteEvent.setEventType(eventType);
|
||||
remoteEvent.setResource(resource);
|
||||
remoteEvent.setResourceParent(resourceParent);
|
||||
|
@ -3048,7 +3048,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
|
|||
* @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
|
||||
* This saves sending a separate event to reveal and select the new created resource on a create event, for example.
|
||||
*/
|
||||
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Viewer originatingViewer)
|
||||
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Object originatingViewer)
|
||||
{
|
||||
if (resourceParent instanceof ISystemContainer)
|
||||
{
|
||||
|
@ -3058,7 +3058,7 @@ public class SystemRegistry implements ISystemRegistryUI, ISystemViewInputProvid
|
|||
invalidateFiltersFor(resourceParent, subsystem);
|
||||
|
||||
if (remoteEvent == null)
|
||||
remoteEvent = new SystemRemoteChangeEventUI();
|
||||
remoteEvent = new SystemRemoteChangeEvent();
|
||||
remoteEvent.setEventType(eventType);
|
||||
remoteEvent.setResource(resource);
|
||||
remoteEvent.setResourceParent(resourceParent);
|
||||
|
|
|
@ -16,11 +16,9 @@
|
|||
package org.eclipse.rse.ui.model;
|
||||
|
||||
import org.eclipse.jface.operation.IRunnableContext;
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.core.events.ISystemResourceChangeEvent;
|
||||
import org.eclipse.rse.core.events.ISystemResourceChangeListener;
|
||||
import org.eclipse.rse.core.model.ISystemRegistry;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
import org.eclipse.rse.ui.view.ISystemViewInputProvider;
|
||||
import org.eclipse.swt.dnd.Clipboard;
|
||||
import org.eclipse.swt.widgets.Shell;
|
||||
|
@ -53,20 +51,6 @@ public interface ISystemRegistryUI
|
|||
*/
|
||||
public void postEvent(ISystemResourceChangeListener listener, ISystemResourceChangeEvent event);
|
||||
|
||||
/**
|
||||
* Notify all listeners of a change to a remote resource such as a file.
|
||||
* This one takes the information needed and creates the event for you.
|
||||
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
||||
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
||||
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
||||
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
||||
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
||||
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
||||
* @param originatingViewer - optional. If set, this gives the viewer a clue that it should select the affected resource after refreshing its parent.
|
||||
* This saves sending a separate event to reveal and select the new created resource on a create event, for example.
|
||||
*/
|
||||
public void fireRemoteResourceChangeEvent(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName, Viewer originatingViewer);
|
||||
|
||||
// ----------------------------------
|
||||
// ACTIVE PROGRESS MONITOR METHODS...
|
||||
// ----------------------------------
|
||||
|
|
|
@ -1,90 +0,0 @@
|
|||
/********************************************************************************
|
||||
* Copyright (c) 2002, 2007 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:
|
||||
* Martin Oberhuber (Wind River) - [168975] Move RSE Events API to Core
|
||||
********************************************************************************/
|
||||
|
||||
package org.eclipse.rse.ui.model;
|
||||
|
||||
import org.eclipse.jface.viewers.Viewer;
|
||||
import org.eclipse.rse.core.events.SystemRemoteChangeEvent;
|
||||
import org.eclipse.rse.core.subsystems.ISubSystem;
|
||||
|
||||
/**
|
||||
* For listeners interested in changes with remote resources.
|
||||
* These events are designed to state what the change to the resource was, not to
|
||||
* optimize those events for a GUI (eg, a delete event versus a refresh event)
|
||||
*/
|
||||
public class SystemRemoteChangeEventUI extends SystemRemoteChangeEvent {
|
||||
|
||||
private Viewer originatingViewer;
|
||||
|
||||
/**
|
||||
* Constructor for non-rename event
|
||||
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
||||
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
||||
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
||||
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
||||
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
||||
*/
|
||||
public SystemRemoteChangeEventUI(int eventType, Object resource, Object resourceParent, ISubSystem subsystem)
|
||||
{
|
||||
super(eventType, resource, resourceParent, subsystem);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for a rename event.
|
||||
* @param eventType - one of the constants from {@link org.eclipse.rse.core.events.ISystemRemoteChangeEvents}
|
||||
* @param resource - the remote resource object, or absolute name of the resource as would be given by calling getAbsoluteName on its remote adapter
|
||||
* @param resourceParent - the remote resource's parent object, or absolute name, if that is known. If it is non-null, this will aid in refreshing occurences of that parent.
|
||||
* @param subsystem - the subsystem which contains this remote resource. This allows the search for impacts to be
|
||||
* limited to subsystems of the same parent factory, and to connections with the same hostname as the subsystem's connection.
|
||||
* @param oldName - on a rename operation, this is the absolute name of the resource prior to the rename
|
||||
*/
|
||||
public SystemRemoteChangeEventUI(int eventType, Object resource, Object resourceParent, ISubSystem subsystem, String oldName)
|
||||
{
|
||||
super(eventType, resource, resourceParent, subsystem, oldName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor you shouldn't use unless you intend to call the setters
|
||||
*/
|
||||
public SystemRemoteChangeEventUI()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the originating viewer.
|
||||
* Only this viewer is candidate for updating the selection. Eg, on a
|
||||
* create event, if this and the resource parent is set, the newly
|
||||
* created object is selected after the parent's contents are refreshed,
|
||||
* for the originating viewer.
|
||||
*/
|
||||
public void setOriginatingViewer(Viewer originatingViewer)
|
||||
{
|
||||
this.originatingViewer = originatingViewer;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the originating viewer from which this remote resource change event
|
||||
* comes from. The combination of this, if non-null, plus the resource parent,
|
||||
* allows viewers to decide whether to update the selection within the
|
||||
* parent resource, after refreshing that resource.
|
||||
*/
|
||||
public Viewer getOriginatingViewer()
|
||||
{
|
||||
return originatingViewer;
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue