|
Lines 22-31
Link Here
|
| 22 |
import java.io.IOException; |
22 |
import java.io.IOException; |
| 23 |
import java.io.InputStreamReader; |
23 |
import java.io.InputStreamReader; |
| 24 |
import java.io.OutputStreamWriter; |
24 |
import java.io.OutputStreamWriter; |
| 25 |
import java.util.HashMap; |
|
|
| 26 |
import java.util.Iterator; |
| 27 |
import java.util.Map; |
| 28 |
import java.util.Map.Entry; |
| 29 |
|
25 |
|
| 30 |
import org.eclipse.core.runtime.IProgressMonitor; |
26 |
import org.eclipse.core.runtime.IProgressMonitor; |
| 31 |
import org.eclipse.core.runtime.IStatus; |
27 |
import org.eclipse.core.runtime.IStatus; |
|
Lines 267-273
Link Here
|
| 267 |
*/ |
263 |
*/ |
| 268 |
private static final int[] DEFAULT_SASH_WEIGHTS = {13, 6}; |
264 |
private static final int[] DEFAULT_SASH_WEIGHTS = {13, 6}; |
| 269 |
private int[] fLastSashWeights; |
265 |
private int[] fLastSashWeights; |
| 270 |
private Map fPaneWeights = new HashMap(); |
|
|
| 271 |
private boolean fToggledDetailOnce; |
266 |
private boolean fToggledDetailOnce; |
| 272 |
private String fCurrentDetailPaneOrientation = IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN; |
267 |
private String fCurrentDetailPaneOrientation = IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_HIDDEN; |
| 273 |
private ToggleDetailPaneAction[] fToggleDetailPaneActions; |
268 |
private ToggleDetailPaneAction[] fToggleDetailPaneActions; |
|
Lines 541-559
Link Here
|
| 541 |
if (weights != null) { |
536 |
if (weights != null) { |
| 542 |
setLastSashWeights(weights); |
537 |
setLastSashWeights(weights); |
| 543 |
} |
538 |
} |
| 544 |
IMemento[] children = mem.getChildren(DETAIL_PANE_TYPE); |
|
|
| 545 |
if (children != null && children.length > 0) { |
| 546 |
for (int i = 0; i < children.length; i++) { |
| 547 |
IMemento child = children[i]; |
| 548 |
String id = child.getString(IMemento.TAG_ID); |
| 549 |
if (id != null) { |
| 550 |
weights = getWeights(child); |
| 551 |
if (weights != null) { |
| 552 |
fPaneWeights.put(id, weights); |
| 553 |
} |
| 554 |
} |
| 555 |
} |
| 556 |
} |
| 557 |
} |
539 |
} |
| 558 |
site.getWorkbenchWindow().addPerspectiveListener(this); |
540 |
site.getWorkbenchWindow().addPerspectiveListener(this); |
| 559 |
} |
541 |
} |
|
Lines 618-632
Link Here
|
| 618 |
memento.putInteger(SASH_VIEW_PART, weights[0]); |
600 |
memento.putInteger(SASH_VIEW_PART, weights[0]); |
| 619 |
memento.putInteger(SASH_DETAILS_PART, weights[1]); |
601 |
memento.putInteger(SASH_DETAILS_PART, weights[1]); |
| 620 |
} |
602 |
} |
| 621 |
Iterator iterator = fPaneWeights.entrySet().iterator(); |
|
|
| 622 |
while (iterator.hasNext()) { |
| 623 |
Entry entry = (Entry) iterator.next(); |
| 624 |
String paneId = (String) entry.getKey(); |
| 625 |
int[] weights = (int[]) entry.getValue(); |
| 626 |
IMemento child = memento.createChild(DETAIL_PANE_TYPE, paneId); |
| 627 |
child.putInteger(SASH_VIEW_PART, weights[0]); |
| 628 |
child.putInteger(SASH_DETAILS_PART, weights[1]); |
| 629 |
} |
| 630 |
getVariablesViewer().saveState(memento); |
603 |
getVariablesViewer().saveState(memento); |
| 631 |
} |
604 |
} |
| 632 |
|
605 |
|
|
Lines 991-997
Link Here
|
| 991 |
public void refreshDetailPaneContents() { |
964 |
public void refreshDetailPaneContents() { |
| 992 |
String currentPaneID = getCurrentPaneID(); |
965 |
String currentPaneID = getCurrentPaneID(); |
| 993 |
if (currentPaneID != null) { |
966 |
if (currentPaneID != null) { |
| 994 |
fPaneWeights.put(currentPaneID, fSashForm.getWeights()); |
967 |
fLastSashWeights = fSashForm.getWeights(); |
| 995 |
} |
968 |
} |
| 996 |
fDetailPane.display(getCurrentSelection()); |
969 |
fDetailPane.display(getCurrentSelection()); |
| 997 |
} |
970 |
} |
|
Lines 1009-1017
Link Here
|
| 1009 |
} |
982 |
} |
| 1010 |
fDetailPane.getCurrentControl().addListener(SWT.Activate, fDetailPaneActivatedListener); |
983 |
fDetailPane.getCurrentControl().addListener(SWT.Activate, fDetailPaneActivatedListener); |
| 1011 |
if (newPaneID != null) { |
984 |
if (newPaneID != null) { |
| 1012 |
int[] weights = (int[])fPaneWeights.get(newPaneID); |
985 |
if (fLastSashWeights != null) { |
| 1013 |
if (weights != null) { |
986 |
fSashForm.setWeights(fLastSashWeights); |
| 1014 |
fSashForm.setWeights(weights); |
|
|
| 1015 |
} |
987 |
} |
| 1016 |
} |
988 |
} |
| 1017 |
} |
989 |
} |
|
Lines 1200-1206
Link Here
|
| 1200 |
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) { |
1172 |
public void perspectiveChanged(IWorkbenchPage page, IPerspectiveDescriptor perspective, String changeId) { |
| 1201 |
if(changeId.equals(IWorkbenchPage.CHANGE_RESET)) { |
1173 |
if(changeId.equals(IWorkbenchPage.CHANGE_RESET)) { |
| 1202 |
setLastSashWeights(DEFAULT_SASH_WEIGHTS); |
1174 |
setLastSashWeights(DEFAULT_SASH_WEIGHTS); |
| 1203 |
fPaneWeights.clear(); |
|
|
| 1204 |
fSashForm.setWeights(DEFAULT_SASH_WEIGHTS); |
1175 |
fSashForm.setWeights(DEFAULT_SASH_WEIGHTS); |
| 1205 |
fDetailPane.display(new StructuredSelection(new Object[]{this})); // bogus selection to force detail pane / sash reset |
1176 |
fDetailPane.display(new StructuredSelection(new Object[]{this})); // bogus selection to force detail pane / sash reset |
| 1206 |
fSashForm.layout(true); |
1177 |
fSashForm.layout(true); |