projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
a0fae26
)
Removed EditingSupports from Instruction Preview in SimulationView
author
Fabian Stemmler
<stemmler@in.tum.de>
Sun, 6 Oct 2019 16:52:23 +0000
(18:52 +0200)
committer
Fabian Stemmler
<stemmler@in.tum.de>
Sun, 6 Oct 2019 16:52:23 +0000
(18:52 +0200)
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionTable.java
patch
|
blob
|
history
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java
patch
|
blob
|
history
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionTable.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionTable.java
index
6ffc93e
..
d7c2327
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionTable.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/mi/InstructionTable.java
@@
-40,12
+40,20
@@
public class InstructionTable
private final RowHighlighter highlighter;
private final FontAndColorHelper cProv;
private final RowHighlighter highlighter;
private final FontAndColorHelper cProv;
+ private final boolean isEditable;
+
public InstructionTable(Composite parent, DisplaySettings displaySettings, IThemeManager themeManager)
public InstructionTable(Composite parent, DisplaySettings displaySettings, IThemeManager themeManager)
+ {
+ this(parent, displaySettings, themeManager, true);
+ }
+
+ public InstructionTable(Composite parent, DisplaySettings displaySettings, IThemeManager themeManager, boolean allowEditing)
{
viewer = new LazyTableViewer(parent, SWT.FULL_SELECTION | SWT.BORDER | SWT.VIRTUAL);
this.displaySettings = displaySettings;
this.cProv = new FontAndColorHelper(viewer, themeManager);
this.highlighter = new RowHighlighter(viewer, cProv);
{
viewer = new LazyTableViewer(parent, SWT.FULL_SELECTION | SWT.BORDER | SWT.VIRTUAL);
this.displaySettings = displaySettings;
this.cProv = new FontAndColorHelper(viewer, themeManager);
this.highlighter = new RowHighlighter(viewer, cProv);
+ this.isEditable = allowEditing;
Table table = viewer.getTable();
table.setHeaderVisible(true);
Table table = viewer.getTable();
table.setHeaderVisible(true);
@@
-183,22
+191,23
@@
public class InstructionTable
switch (parameterClassification.getExpectedType())
{
case BOOLEAN_IMMEDIATE:
switch (parameterClassification.getExpectedType())
{
case BOOLEAN_IMMEDIATE:
- support =
new BooleanEditingSupport(viewer, miDef, index)
;
+ support =
isEditable ? new BooleanEditingSupport(viewer, miDef, index) : null
;
provider = new ParameterLabelProvider(cProv, index);
break;
case INTEGER_IMMEDIATE:
provider = new ParameterLabelProvider(cProv, index);
break;
case INTEGER_IMMEDIATE:
- support =
new IntegerEditingSupport(viewer, miDef, index, displaySettings, this.provider)
;
+ support =
isEditable ? new IntegerEditingSupport(viewer, miDef, index, displaySettings, this.provider) : null
;
provider = new IntegerColumnLabelProvider(displaySettings, cProv, index);
break;
case MNEMONIC:
provider = new IntegerColumnLabelProvider(displaySettings, cProv, index);
break;
case MNEMONIC:
- support =
new MnemonicEditingSupport(viewer, miDef, index, this.provider)
;
+ support =
isEditable ? new MnemonicEditingSupport(viewer, miDef, index, this.provider) : null
;
provider = new ParameterLabelProvider(cProv, index);
break;
default:
throw new IllegalStateException(
"Unable to create EditingSupport for unknown ParameterType " + parameterClassification.getExpectedType());
}
provider = new ParameterLabelProvider(cProv, index);
break;
default:
throw new IllegalStateException(
"Unable to create EditingSupport for unknown ParameterType " + parameterClassification.getExpectedType());
}
- col.setEditingSupport(support);
+ if (isEditable)
+ col.setEditingSupport(support);
col.setLabelProvider(provider);
col.getColumn().setToolTipText(miDef.getParameterDescription(index).orElse(""));
}
col.setLabelProvider(provider);
col.getColumn().setToolTipText(miDef.getParameterDescription(index).orElse(""));
}
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java
index
a8fcfd7
..
d1a9041
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java
@@
-175,7
+175,8
@@
public class SimulationView extends ViewPart
private void addInstructionPreviewControlWidgets(Composite parent)
{
private void addInstructionPreviewControlWidgets(Composite parent)
{
- instPreview = new InstructionTable(parent, new DisplaySettings(), getSite().getWorkbenchWindow().getWorkbench().getThemeManager());
+ instPreview = new InstructionTable(parent, new DisplaySettings(), getSite().getWorkbenchWindow().getWorkbench().getThemeManager(),
+ false);
instPreview.getTableViewer().getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
contentProvider = new ActiveInstructionPreviewContentProvider(instPreview.getTableViewer());
instPreview.setContentProvider(contentProvider);
instPreview.getTableViewer().getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
contentProvider = new ActiveInstructionPreviewContentProvider(instPreview.getTableViewer());
instPreview.setContentProvider(contentProvider);