aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpaturzo2014-03-24 03:27:55 -0400
committermpaturzo2014-03-24 03:27:55 -0400
commit16d49e08e6afc74ed7d6a3012fd217b978c41b10 (patch)
treee090976dc5d45efd6c1589b2555d179295c965e7
parent9663efd8fa1556c5c8cee59aad7ac252f95636e2 (diff)
downloadorg.eclipse.nebula-16d49e08e6afc74ed7d6a3012fd217b978c41b10.zip
org.eclipse.nebula-16d49e08e6afc74ed7d6a3012fd217b978c41b10.tar.gz
org.eclipse.nebula-16d49e08e6afc74ed7d6a3012fd217b978c41b10.tar.xz
Bug 249568 - NullPointerException is occurred when press arrow_left key
on grid. Simple fix, if column is null, take last focused column first at all. Added simple hide first column in GridViewerSnippetDisposePerformance, add my name in copyright on GridViewerSnippetWithGridItemDataVisualizer. Change-Id: If1269682c14b0087cfb143f3383269f11babcf14 Signed-off-by: mpaturzo <caosmpz@yahoo.it>
-rw-r--r--examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetDisposePerformance.java27
-rw-r--r--examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetWithGridItemDataVisualizer.java4
-rw-r--r--widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java5
3 files changed, 36 insertions, 0 deletions
diff --git a/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetDisposePerformance.java b/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetDisposePerformance.java
index 3eefa0a..d8334ec 100644
--- a/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetDisposePerformance.java
+++ b/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetDisposePerformance.java
@@ -300,6 +300,33 @@ public class GridViewerSnippetDisposePerformance
shell.layout();
}
});
+ final Button hideColumn = new Button(buttons, SWT.NONE);
+ hideColumn.setText("hide first column");
+ hideColumn.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseDown(MouseEvent e)
+ {
+ try
+ {
+ GridColumn[] columns = v.getGrid().getColumns();
+ for (GridColumn gridColumn : columns)
+ {
+ if (gridColumn.isVisible())
+ {
+ gridColumn.setVisible(false);
+ break;
+ }
+ }
+ }
+ catch (java.lang.IllegalArgumentException ie)
+ {
+ new MessageDialog(shell, "IndexOutOfBound error", null, "Restore the grid with button \""
+ + restore + "\"", MessageDialog.WARNING, new String[] { "Ok" }, 0).open();
+ }
+ shell.layout();
+ }
+ });
final Button addColumn = new Button(buttons, SWT.NONE);
addColumn.setText("add column");
addColumn.addMouseListener(new MouseAdapter()
diff --git a/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetWithGridItemDataVisualizer.java b/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetWithGridItemDataVisualizer.java
index b154ef1..d336fd2 100644
--- a/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetWithGridItemDataVisualizer.java
+++ b/examples/org.eclipse.nebula.snippets/src/org/eclipse/nebula/snippets/grid/viewer/GridViewerSnippetWithGridItemDataVisualizer.java
@@ -9,6 +9,8 @@ package org.eclipse.nebula.snippets.grid.viewer;
*
* Contributors:
* Tom Schindl - initial API and implementation
+ * Mirko Paturzo - improve Grid Export, dispose, fonts and background
+ * functional changes
*******************************************************************************/
@@ -97,6 +99,7 @@ public class GridViewerSnippetWithGridItemDataVisualizer {
}
+ @Override
public String toString() {
return "Item " + this.counter;
}
@@ -173,6 +176,7 @@ public class GridViewerSnippetWithGridItemDataVisualizer {
ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(v) {
+ @Override
protected boolean isEditorActivationEvent(
ColumnViewerEditorActivationEvent event) {
return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java
index 1974984..23c576d 100644
--- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java
+++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/Grid.java
@@ -6841,6 +6841,11 @@ public class Grid extends Canvas {
newColumnFocus = (GridColumn) displayOrderedColumns.get(index - 1);
newColumnFocus = getVisibleColumn_DegradeLeft(impliedFocusItem, newColumnFocus);
+
+ if (newColumnFocus == null) {
+ newColumnFocus = impliedFocusColumn;
+ }
+
}
else {
newColumnFocus = impliedFocusColumn;