1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-14 12:35:22 +02:00

[175294] don't show properties for output objects

This commit is contained in:
David McKnight 2007-05-30 14:47:51 +00:00
parent 3c379dc2e5
commit 1d223fc9e5
2 changed files with 57 additions and 16 deletions

View file

@ -981,6 +981,7 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter
{ {
return false; return false;
} }
/** /**
* Return true if this object is renamable by the user. If so, when selected, * Return true if this object is renamable by the user. If so, when selected,
* the Rename popup menu item will be enabled. * the Rename popup menu item will be enabled.
@ -1248,4 +1249,13 @@ implements ISystemViewElementAdapter, ISystemRemoteElementAdapter
public boolean supportsUserDefinedActions(Object object) { public boolean supportsUserDefinedActions(Object object) {
return false; return false;
} }
/**
* Don't show properties for remote output
*/
public boolean showProperties(Object element){
return false;
}
} }

View file

@ -94,7 +94,6 @@ import org.eclipse.rse.ui.model.ISystemShellProvider;
import org.eclipse.swt.SWT; import org.eclipse.swt.SWT;
import org.eclipse.swt.dnd.DND; import org.eclipse.swt.dnd.DND;
import org.eclipse.swt.dnd.FileTransfer; import org.eclipse.swt.dnd.FileTransfer;
import org.eclipse.swt.dnd.TextTransfer;
import org.eclipse.swt.dnd.Transfer; import org.eclipse.swt.dnd.Transfer;
import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyAdapter;
import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.KeyEvent;
@ -267,9 +266,11 @@ public class SystemTableView
protected boolean _selectionShowOpenViewActions; protected boolean _selectionShowOpenViewActions;
protected boolean _selectionShowDeleteAction; protected boolean _selectionShowDeleteAction;
protected boolean _selectionShowRenameAction; protected boolean _selectionShowRenameAction;
protected boolean _selectionShowPropertiesAction;
protected boolean _selectionEnableDeleteAction; protected boolean _selectionEnableDeleteAction;
protected boolean _selectionEnableRenameAction; protected boolean _selectionEnableRenameAction;
protected boolean _selectionIsRemoteObject = true; protected boolean _selectionIsRemoteObject = true;
protected boolean _selectionFlagsUpdated = false; protected boolean _selectionFlagsUpdated = false;
@ -814,15 +815,29 @@ public class SystemTableView
_lastWidths = widths; _lastWidths = widths;
} }
protected void initDragAndDrop() /**
{ * Initialize drag and drop support for this view.
int ops = DND.DROP_COPY | DND.DROP_MOVE; *
Transfer[] dragtransfers = new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance(), FileTransfer.getInstance(), EditorInputTransfer.getInstance()}; */
Transfer[] droptransfers = new Transfer[] { PluginTransfer.getInstance(), TextTransfer.getInstance(), FileTransfer.getInstance(), EditorInputTransfer.getInstance()}; protected void initDragAndDrop()
{
addDragSupport(ops, dragtransfers, new SystemViewDataDragAdapter((ISelectionProvider) this)); int ops = DND.DROP_COPY | DND.DROP_MOVE;
addDropSupport(ops | DND.DROP_DEFAULT, droptransfers, new SystemViewDataDropAdapter(this)); Transfer[] dragtransfers = new Transfer[]
} { PluginTransfer.getInstance(),
FileTransfer.getInstance(),
EditorInputTransfer.getInstance()
};
Transfer[] droptransfers = new Transfer[]
{ PluginTransfer.getInstance(),
FileTransfer.getInstance(),
EditorInputTransfer.getInstance()
};
addDragSupport(ops | DND.DROP_DEFAULT, dragtransfers, new SystemViewDataDragAdapter(this));
addDropSupport(ops | DND.DROP_DEFAULT, droptransfers, new SystemViewDataDropAdapter(this));
}
/** /**
* Used to asynchronously update the view whenever properties change. * Used to asynchronously update the view whenever properties change.
* @see org.eclipse.rse.core.events.ISystemResourceChangeListener#systemResourceChanged(org.eclipse.rse.core.events.ISystemResourceChangeEvent) * @see org.eclipse.rse.core.events.ISystemResourceChangeListener#systemResourceChanged(org.eclipse.rse.core.events.ISystemResourceChangeEvent)
@ -1469,10 +1484,20 @@ public class SystemTableView
return ok; return ok;
} }
/**
* Decides whether to even show the properties menu item.
* Assumes scanSelections() has already been called
*/
protected boolean showProperties() {
return _selectionShowPropertiesAction;
}
// --------------------------- // ---------------------------
// ISYSTEMRENAMETARGET METHODS // ISYSTEMRENAMETARGET METHODS
// --------------------------- // ---------------------------
/** /**
* Required method from ISystemRenameTarget. * Required method from ISystemRenameTarget.
* Decides whether to even show the rename menu item. * Decides whether to even show the rename menu item.
@ -1734,13 +1759,15 @@ public class SystemTableView
// registered propertyPages extension points registered for the selected object's class type. // registered propertyPages extension points registered for the selected object's class type.
//propertyDialogAction.selectionChanged(selection); //propertyDialogAction.selectionChanged(selection);
if (showProperties())
PropertyDialogAction pdAction = getPropertyDialogAction();
if (pdAction.isApplicableForSelection())
{ {
PropertyDialogAction pdAction = getPropertyDialogAction();
menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction); if (pdAction.isApplicableForSelection())
{
menu.appendToGroup(ISystemContextMenuConstants.GROUP_PROPERTIES, pdAction);
}
} }
// OPEN IN NEW PERSPECTIVE ACTION... if (fromSystemViewPart && showOpenViewActions()) // OPEN IN NEW PERSPECTIVE ACTION... if (fromSystemViewPart && showOpenViewActions())
if (!_selectionIsRemoteObject) if (!_selectionIsRemoteObject)
{ {
@ -1776,6 +1803,7 @@ public class SystemTableView
_selectionShowOpenViewActions = true; _selectionShowOpenViewActions = true;
_selectionShowDeleteAction = true; _selectionShowDeleteAction = true;
_selectionShowRenameAction = true; _selectionShowRenameAction = true;
_selectionShowPropertiesAction = true;
_selectionEnableDeleteAction = true; _selectionEnableDeleteAction = true;
_selectionEnableRenameAction = true; _selectionEnableRenameAction = true;
_selectionIsRemoteObject = true; _selectionIsRemoteObject = true;
@ -1799,6 +1827,9 @@ public class SystemTableView
if (_selectionShowRenameAction) if (_selectionShowRenameAction)
_selectionShowRenameAction = adapter.showRename(element); _selectionShowRenameAction = adapter.showRename(element);
if (_selectionShowPropertiesAction)
_selectionShowPropertiesAction = adapter.showProperties(element);
if (_selectionEnableDeleteAction) if (_selectionEnableDeleteAction)
_selectionEnableDeleteAction = _selectionShowDeleteAction && adapter.canDelete(element); _selectionEnableDeleteAction = _selectionShowDeleteAction && adapter.canDelete(element);
@ -1808,7 +1839,7 @@ public class SystemTableView
_selectionEnableRenameAction = _selectionShowRenameAction && adapter.canRename(element); _selectionEnableRenameAction = _selectionShowRenameAction && adapter.canRename(element);
if (_selectionIsRemoteObject) if (_selectionIsRemoteObject)
_selectionIsRemoteObject = (getRemoteAdapter(element) != null); _selectionIsRemoteObject = adapter.isRemote(element);
} }
} }