Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2020-03-12 01:37:21 +0000
committerEugene Tarassov2020-03-12 01:37:21 +0000
commit39eb05c0ffbfd62bff27703d4acc59f7dc1a128a (patch)
tree1e4cf361fff6427a2be2df67742d2deda9ed192c /plugins
parent46c2ebd59b94a231185a7eda9fe8d3893d1fdeb3 (diff)
downloadorg.eclipse.tcf-39eb05c0ffbfd62bff27703d4acc59f7dc1a128a.tar.gz
org.eclipse.tcf-39eb05c0ffbfd62bff27703d4acc59f7dc1a128a.tar.xz
org.eclipse.tcf-39eb05c0ffbfd62bff27703d4acc59f7dc1a128a.zip
TCF Debugger: added code to save/restore column widths in table viewers
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/launch/RemoteCMainTab.java9
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapDialog.java19
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java78
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/SignalsDialog.java19
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/ContextSelectionDialog.java29
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java59
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java9
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFPathMapTab.java72
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFTargetTab.java8
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/WizardLoginPage.java4
10 files changed, 183 insertions, 123 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/launch/RemoteCMainTab.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/launch/RemoteCMainTab.java
index 2193c84ef..25f9631e0 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/launch/RemoteCMainTab.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/launch/RemoteCMainTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -16,6 +16,7 @@ import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.viewers.ISelection;
@@ -36,6 +37,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.tcf.internal.cdt.ui.Activator;
import org.eclipse.tcf.internal.debug.launch.TCFLaunchDelegate;
import org.eclipse.tcf.internal.debug.ui.launch.PeerListControl;
import org.eclipse.tcf.internal.debug.ui.launch.PeerListControl.PeerInfo;
@@ -46,6 +48,7 @@ import org.eclipse.tcf.services.IFileSystem;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.util.TCFTask;
import org.eclipse.ui.PlatformUI;
+import org.osgi.service.prefs.Preferences;
public class RemoteCMainTab extends CMainTab implements IShellProvider {
@@ -107,7 +110,9 @@ public class RemoteCMainTab extends CMainTab implements IShellProvider {
private void createPeerListGroup(Composite comp) {
new Label(comp, SWT.NONE).setText("Targets:");
- fPeerList = new PeerListControl(comp);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ prefs = prefs.node(RemoteCMainTab.class.getCanonicalName());
+ fPeerList = new PeerListControl(comp, prefs);
fPeerList.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
handlePeerSelectionChanged();
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapDialog.java
index eeca9b1d2..77799af76 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2010-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,19 +10,23 @@
*******************************************************************************/
package org.eclipse.tcf.internal.debug.ui.commands;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.MessageBox;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.tcf.internal.debug.ui.Activator;
import org.eclipse.tcf.internal.debug.ui.ImageCache;
import org.eclipse.tcf.internal.debug.ui.model.TCFModel;
import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
+import org.osgi.service.prefs.Preferences;
class MemoryMapDialog extends Dialog {
@@ -39,6 +43,15 @@ class MemoryMapDialog extends Dialog {
}
@Override
+ protected IDialogSettings getDialogBoundsSettings() {
+ String key = MemoryMapDialog.class.getCanonicalName();
+ IDialogSettings settings = Activator.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(key);
+ if (section != null) return section;
+ return settings.addNewSection(key);
+ }
+
+ @Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText("Symbol Files");
@@ -55,7 +68,9 @@ class MemoryMapDialog extends Dialog {
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite)super.createDialogArea(parent);
- widget = new MemoryMapWidget(composite, node);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ prefs = prefs.node(MemoryMapDialog.class.getCanonicalName());
+ widget = new MemoryMapWidget(composite, node, prefs);
widget.loadData(cfg);
if (ok_button != null) ok_button.setEnabled(widget.getMemoryMapID() != null);
composite.setSize(composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java
index bb2d9e496..878aaa3a9 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2014, 2015 Wind River Systems, Inc. and others. All rights reserved.
+ * Copyright (c) 2014-2020 Wind River Systems, Inc. and others. All rights reserved.
* This program and the accompanying materials are made available under the terms
* of the Eclipse Public License 2.0 which accompanies this distribution, and is
* available at https://www.eclipse.org/legal/epl-2.0/
@@ -95,10 +95,14 @@ import org.eclipse.tcf.util.TCFDataCache;
import org.eclipse.tcf.util.TCFTask;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
public class MemoryMapWidget {
- private static final int SIZING_TABLE_WIDTH = 500, SIZING_TABLE_HEIGHT = 300;
+ private static final int TABLE_WIDTH = 800;
+ private static final int TABLE_HEIGHT = 300;
+ private static final int[] COL_WIDTH = { 300, 100, 80, 50, 140, 140 };
private static final String PROP_CHILDREN = "_CHILDREN";
private static final String[] column_names = {
@@ -111,6 +115,7 @@ public class MemoryMapWidget {
};
private final Display display;
+ private final Preferences prefs;
private TCFModel model;
private IChannel channel;
@@ -332,8 +337,9 @@ public class MemoryMapWidget {
}
};
- public MemoryMapWidget(Composite composite, TCFNode node) {
+ public MemoryMapWidget(Composite composite, TCFNode node, Preferences prefs) {
display = composite.getDisplay();
+ this.prefs = prefs;
setTCFNode(node);
createContextText(composite);
createMemoryMapTable(composite);
@@ -341,6 +347,10 @@ public class MemoryMapWidget {
color_error = new Color(display, ColorCache.rgb_error);
}
+ public MemoryMapWidget(Composite composite, TCFNode node) {
+ this(composite, node, null);
+ }
+
/**
* Dispose the widget and cleanup the created resources and listeners.
*/
@@ -348,6 +358,19 @@ public class MemoryMapWidget {
if (disposed) return;
disposed = true;
+ if (prefs != null) {
+ for (int i = 0; i < COL_WIDTH.length; i++) {
+ TreeColumn col = map_table.getColumn(i);
+ prefs.putInt("w" + i, col.getWidth());
+ }
+ try {
+ prefs.flush();
+ }
+ catch (BackingStoreException x) {
+ Activator.log(x);
+ }
+ }
+
if (color_error != null) {
color_error.dispose();
color_error = null;
@@ -494,47 +517,20 @@ public class MemoryMapWidget {
protected void configureTable(final Tree table) {
GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = SIZING_TABLE_WIDTH;
- data.heightHint = SIZING_TABLE_HEIGHT;
+ data.widthHint = TABLE_WIDTH;
+ data.heightHint = TABLE_HEIGHT;
table.setLayoutData(data);
- final TreeColumn col_file = new TreeColumn(table, 0);
- col_file.setResizable(true);
- col_file.setAlignment(SWT.LEFT);
- col_file.setText(getColumnText(0));
-
- final TreeColumn col_addr = new TreeColumn(table, 1);
- col_addr.setResizable(true);
- col_addr.setAlignment(SWT.LEFT);
- col_addr.setText(getColumnText(1));
-
- final TreeColumn col_size = new TreeColumn(table, 2);
- col_size.setResizable(true);
- col_size.setAlignment(SWT.LEFT);
- col_size.setText(getColumnText(2));
-
- final TreeColumn col_flags = new TreeColumn(table, 3);
- col_flags.setResizable(true);
- col_flags.setAlignment(SWT.LEFT);
- col_flags.setText(getColumnText(3));
-
- final TreeColumn col_offset = new TreeColumn(table, 4);
- col_offset.setResizable(true);
- col_offset.setAlignment(SWT.LEFT);
- col_offset.setText(getColumnText(4));
-
- final TreeColumn col_context = new TreeColumn(table, 5);
- col_context.setResizable(true);
- col_context.setAlignment(SWT.LEFT);
- col_context.setText(getColumnText(5));
-
TableLayout layout = new TableLayout();
- layout.addColumnData(new ColumnPixelData(300));
- layout.addColumnData(new ColumnPixelData(100));
- layout.addColumnData(new ColumnPixelData(80));
- layout.addColumnData(new ColumnPixelData(50));
- layout.addColumnData(new ColumnPixelData(140));
- layout.addColumnData(new ColumnPixelData(140));
+ for (int i = 0; i < COL_WIDTH.length; i++) {
+ TreeColumn col = new TreeColumn(table, i);
+ col.setResizable(true);
+ col.setAlignment(SWT.LEFT);
+ col.setText(getColumnText(i));
+ int w = COL_WIDTH[i];
+ if (prefs != null) w = prefs.getInt("w" + i, w);
+ layout.addColumnData(new ColumnPixelData(w));
+ }
// "Symbol File Errors" are displayed as tooltip on the table item.
// See
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/SignalsDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/SignalsDialog.java
index 01ee40f9b..d1a0fea90 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/SignalsDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/SignalsDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2016 Wind River Systems, Inc. and others.
+ * Copyright (c) 2009-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ import java.util.LinkedList;
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jface.dialogs.Dialog;
@@ -55,11 +56,10 @@ import org.eclipse.tcf.protocol.IToken;
import org.eclipse.tcf.services.IProcesses;
import org.eclipse.tcf.util.TCFDataCache;
import org.eclipse.tcf.util.TCFTask;
+import org.osgi.service.prefs.Preferences;
class SignalsDialog extends Dialog {
- private static final String SETTINGS_SECTION = SignalsDialog.class.getCanonicalName();
-
private static final int
SIZING_TABLE_WIDTH = 800,
SIZING_TABLE_HEIGHT = 300;
@@ -179,10 +179,11 @@ class SignalsDialog extends Dialog {
@Override
protected IDialogSettings getDialogBoundsSettings() {
+ String key = SignalsDialog.class.getCanonicalName();
IDialogSettings settings = Activator.getDefault().getDialogSettings();
- IDialogSettings section = settings.getSection(SETTINGS_SECTION);
+ IDialogSettings section = settings.getSection(key);
if (section != null) return section;
- return settings.addNewSection(SETTINGS_SECTION);
+ return settings.addNewSection(key);
}
@Override
@@ -231,20 +232,22 @@ class SignalsDialog extends Dialog {
signal_table.setLayoutData(data);
int w = SIZING_TABLE_WIDTH / (column_names.length + 5);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ prefs = prefs.node(SignalsDialog.class.getCanonicalName());
for (int i = 0; i < column_names.length; i++) {
final TableColumn column = new TableColumn(signal_table, SWT.LEAD, i);
column.setMoveable(false);
column.setText(column_names[i]);
switch (i) {
case 0:
- column.setWidth(w * 2);
+ column.setWidth(prefs.getInt("w" + i, w * 2));
break;
case 1:
case 2:
- column.setWidth(w * 3);
+ column.setWidth(prefs.getInt("w" + i, w * 3));
break;
default:
- column.setWidth(w);
+ column.setWidth(prefs.getInt("w" + i, w));
break;
}
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/ContextSelectionDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/ContextSelectionDialog.java
index 25e37ca34..3f98587bd 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/ContextSelectionDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/ContextSelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -10,19 +10,24 @@
*******************************************************************************/
package org.eclipse.tcf.internal.debug.ui.launch;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.jface.window.IShellProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.tcf.internal.debug.ui.Activator;
import org.eclipse.tcf.internal.debug.ui.launch.ContextListControl.ContextInfo;
import org.eclipse.tcf.internal.debug.ui.launch.PeerListControl.PeerInfo;
+import org.osgi.service.prefs.Preferences;
/**
* Dialog to select a peer and context.
@@ -33,9 +38,10 @@ public class ContextSelectionDialog extends Dialog {
private ContextSelection selection;
private ContextListControl context_list;
- public ContextSelectionDialog(IShellProvider parentShell, boolean processes) {
- super(parentShell);
+ public ContextSelectionDialog(IShellProvider parent, boolean processes) {
+ super(parent);
this.processes = processes;
+ setShellStyle(getShellStyle() | SWT.RESIZE);
}
public void setSelection(ContextSelection selection) {
@@ -47,6 +53,15 @@ public class ContextSelectionDialog extends Dialog {
}
@Override
+ protected IDialogSettings getDialogBoundsSettings() {
+ String key = ContextSelectionDialog.class.getCanonicalName();
+ IDialogSettings settings = Activator.getDefault().getDialogSettings();
+ IDialogSettings section = settings.getSection(key);
+ if (section != null) return section;
+ return settings.addNewSection(key);
+ }
+
+ @Override
protected void configureShell(Shell shell) {
shell.setText("Select Peer and Context");
super.configureShell(shell);
@@ -62,8 +77,12 @@ public class ContextSelectionDialog extends Dialog {
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
+ GridLayout layout = new GridLayout(1, false);
+ composite.setLayout(layout);
new Label(composite, SWT.NONE).setText("Peers:");
- final PeerListControl peerList = new PeerListControl(composite) {
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ prefs = prefs.node(ContextSelectionDialog.class.getCanonicalName());
+ final PeerListControl peer_list = new PeerListControl(composite, prefs) {
@Override
protected void onPeerSelected(PeerInfo info) {
handlePeerSelected(info);
@@ -88,7 +107,7 @@ public class ContextSelectionDialog extends Dialog {
}
});
if (selection.fPeerId != null) {
- peerList.setInitialSelection(selection.fPeerId);
+ peer_list.setInitialSelection(selection.fPeerId);
}
if (selection.fContextFullName != null) {
context_list.setInitialSelection(selection.fContextFullName);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java
index 3a5a76964..fbe9553b8 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PeerListControl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -48,10 +48,16 @@ import org.eclipse.tcf.protocol.IChannel;
import org.eclipse.tcf.protocol.IPeer;
import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.ILocator;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
// Cloned from TCFTargetTab
public class PeerListControl implements ISelectionProvider {
+ private static final int[] COL_WIDTH = { 160, 100, 100, 60, 100, 40 };
+ private static final String[] COL_TEXT = { "Name", "OS", "User", "Transport", "Host", "Port" };
+
+ private final Preferences prefs;
private Tree peer_tree;
private final PeerInfo peer_info = new PeerInfo();
private Display display;
@@ -175,7 +181,8 @@ public class PeerListControl implements ISelectionProvider {
}
}
- public PeerListControl(Composite parent) {
+ public PeerListControl(Composite parent, Preferences prefs) {
+ this.prefs = prefs;
display = parent.getDisplay();
parent.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
@@ -186,6 +193,10 @@ public class PeerListControl implements ISelectionProvider {
createPeerListArea(parent);
}
+ public PeerListControl(Composite parent) {
+ this(parent, null);
+ }
+
public void setInitialSelection(String id) {
if (id == null) return;
if (id.length() == 0) return;
@@ -216,6 +227,8 @@ public class PeerListControl implements ISelectionProvider {
Font font = parent.getFont();
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout(2, false);
+ layout.marginWidth = 0;
+ layout.marginHeight = 0;
composite.setFont(font);
composite.setLayout(layout);
composite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true, 2, 1));
@@ -226,35 +239,11 @@ public class PeerListControl implements ISelectionProvider {
gd.minimumWidth = 470;
peer_tree.setLayoutData(gd);
- for (int i = 0; i < 6; i++) {
+ for (int i = 0; i < COL_WIDTH.length; i++) {
TreeColumn column = new TreeColumn(peer_tree, SWT.LEAD, i);
column.setMoveable(true);
- switch (i) {
- case 0:
- column.setText("Name");
- column.setWidth(160);
- break;
- case 1:
- column.setText("OS");
- column.setWidth(100);
- break;
- case 2:
- column.setText("User");
- column.setWidth(100);
- break;
- case 3:
- column.setText("Transport");
- column.setWidth(60);
- break;
- case 4:
- column.setText("Host");
- column.setWidth(100);
- break;
- case 5:
- column.setText("Port");
- column.setWidth(40);
- break;
- }
+ column.setWidth(prefs.getInt("w" + i, COL_WIDTH[i]));
+ column.setText(COL_TEXT[i]);
}
peer_tree.setHeaderVisible(true);
@@ -318,6 +307,18 @@ public class PeerListControl implements ISelectionProvider {
}
private void handleDispose() {
+ if (prefs != null) {
+ for (int i = 0; i < COL_WIDTH.length; i++) {
+ TreeColumn col = peer_tree.getColumn(i);
+ prefs.putInt("w" + i, col.getWidth());
+ }
+ try {
+ prefs.flush();
+ }
+ catch (BackingStoreException x) {
+ Activator.log(x);
+ }
+ }
Protocol.invokeAndWait(new Runnable() {
public void run() {
disconnectPeer(peer_info);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java
index 8f7fcbad5..aca7be30b 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFMemoryMapTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 Wind River Systems, Inc. and others.
+ * Copyright (c) 2011-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -11,6 +11,7 @@
package org.eclipse.tcf.internal.debug.ui.launch;
import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.Launch;
@@ -24,10 +25,12 @@ import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.tcf.internal.debug.model.TCFLaunch;
+import org.eclipse.tcf.internal.debug.ui.Activator;
import org.eclipse.tcf.internal.debug.ui.ImageCache;
import org.eclipse.tcf.internal.debug.ui.commands.MemoryMapWidget;
import org.eclipse.tcf.internal.debug.ui.model.TCFModelManager;
import org.eclipse.tcf.internal.debug.ui.model.TCFNode;
+import org.osgi.service.prefs.Preferences;
public class TCFMemoryMapTab extends AbstractLaunchConfigurationTab {
@@ -60,7 +63,9 @@ public class TCFMemoryMapTab extends AbstractLaunchConfigurationTab {
* @return The memory map widget.
*/
protected MemoryMapWidget createWidget(Composite composite, TCFNode node) {
- return new MemoryMapWidget(composite, node);
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ prefs = prefs.node(TCFMemoryMapTab.class.getCanonicalName());
+ return new MemoryMapWidget(composite, node, prefs);
}
/**
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFPathMapTab.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFPathMapTab.java
index 0a15bd049..55703a5c6 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFPathMapTab.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFPathMapTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2015 Wind River Systems, Inc. and others.
+ * Copyright (c) 2009-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -17,6 +17,7 @@ import java.util.LinkedHashMap;
import java.util.List;
import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -42,6 +43,8 @@ import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Color;
@@ -63,6 +66,8 @@ import org.eclipse.tcf.internal.debug.ui.ImageCache;
import org.eclipse.tcf.services.IPathMap;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
+import org.osgi.service.prefs.BackingStoreException;
+import org.osgi.service.prefs.Preferences;
// TODO: add source lookup container that represents ATTR_PATH_MAP
public class TCFPathMapTab extends AbstractLaunchConfigurationTab {
@@ -81,6 +86,7 @@ public class TCFPathMapTab extends AbstractLaunchConfigurationTab {
protected static final int SIZING_TABLE_WIDTH = 500;
protected static final int SIZING_TABLE_HEIGHT = 300;
+ private static final int[] COL_WIDTH = { 30, 300, 300, 100 };
private static final String[] column_ids = {
"", //$NON-NLS-1$
@@ -183,8 +189,14 @@ public class TCFPathMapTab extends AbstractLaunchConfigurationTab {
}
}
+ private final Preferences prefs;
private Exception init_error;
+ public TCFPathMapTab() {
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ this.prefs = prefs.node(TCFPathMapTab.class.getCanonicalName());
+ }
+
public String getName() {
return "Path Map"; //$NON-NLS-1$
}
@@ -281,36 +293,36 @@ public class TCFPathMapTab extends AbstractLaunchConfigurationTab {
data.heightHint = SIZING_TABLE_HEIGHT;
table.setLayoutData(data);
- final TableColumn colEnable = new TableColumn(table, 0);
- colEnable.setResizable(false);
- colEnable.setAlignment(SWT.CENTER);
- colEnable.setText(getColumnText(0));
-
- final TableColumn colSource = new TableColumn(table, 1);
- colSource.setResizable(true);
- colSource.setAlignment(SWT.LEFT);
- colSource.setText(getColumnText(1));
-
- final TableColumn colDest = new TableColumn(table, 2);
- colDest.setResizable(true);
- colDest.setAlignment(SWT.LEFT);
- colDest.setText(getColumnText(2));
-
- TableColumn colQuery = null;
- if (showContextQuery()) {
- colQuery = new TableColumn(table, 3);
- colQuery.setResizable(true);
- colQuery.setAlignment(SWT.LEFT);
- colQuery.setText(getColumnText(3));
- }
-
TableLayout layout = new TableLayout();
- layout.addColumnData(new ColumnPixelData(30));
- layout.addColumnData(new ColumnPixelData(300));
- layout.addColumnData(new ColumnPixelData(300));
- if (showContextQuery())
- layout.addColumnData(new ColumnPixelData(100));
-
+ for (int i = 0; i < COL_WIDTH.length; i++) {
+ if (i == 3 && !showContextQuery()) continue;
+ TableColumn col = new TableColumn(table, i);
+ if (i == 0) {
+ col.setResizable(false);
+ col.setAlignment(SWT.CENTER);
+ }
+ else {
+ col.setResizable(true);
+ col.setAlignment(SWT.LEFT);
+ }
+ col.setText(getColumnText(i));
+ layout.addColumnData(new ColumnPixelData(prefs.getInt("w" + i, COL_WIDTH[i])));
+ }
+ table.addDisposeListener(new DisposeListener() {
+ public void widgetDisposed(DisposeEvent e) {
+ int n = table.getColumnCount();
+ for (int i = 0; i < n; i++) {
+ TableColumn col = table.getColumn(i);
+ prefs.putInt("w" + i, col.getWidth());
+ }
+ try {
+ prefs.flush();
+ }
+ catch (BackingStoreException x) {
+ Activator.log(x);
+ }
+ }
+ });
table.setLayout(layout);
table.setHeaderVisible(true);
table.setLinesVisible(true);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFTargetTab.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFTargetTab.java
index a3c53811a..f78ebaaa2 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFTargetTab.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFTargetTab.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2013 Wind River Systems, Inc. and others.
+ * Copyright (c) 2007-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -18,6 +18,7 @@ import java.util.Map;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.ui.AbstractLaunchConfigurationTab;
@@ -61,6 +62,7 @@ import org.eclipse.tcf.protocol.Protocol;
import org.eclipse.tcf.services.IMemoryMap;
import org.eclipse.tcf.services.IPathMap;
import org.eclipse.tcf.util.TCFTask;
+import org.osgi.service.prefs.Preferences;
/**
@@ -170,7 +172,9 @@ public class TCFTargetTab extends AbstractLaunchConfigurationTab {
peer_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
peer_label.setFont(font);
- peer_list = new PeerListControl(group) {
+ Preferences prefs = InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID);
+ prefs = prefs.node(TCFTargetTab.class.getCanonicalName());
+ peer_list = new PeerListControl(group, prefs) {
@Override
protected void onPeerListChanged() {
updateLaunchConfigurationDialog();
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/WizardLoginPage.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/WizardLoginPage.java
index 1f282095d..a2d063f87 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/WizardLoginPage.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/WizardLoginPage.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2009, 2011 Wind River Systems, Inc. and others.
+ * Copyright (c) 2009-2020 Wind River Systems, Inc. and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License 2.0
* which accompanies this distribution, and is available at
@@ -146,7 +146,7 @@ class WizardLoginPage extends WizardPage implements Listener {
IEclipsePreferences d = DefaultScope.INSTANCE.getNode(Activator.PLUGIN_ID);
d.put(PREF_PROTOCOL, protocols[0]);
- IEclipsePreferences[] n = { InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID) };
+ IEclipsePreferences[] n = { InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID), d };
IPreferencesService s = Platform.getPreferencesService();
protocol.setText(s.get(PREF_PROTOCOL, "", n));
host.setText(s.get(PREF_HOST, "", n));

Back to the top