mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-09 18:56:02 +02:00
[189711] isRemote method for ISystemViewElementAdapter
This commit is contained in:
parent
a18ca0d288
commit
be3fbd90d6
17 changed files with 181 additions and 21 deletions
|
@ -857,32 +857,31 @@ public class SystemView extends SafeTreeViewer
|
|||
// GO INTO ACTION...
|
||||
// OPEN IN NEW WINDOW ACTION...
|
||||
if (fromSystemViewPart) {
|
||||
GoIntoAction goIntoAction = getGoIntoAction();
|
||||
boolean singleSelection = selection.size() == 1;
|
||||
goIntoAction.setEnabled(singleSelection);
|
||||
boolean selectionHasChildren = false;
|
||||
if (singleSelection)
|
||||
|
||||
Object selectedObject = selection.getFirstElement();
|
||||
ISystemViewElementAdapter adapter = getViewAdapter(selectedObject);
|
||||
if (!selectionIsRemoteObject)
|
||||
{
|
||||
// dkm - first find out if the selection will have children
|
||||
// only add this action if there are children
|
||||
Object selectedObject = selection.getFirstElement();
|
||||
ISystemViewElementAdapter adapter = getViewAdapter(selectedObject);
|
||||
if (adapter != null)
|
||||
{
|
||||
GoIntoAction goIntoAction = getGoIntoAction();
|
||||
boolean singleSelection = selection.size() == 1;
|
||||
goIntoAction.setEnabled(singleSelection);
|
||||
if (singleSelection) {
|
||||
// dkm - first find out if the selection will have children
|
||||
// only add this action if there are children
|
||||
if (adapter.hasChildren((IAdaptable)selectedObject))
|
||||
{
|
||||
selectionHasChildren = true;
|
||||
menu.appendToGroup(ISystemContextMenuConstants.GROUP_GOTO, goIntoAction);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (showOpenViewActions()) {
|
||||
SystemOpenExplorerPerspectiveAction opa = getOpenToPerspectiveAction();
|
||||
opa.setSelection(selection);
|
||||
menu.appendToGroup(opa.getContextMenuGroup(), opa);
|
||||
if (showOpenViewActions()) {
|
||||
SystemOpenExplorerPerspectiveAction opa = getOpenToPerspectiveAction();
|
||||
opa.setSelection(selection);
|
||||
menu.appendToGroup(opa.getContextMenuGroup(), opa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (showGenericShowInTableAction()) {
|
||||
SystemShowInTableAction showInTableAction = getShowInTableAction();
|
||||
showInTableAction.setSelection(selection);
|
||||
|
@ -1325,6 +1324,11 @@ public class SystemView extends SafeTreeViewer
|
|||
}
|
||||
}
|
||||
|
||||
protected IRemoteObjectIdentifier getRemoteObjectIdentifier(Object o)
|
||||
{
|
||||
return (IRemoteObjectIdentifier)((IAdaptable)o).getAdapter(IRemoteObjectIdentifier.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the implementation of IRemoteObjectIdentifier for the given
|
||||
* object. Returns null if this object does not adaptable to this.
|
||||
|
@ -2112,8 +2116,7 @@ public class SystemView extends SafeTreeViewer
|
|||
else
|
||||
{
|
||||
// only do this if the object is "remote"
|
||||
Object remoteAdapter = getRemoteAdapter(src);
|
||||
if (remoteAdapter != null)
|
||||
if (adapter.isRemote(src))
|
||||
{
|
||||
// get up-to-date version of the container (need to make sure it still exists)
|
||||
if (ss == null)
|
||||
|
@ -4677,7 +4680,7 @@ public class SystemView extends SafeTreeViewer
|
|||
|
||||
if (selectionEnableRenameAction) selectionEnableRenameAction = selectionShowRenameAction && adapter.canRename(element);
|
||||
|
||||
if (selectionIsRemoteObject) selectionIsRemoteObject = (getRemoteAdapter(element) != null);
|
||||
if (selectionIsRemoteObject) selectionIsRemoteObject = adapter.isRemote(element);
|
||||
|
||||
if (selectionIsRemoteObject && !selectionFlagsUpdated) {
|
||||
ISubSystem srcSubSystem = adapter.getSubSystem(element);
|
||||
|
|
|
@ -825,5 +825,15 @@ public class SystemViewConnectionAdapter
|
|||
{
|
||||
return ISystemMementoConstants.MEMENTO_KEY_CONNECTION;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -67,6 +67,8 @@ import org.eclipse.ui.views.properties.PropertyDescriptor;
|
|||
*/
|
||||
public class SystemViewFilterAdapter extends AbstractSystemViewAdapter
|
||||
{
|
||||
|
||||
|
||||
//private static String translatedFilterString = null;
|
||||
// -------------------
|
||||
// property descriptors
|
||||
|
@ -576,4 +578,14 @@ public class SystemViewFilterAdapter extends AbstractSystemViewAdapter
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -290,4 +290,14 @@ public class SystemViewFilterPoolAdapter extends AbstractSystemViewAdapter
|
|||
return (mgrName + "." + newName).toUpperCase(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -389,4 +389,13 @@ public class SystemViewFilterPoolReferenceAdapter
|
|||
return ISystemMementoConstants.MEMENTO_KEY_FILTERPOOLREFERENCE;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -995,4 +995,14 @@ public class SystemViewFilterReferenceAdapter
|
|||
{
|
||||
return subSys.getSubSystemConfiguration().supportsDeferredQueries();
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -274,4 +274,14 @@ public class SystemViewFilterStringAdapter extends AbstractSystemViewAdapter
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -196,5 +196,15 @@ public class SystemViewMessageAdapter
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -214,4 +214,14 @@ public class SystemViewPromptableAdapter
|
|||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -228,4 +228,14 @@ public class SystemViewRootInputAdapter extends AbstractSystemViewAdapter
|
|||
return getType(element);
|
||||
//return "root";
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -278,4 +278,13 @@ public class SystemViewScratchpadAdapter extends AbstractSystemViewAdapter imple
|
|||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -755,4 +755,13 @@ public class SystemViewSubSystemAdapter extends AbstractSystemViewAdapter
|
|||
return ISystemMementoConstants.MEMENTO_KEY_SUBSYSTEM;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -273,4 +273,13 @@ public class SystemTeamViewCategoryAdapter
|
|||
return category.getProfile().getName() + "." + category.getLabel(); //$NON-NLS-1$
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -415,5 +415,15 @@ public class SystemTeamViewProfileAdapter
|
|||
{
|
||||
return ISystemMementoConstants.MEMENTO_KEY_PROFILE;
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
|
@ -305,4 +305,13 @@ public class SystemTeamViewSubSystemConfigurationAdapter
|
|||
return factory.getProfile().getName() + "." + factory.getParentCategory().getLabel() + "." + factory.getLabel(); //$NON-NLS-1$ //$NON-NLS-2$
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1357,6 +1357,16 @@ public abstract class AbstractSystemViewAdapter implements ISystemViewElementAda
|
|||
{
|
||||
return (element instanceof ISystemPromptableObject);
|
||||
}
|
||||
|
||||
/**
|
||||
* <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
|
||||
* Return true if this object is remote. In this case, the default is true.
|
||||
*/
|
||||
public boolean isRemote(Object element)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* <i><b>Overridable</b> by subclasses, but usually is not.</i><br>
|
||||
* Selection has changed in the Remote Systems view. Empty by default, but override if you need
|
||||
|
|
|
@ -320,4 +320,14 @@ public class TestSubSystemNodeAdapter extends AbstractSystemViewAdapter
|
|||
public boolean showRename(Object element) {
|
||||
return isTestSubSystemNode(element);
|
||||
}
|
||||
|
||||
/**
|
||||
* This is a local RSE artifact so returning false
|
||||
*
|
||||
* @param element the object to check
|
||||
* @return false since this is not remote
|
||||
*/
|
||||
public boolean isRemote(Object element) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue