Lines 24-29
import java.io.ByteArrayOutputStream;
Link Here
|
24 |
import java.io.IOException; |
24 |
import java.io.IOException; |
25 |
import java.io.InputStreamReader; |
25 |
import java.io.InputStreamReader; |
26 |
import java.io.OutputStreamWriter; |
26 |
import java.io.OutputStreamWriter; |
|
|
27 |
import java.util.HashMap; |
28 |
import java.util.Iterator; |
29 |
import java.util.Map; |
27 |
|
30 |
|
28 |
import org.eclipse.core.runtime.IProgressMonitor; |
31 |
import org.eclipse.core.runtime.IProgressMonitor; |
29 |
import org.eclipse.core.runtime.IStatus; |
32 |
import org.eclipse.core.runtime.IStatus; |
Lines 31-36
import org.eclipse.core.runtime.ListenerList;
Link Here
|
31 |
import org.eclipse.core.runtime.Status; |
34 |
import org.eclipse.core.runtime.Status; |
32 |
import org.eclipse.core.runtime.jobs.Job; |
35 |
import org.eclipse.core.runtime.jobs.Job; |
33 |
import org.eclipse.debug.core.DebugException; |
36 |
import org.eclipse.debug.core.DebugException; |
|
|
37 |
import org.eclipse.debug.core.DebugPlugin; |
34 |
import org.eclipse.debug.internal.ui.DebugUIPlugin; |
38 |
import org.eclipse.debug.internal.ui.DebugUIPlugin; |
35 |
import org.eclipse.debug.internal.ui.DelegatingModelPresentation; |
39 |
import org.eclipse.debug.internal.ui.DelegatingModelPresentation; |
36 |
import org.eclipse.debug.internal.ui.IDebugHelpContextIds; |
40 |
import org.eclipse.debug.internal.ui.IDebugHelpContextIds; |
Lines 49-54
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDelta;
Link Here
|
49 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor; |
53 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelDeltaVisitor; |
50 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy; |
54 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IModelProxy; |
51 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; |
55 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IPresentationContext; |
|
|
56 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewActionProvider; |
52 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputRequestor; |
57 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputRequestor; |
53 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate; |
58 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerInputUpdate; |
54 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; |
59 |
import org.eclipse.debug.internal.ui.viewers.model.provisional.IViewerUpdate; |
Lines 284-289
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
284 |
*/ |
289 |
*/ |
285 |
private ViewerInputService fInputService; |
290 |
private ViewerInputService fInputService; |
286 |
|
291 |
|
|
|
292 |
private Map fGlobalActionMap = new HashMap(); |
293 |
|
287 |
/** |
294 |
/** |
288 |
* Viewer input requester used to update the viewer once the viewer input has been |
295 |
* Viewer input requester used to update the viewer once the viewer input has been |
289 |
* resolved. |
296 |
* resolved. |
Lines 333-359
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
333 |
* Sash weights for a specific detail pane type |
340 |
* Sash weights for a specific detail pane type |
334 |
*/ |
341 |
*/ |
335 |
protected static final String DETAIL_PANE_TYPE = "DETAIL_PANE_TYPE"; //$NON-NLS-1$ |
342 |
protected static final String DETAIL_PANE_TYPE = "DETAIL_PANE_TYPE"; //$NON-NLS-1$ |
336 |
|
343 |
|
337 |
/** |
|
|
338 |
* Key for "Find..." action. |
339 |
*/ |
340 |
protected static final String VARIABLES_FIND_ELEMENT_ACTION = FIND_ACTION + ".Variables"; //$NON-NLS-1$ |
341 |
|
342 |
/** |
343 |
* Key for "Select All" action. |
344 |
*/ |
345 |
protected static final String VARIABLES_SELECT_ALL_ACTION = SELECT_ALL_ACTION + ".Variables"; //$NON-NLS-1$ |
346 |
|
347 |
/** |
348 |
* Key for "Copy" action. |
349 |
*/ |
350 |
protected static final String VARIABLES_COPY_ACTION = COPY_ACTION + ".Variables"; //$NON-NLS-1$ |
351 |
|
352 |
/** |
353 |
* Key for "Paste" action. |
354 |
*/ |
355 |
protected static final String VARIABLES_PASTE_ACTION = PASTE_ACTION + ".Variables"; //$NON-NLS-1$ |
356 |
|
357 |
/** |
344 |
/** |
358 |
* Visits deltas to determine if details should be displayed |
345 |
* Visits deltas to determine if details should be displayed |
359 |
*/ |
346 |
*/ |
Lines 449-455
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
449 |
*/ |
436 |
*/ |
450 |
protected void viewerInputUpdateComplete(IViewerInputUpdate update) { |
437 |
protected void viewerInputUpdateComplete(IViewerInputUpdate update) { |
451 |
setViewerInput(update.getInputElement()); |
438 |
setViewerInput(update.getInputElement()); |
452 |
updateAction(VARIABLES_FIND_ELEMENT_ACTION); |
|
|
453 |
updateAction(FIND_ACTION); |
439 |
updateAction(FIND_ACTION); |
454 |
} |
440 |
} |
455 |
|
441 |
|
Lines 657-663
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
657 |
protected String getDetailPanePreferenceKey() { |
643 |
protected String getDetailPanePreferenceKey() { |
658 |
return IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION; |
644 |
return IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION; |
659 |
} |
645 |
} |
660 |
|
646 |
|
661 |
/** |
647 |
/** |
662 |
* Create and return the main tree viewer that displays variable. |
648 |
* Create and return the main tree viewer that displays variable. |
663 |
*/ |
649 |
*/ |
Lines 671-681
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
671 |
public void focusGained(FocusEvent e) { |
657 |
public void focusGained(FocusEvent e) { |
672 |
fTreeHasFocus = true; |
658 |
fTreeHasFocus = true; |
673 |
fSelectionProvider.setActiveProvider(variablesViewer); |
659 |
fSelectionProvider.setActiveProvider(variablesViewer); |
674 |
setAction(SELECT_ALL_ACTION, getAction(VARIABLES_SELECT_ALL_ACTION)); |
660 |
setGlobalActions(); |
675 |
setAction(COPY_ACTION, getAction(VARIABLES_COPY_ACTION)); |
|
|
676 |
setAction(PASTE_ACTION, getAction(VARIABLES_PASTE_ACTION)); |
677 |
setAction(FIND_ACTION, getAction(VARIABLES_FIND_ELEMENT_ACTION)); |
678 |
getViewSite().getActionBars().updateActionBars(); |
679 |
} |
661 |
} |
680 |
|
662 |
|
681 |
public void focusLost(FocusEvent e){ |
663 |
public void focusLost(FocusEvent e){ |
Lines 683-692
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
683 |
// This should allow toolbar actions to remain active when the view |
665 |
// This should allow toolbar actions to remain active when the view |
684 |
// is de-activated but still visible. |
666 |
// is de-activated but still visible. |
685 |
// Bug 316850. |
667 |
// Bug 316850. |
686 |
setAction(SELECT_ALL_ACTION, null); |
668 |
clearGlobalActions(); |
687 |
setAction(COPY_ACTION,null); |
|
|
688 |
setAction(FIND_ACTION, null); |
689 |
setAction(PASTE_ACTION, null); |
690 |
getViewSite().getActionBars().updateActionBars(); |
669 |
getViewSite().getActionBars().updateActionBars(); |
691 |
} |
670 |
} |
692 |
}); |
671 |
}); |
Lines 708-715
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
708 |
return variablesViewer; |
687 |
return variablesViewer; |
709 |
} |
688 |
} |
710 |
|
689 |
|
711 |
|
690 |
private void setGlobalActions() { |
712 |
|
691 |
for (Iterator entryItr = fGlobalActionMap.entrySet().iterator(); entryItr.hasNext();) { |
|
|
692 |
Map.Entry entry = (Map.Entry)entryItr.next(); |
693 |
setAction((String)entry.getKey(), (IAction)entry.getValue()); |
694 |
} |
695 |
getViewSite().getActionBars().updateActionBars(); |
696 |
} |
697 |
|
698 |
private void clearGlobalActions() { |
699 |
for (Iterator keyItr = fGlobalActionMap.keySet().iterator(); keyItr.hasNext();) { |
700 |
String id = (String)keyItr.next(); |
701 |
setAction((String)keyItr.next(), null); |
702 |
|
703 |
} |
704 |
getViewSite().getActionBars().updateActionBars(); |
705 |
} |
706 |
|
713 |
/** |
707 |
/** |
714 |
* Returns the active debug context for this view based on the view's |
708 |
* Returns the active debug context for this view based on the view's |
715 |
* site IDs. |
709 |
* site IDs. |
Lines 929-936
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
929 |
setAction("ChangeVariableValue", action); //$NON-NLS-1$ |
923 |
setAction("ChangeVariableValue", action); //$NON-NLS-1$ |
930 |
|
924 |
|
931 |
action= new VirtualFindAction(getVariablesViewer()); |
925 |
action= new VirtualFindAction(getVariablesViewer()); |
932 |
setAction(VARIABLES_FIND_ELEMENT_ACTION, action); |
926 |
fGlobalActionMap.put(FIND_ACTION, action); |
933 |
} |
927 |
} |
|
|
928 |
|
929 |
public IAction getAction(String actionID) { |
930 |
Viewer viewer = getViewer(); |
931 |
if (viewer != null) { |
932 |
IViewActionProvider actionProvider = (IViewActionProvider) DebugPlugin.getAdapter( |
933 |
viewer.getInput(), IViewActionProvider.class); |
934 |
if (actionProvider != null) { |
935 |
IAction action = actionProvider.getAction(getPresentationContext(), actionID); |
936 |
if (action != null) { |
937 |
return action; |
938 |
} |
939 |
} |
940 |
} |
941 |
return super.getAction(actionID); |
942 |
} |
943 |
|
944 |
public void updateObjects() { |
945 |
super.updateObjects(); |
946 |
IViewActionProvider actionProvider = (IViewActionProvider) DebugPlugin.getAdapter( |
947 |
getViewer().getInput(), IViewActionProvider.class); |
948 |
if (actionProvider != null) { |
949 |
IUpdate[] inputUpdatables = actionProvider.getUpdatables(fPresentationContext); |
950 |
for (int i = 0; i < inputUpdatables.length; i++) { |
951 |
inputUpdatables[i].update(); |
952 |
} |
953 |
} |
954 |
if (fTreeHasFocus) { |
955 |
setGlobalActions(); |
956 |
getViewSite().getActionBars().updateActionBars(); |
957 |
} |
958 |
} |
934 |
|
959 |
|
935 |
/* (non-Javadoc) |
960 |
/* (non-Javadoc) |
936 |
* |
961 |
* |
Lines 940-947
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
940 |
*/ |
965 |
*/ |
941 |
protected void createContextMenu(Control menuControl) { |
966 |
protected void createContextMenu(Control menuControl) { |
942 |
super.createContextMenu(menuControl); |
967 |
super.createContextMenu(menuControl); |
943 |
setAction(VARIABLES_COPY_ACTION, getAction(COPY_ACTION)); |
968 |
fGlobalActionMap.put(COPY_ACTION, getAction(COPY_ACTION)); |
944 |
setAction(VARIABLES_PASTE_ACTION, getAction(PASTE_ACTION)); |
969 |
fGlobalActionMap.put(PASTE_ACTION, getAction(PASTE_ACTION)); |
945 |
} |
970 |
} |
946 |
|
971 |
|
947 |
/** |
972 |
/** |
Lines 1020-1029
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
1020 |
* @param menu The menu to add the item to. |
1045 |
* @param menu The menu to add the item to. |
1021 |
*/ |
1046 |
*/ |
1022 |
protected void fillContextMenu(IMenuManager menu) { |
1047 |
protected void fillContextMenu(IMenuManager menu) { |
1023 |
|
|
|
1024 |
menu.add(new Separator(IDebugUIConstants.EMPTY_VARIABLE_GROUP)); |
1048 |
menu.add(new Separator(IDebugUIConstants.EMPTY_VARIABLE_GROUP)); |
1025 |
menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP)); |
1049 |
menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP)); |
1026 |
menu.add(getAction(VARIABLES_FIND_ELEMENT_ACTION)); |
1050 |
menu.add(getAction(FIND_ACTION)); |
1027 |
ChangeVariableValueAction changeValueAction = (ChangeVariableValueAction)getAction("ChangeVariableValue"); //$NON-NLS-1$ |
1051 |
ChangeVariableValueAction changeValueAction = (ChangeVariableValueAction)getAction("ChangeVariableValue"); //$NON-NLS-1$ |
1028 |
if (changeValueAction.isApplicable()) { |
1052 |
if (changeValueAction.isApplicable()) { |
1029 |
menu.add(changeValueAction); |
1053 |
menu.add(changeValueAction); |
Lines 1181-1187
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
1181 |
* @param actionId the ID of the action to update |
1205 |
* @param actionId the ID of the action to update |
1182 |
*/ |
1206 |
*/ |
1183 |
protected void updateAction(String actionId) { |
1207 |
protected void updateAction(String actionId) { |
1184 |
IAction action= getAction(actionId); |
1208 |
IAction action = (IAction)fGlobalActionMap.get(actionId); |
|
|
1209 |
if (action == null) { |
1210 |
action= getAction(actionId); |
1211 |
} |
1185 |
if (action instanceof IUpdate) { |
1212 |
if (action instanceof IUpdate) { |
1186 |
((IUpdate) action).update(); |
1213 |
((IUpdate) action).update(); |
1187 |
} |
1214 |
} |
Lines 1365-1371
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
1365 |
fVisitor.reset(); |
1392 |
fVisitor.reset(); |
1366 |
delta.accept(fVisitor); |
1393 |
delta.accept(fVisitor); |
1367 |
|
1394 |
|
1368 |
updateAction(VARIABLES_FIND_ELEMENT_ACTION); |
1395 |
updateAction(FIND_ACTION); |
1369 |
updateAction("CollapseAll"); |
1396 |
updateAction("CollapseAll"); |
1370 |
} |
1397 |
} |
1371 |
|
1398 |
|
Lines 1381-1387
public class VariablesView extends AbstractDebugView implements IDebugContextLis
Link Here
|
1381 |
showViewer(); |
1408 |
showViewer(); |
1382 |
} |
1409 |
} |
1383 |
if (TreePath.EMPTY.equals(update.getElementPath())) { |
1410 |
if (TreePath.EMPTY.equals(update.getElementPath())) { |
1384 |
updateAction(VARIABLES_FIND_ELEMENT_ACTION); |
1411 |
updateAction(FIND_ACTION); |
1385 |
updateAction("CollapseAll"); |
1412 |
updateAction("CollapseAll"); |
1386 |
} |
1413 |
} |
1387 |
} |
1414 |
} |
1388 |
- |
|
|