Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2020-03-24 02:18:07 +0000
committerEugene Tarassov2020-03-24 02:18:07 +0000
commit5b06f0998a67afb747c57909ffad34db4d4e92d5 (patch)
tree8d956816eac1a12ee0777ff204a7e9cba9530e77
parentfa512a8f0085c79ddb6d65af6013a61727481acb (diff)
downloadorg.eclipse.tcf-5b06f0998a67afb747c57909ffad34db4d4e92d5.tar.gz
org.eclipse.tcf-5b06f0998a67afb747c57909ffad34db4d4e92d5.tar.xz
org.eclipse.tcf-5b06f0998a67afb747c57909ffad34db4d4e92d5.zip
TCF Debugger: Fixed: read-only text fields look enabled on GTK
-rw-r--r--plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/sourcelookup/TCFCSourceNotFoundEditor.java5
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java31
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapWidget.java18
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PathMapRuleDialog.java17
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TCFTargetTab.java1
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java3
-rw-r--r--plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/PeerPropsControl.java8
7 files changed, 61 insertions, 22 deletions
diff --git a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/sourcelookup/TCFCSourceNotFoundEditor.java b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/sourcelookup/TCFCSourceNotFoundEditor.java
index 53d443161..206beaf69 100644
--- a/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/sourcelookup/TCFCSourceNotFoundEditor.java
+++ b/plugins/org.eclipse.tcf.cdt.ui/src/org/eclipse/tcf/internal/cdt/ui/sourcelookup/TCFCSourceNotFoundEditor.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2012 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
@@ -20,6 +20,7 @@ import org.eclipse.tcf.internal.cdt.ui.sourcelookup.TCFSourceNotFoundPresentatio
import org.eclipse.tcf.internal.debug.ui.model.TCFModel;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
/**
* Customized source-not-found editor
@@ -81,7 +82,7 @@ public class TCFCSourceNotFoundEditor extends CSourceNotFoundEditor {
}
protected void closeEditor() {
- getSite().getShell().getDisplay().asyncExec(new Runnable() {
+ PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() {
public void run() {
IWorkbenchPage page = getSite().getPage();
if (page != null) page.closeEditor(TCFCSourceNotFoundEditor.this, false);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java
index 8efd7df0b..0ce28fa00 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/commands/MemoryMapItemDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2015 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
@@ -69,7 +69,9 @@ class MemoryMapItemDialog extends Dialog {
@Override
protected void createButtonsForButtonBar(Composite parent) {
createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ if (enable_editing) {
+ createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
+ }
updateButtons();
}
@@ -100,7 +102,10 @@ class MemoryMapItemDialog extends Dialog {
file_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
file_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
file_text.setFont(font);
- file_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ file_text.setEditable(false);
+ file_text.setBackground(parent.getBackground());
+ }
file_text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -152,7 +157,10 @@ class MemoryMapItemDialog extends Dialog {
addr_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
addr_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
addr_text.setFont(font);
- addr_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ addr_text.setEditable(false);
+ addr_text.setBackground(parent.getBackground());
+ }
addr_text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -168,7 +176,10 @@ class MemoryMapItemDialog extends Dialog {
size_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
size_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
size_text.setFont(font);
- size_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ size_text.setEditable(false);
+ size_text.setBackground(parent.getBackground());
+ }
Label offset_label = new Label(composite, SWT.WRAP);
offset_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
@@ -178,7 +189,10 @@ class MemoryMapItemDialog extends Dialog {
offset_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
offset_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
offset_text.setFont(font);
- offset_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ offset_text.setEditable(false);
+ offset_text.setBackground(parent.getBackground());
+ }
}
private void createFlagsGroup(Composite parent) {
@@ -229,7 +243,10 @@ class MemoryMapItemDialog extends Dialog {
query_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
query_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
query_text.setFont(font);
- query_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ query_text.setEditable(false);
+ query_text.setBackground(parent.getBackground());
+ }
}
private String toHex(Number n) {
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 779dbaae8..36e71c764 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
@@ -478,13 +478,19 @@ public class MemoryMapWidget {
map_table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetDefaultSelected(SelectionEvent e) {
- final IMemoryMap.MemoryRegion r = (IMemoryMap.MemoryRegion)((IStructuredSelection)table_viewer.getSelection()).getFirstElement();
+ final TreeItem item = (TreeItem)e.item;
+ final IMemoryMap.MemoryRegion r = (IMemoryMap.MemoryRegion)item.getData();
if (r == null) return;
// Async exec is used to workaround exception in jface
asyncExec(new Runnable() {
@Override
public void run() {
- editRegion(r);
+ if (r.getProperties().containsKey(PROP_CHILDREN)) {
+ table_viewer.setExpandedState(r, !item.getExpanded());
+ }
+ else {
+ editRegion(r);
+ }
}
});
}
@@ -547,15 +553,15 @@ public class MemoryMapWidget {
// Implement a "fake" tooltip
final Listener labelListener = new Listener() {
public void handleEvent(Event event) {
- Label label = (Label) event.widget;
+ Label label = (Label)event.widget;
Shell shell = label.getShell();
switch (event.type) {
case SWT.MouseDown:
Event e = new Event();
- e.item = (TreeItem) label.getData("_TABLEITEM"); //$NON-NLS-1$
+ e.item = (TreeItem)label.getData("_TABLEITEM"); //$NON-NLS-1$
// Assuming table is single select, set the selection as if
// the mouse down event went through to the table
- table.setSelection(new TreeItem[] { (TreeItem) e.item });
+ table.setSelection(new TreeItem[] { (TreeItem)e.item });
table.notifyListeners(SWT.Selection, e);
shell.dispose();
table.setFocus();
@@ -667,7 +673,7 @@ public class MemoryMapWidget {
button_edit.addSelectionListener(sel_adapter = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
- IMemoryMap.MemoryRegion r = (IMemoryMap.MemoryRegion) ((IStructuredSelection) table_viewer.getSelection()).getFirstElement();
+ IMemoryMap.MemoryRegion r = (IMemoryMap.MemoryRegion) ((IStructuredSelection)table_viewer.getSelection()).getFirstElement();
if (r == null) return;
editRegion(r);
}
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PathMapRuleDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PathMapRuleDialog.java
index efeab79ba..c9ba0e424 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PathMapRuleDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/PathMapRuleDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 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
@@ -102,7 +102,10 @@ public class PathMapRuleDialog extends TitleAreaDialog {
gd.horizontalSpan = 3;
source_text.setLayoutData(gd);
source_text.setFont(font);
- source_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ source_text.setEditable(false);
+ source_text.setBackground(parent.getBackground());
+ }
source_text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -120,7 +123,10 @@ public class PathMapRuleDialog extends TitleAreaDialog {
gd.widthHint = convertWidthInCharsToPixels(40);
destination_text.setLayoutData(gd);
destination_text.setFont(font);
- destination_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ destination_text.setEditable(false);
+ destination_text.setBackground(parent.getBackground());
+ }
destination_text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
@@ -168,7 +174,10 @@ public class PathMapRuleDialog extends TitleAreaDialog {
gd.horizontalSpan = 2;
context_query_text.setLayoutData(gd);
context_query_text.setFont(font);
- context_query_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ context_query_text.setEditable(false);
+ context_query_text.setBackground(parent.getBackground());
+ }
context_query_text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
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 f78ebaaa2..1b2cd07b8 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
@@ -164,6 +164,7 @@ public class TCFTargetTab extends AbstractLaunchConfigurationTab {
peer_id_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
peer_id_text.setFont(font);
peer_id_text.setEditable(false);
+ peer_id_text.setBackground(parent.getBackground());
createVerticalSpacer(group, layout.numColumns);
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java
index bd937c555..8bd732ea2 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/TestErrorsDialog.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
@@ -67,6 +67,7 @@ public class TestErrorsDialog extends Dialog {
text = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
text.setFont(JFaceResources.getFont(JFaceResources.TEXT_FONT));
text.setEditable(false);
+ text.setBackground(parent.getBackground());
text.setText(createText());
GridData data = new GridData(GridData.FILL_BOTH);
data.widthHint = SIZING_TEXT_WIDTH;
diff --git a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/PeerPropsControl.java b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/PeerPropsControl.java
index bcef4eba3..4607cd4d7 100644
--- a/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/PeerPropsControl.java
+++ b/plugins/org.eclipse.tcf.debug.ui/src/org/eclipse/tcf/internal/debug/ui/launch/setup/PeerPropsControl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2011 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
@@ -116,6 +116,7 @@ public class PeerPropsControl {
id_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
id_text.setFont(font);
id_text.setEditable(false);
+ id_text.setBackground(parent.getBackground());
Label name_label = new Label(composite, SWT.WRAP);
name_label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
@@ -125,7 +126,10 @@ public class PeerPropsControl {
name_text = new Text(composite, SWT.SINGLE | SWT.BORDER);
name_text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
name_text.setFont(font);
- name_text.setEditable(enable_editing);
+ if (!enable_editing) {
+ name_text.setEditable(false);
+ name_text.setBackground(parent.getBackground());
+ }
name_text.addListener(SWT.KeyUp, new Listener() {
public void handleEvent(Event event) {
listener.run();

Back to the top