projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7ec6bf7
)
MemoryEditor's Amount field defaults to 100
author
Daniel Kirschten
<daniel.kirschten@gmx.de>
Thu, 3 Oct 2019 14:48:14 +0000
(16:48 +0200)
committer
Daniel Kirschten
<daniel.kirschten@gmx.de>
Thu, 3 Oct 2019 14:48:14 +0000
(16:48 +0200)
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java
patch
|
blob
|
history
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/memory/MemoryTableContentProvider.java
patch
|
blob
|
history
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java
index
028a1b5
..
b367f3a
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java
@@
-111,19
+111,21
@@
public class MemoryEditor extends EditorPart
Text amountText = new Text(parent, SWT.BORDER);
amountText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
amountText.addVerifyListener(vl);
Text amountText = new Text(parent, SWT.BORDER);
amountText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
amountText.addVerifyListener(vl);
- amountText.setText("0");
amountText.addModifyListener(e ->
{
try
{
amountText.addModifyListener(e ->
{
try
{
- provider.setAmount(AsmNumberUtil.valueOf(amountText.getText()).intValue());
- viewer.refresh();
+ if (provider != null)
+ provider.setAmount(AsmNumberUtil.valueOf(amountText.getText()).intValue());
+ if (viewer != null)
+ viewer.refresh();
}
catch (NumberFormatException x)
{
// Nothing to do here
}
});
}
catch (NumberFormatException x)
{
// Nothing to do here
}
});
+ amountText.setText("100");// do this after registering the ModifyListener
new RadixSelector(parent, displaySettings);
addActivationButton(parent);
new RadixSelector(parent, displaySettings);
addActivationButton(parent);
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/memory/MemoryTableContentProvider.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/memory/MemoryTableContentProvider.java
index
3d67c9d
..
a27f31f
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/memory/MemoryTableContentProvider.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/tables/memory/MemoryTableContentProvider.java
@@
-27,12
+27,13
@@
public class MemoryTableContentProvider implements ILazyContentProvider, MemoryC
public void updateItemCount()
{
public void updateItemCount()
{
- if (memory != null)
- {
- long size = memory.getDefinition().getMaximalAddress() - lower;
- viewer.setItemCount(size > amount ? amount : (int) size);
- } else
- viewer.setItemCount(0);
+ if (viewer != null)
+ if (memory != null)
+ {
+ long size = memory.getDefinition().getMaximalAddress() - lower;
+ viewer.setItemCount(size > amount ? amount : (int) size);
+ } else
+ viewer.setItemCount(0);
}
public long getLowerBound()
}
public long getLowerBound()