aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormpaturzo2014-03-25 09:00:40 (EDT)
committermpaturzo2014-03-25 09:00:40 (EDT)
commit039da297c7fbfb220b7c8d1d79857c26ad044efe (patch)
tree4b94c29ba884a91e68799cf352cac56e66bccc85
parent34512d5e3c99a5053d37e770faa0caef87dbeaa2 (diff)
downloadorg.eclipse.nebula-039da297c7fbfb220b7c8d1d79857c26ad044efe.zip
org.eclipse.nebula-039da297c7fbfb220b7c8d1d79857c26ad044efe.tar.gz
org.eclipse.nebula-039da297c7fbfb220b7c8d1d79857c26ad044efe.tar.bz2
Bug 387366 - "Widget is disposed" Exception with EditingSupportrefs/changes/58/23858/1
GridViewerRow.getRowBelow() i have added !tmp.isDisposed() && tmp.isVisible() && tmp.getData() != null in if clause. I had to change the visibility of gridItem.isVisible method. Change-Id: Icce8d1c91031fc5d689ec0c7a1e1bb4807e51011 Signed-off-by: mpaturzo <caosmpz@yahoo.it>
-rw-r--r--widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/jface/gridviewer/GridViewerRow.java61
-rw-r--r--widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java2
2 files changed, 44 insertions, 19 deletions
diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/jface/gridviewer/GridViewerRow.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/jface/gridviewer/GridViewerRow.java
index a38e605..e2c09d9 100644
--- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/jface/gridviewer/GridViewerRow.java
+++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/jface/gridviewer/GridViewerRow.java
@@ -42,7 +42,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public Rectangle getBounds(int columnIndex)
+ @Override
+ public Rectangle getBounds(int columnIndex)
{
if( columnIndex == Integer.MAX_VALUE ) {
//TODO Provide implementation for GridItem
@@ -58,7 +59,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public Rectangle getBounds()
+ @Override
+ public Rectangle getBounds()
{
// TODO This is not correct. Update once item returns the correct information.
return item.getBounds(0);
@@ -66,13 +68,15 @@ public class GridViewerRow extends ViewerRow
/** {@inheritDoc} */
- public int getColumnCount()
+ @Override
+ public int getColumnCount()
{
return item.getParent().getColumnCount();
}
/** {@inheritDoc} */
- public Color getBackground(int columnIndex)
+ @Override
+ public Color getBackground(int columnIndex)
{
if( columnIndex == Integer.MAX_VALUE ) {
//TODO Provide implementation for GridItem
@@ -83,7 +87,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public Font getFont(int columnIndex)
+ @Override
+ public Font getFont(int columnIndex)
{
if( columnIndex == Integer.MAX_VALUE ) {
//TODO Provide implementation for GridItem
@@ -94,7 +99,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public Color getForeground(int columnIndex)
+ @Override
+ public Color getForeground(int columnIndex)
{
if( columnIndex == Integer.MAX_VALUE ) {
//TODO Provide implementation for GridItem
@@ -105,7 +111,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public Image getImage(int columnIndex)
+ @Override
+ public Image getImage(int columnIndex)
{
if( columnIndex == Integer.MAX_VALUE ) {
//TODO Provide implementation for GridItem
@@ -117,7 +124,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public String getText(int columnIndex)
+ @Override
+ public String getText(int columnIndex)
{
if( columnIndex == Integer.MAX_VALUE ) {
return item.getHeaderText();
@@ -128,7 +136,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public void setBackground(int columnIndex, Color color)
+ @Override
+ public void setBackground(int columnIndex, Color color)
{
if( columnIndex == Integer.MAX_VALUE ) {
item.setHeaderBackground(color);
@@ -138,7 +147,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public void setFont(int columnIndex, Font font)
+ @Override
+ public void setFont(int columnIndex, Font font)
{
if( columnIndex == Integer.MAX_VALUE ) {
//TODO Provide implementation for GridItem
@@ -148,7 +158,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public void setForeground(int columnIndex, Color color)
+ @Override
+ public void setForeground(int columnIndex, Color color)
{
if( columnIndex == Integer.MAX_VALUE ) {
item.setHeaderForeground(color);
@@ -158,7 +169,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public void setImage(int columnIndex, Image image)
+ @Override
+ public void setImage(int columnIndex, Image image)
{
if( columnIndex == Integer.MAX_VALUE ) {
item.setHeaderImage(image);
@@ -169,7 +181,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public void setText(int columnIndex, String text)
+ @Override
+ public void setText(int columnIndex, String text)
{
if( columnIndex == Integer.MAX_VALUE ) {
item.setHeaderText(text);
@@ -179,7 +192,8 @@ public class GridViewerRow extends ViewerRow
}
/** {@inheritDoc} */
- public Control getControl()
+ @Override
+ public Control getControl()
{
return item.getParent();
}
@@ -187,7 +201,8 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
- public ViewerRow getNeighbor(int direction, boolean sameLevel) {
+ @Override
+ public ViewerRow getNeighbor(int direction, boolean sameLevel) {
if( direction == ViewerRow.ABOVE ) {
return getRowAbove();
} else if( direction == ViewerRow.BELOW ) {
@@ -213,7 +228,10 @@ public class GridViewerRow extends ViewerRow
if( index < item.getParent().getItemCount() ) {
GridItem tmp = item.getParent().getItem(index);
- if( tmp != null ) {
+ /**
+ * Maybe this is a dummy item!!
+ */
+ if(tmp != null && !tmp.isDisposed() && tmp.isVisible() && tmp.getData() != null) {
return new GridViewerRow(tmp);
}
}
@@ -224,6 +242,7 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
+ @Override
public TreePath getTreePath() {
return new TreePath(new Object[] {item.getData()});
}
@@ -231,6 +250,7 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
+ @Override
public Object clone() {
return new GridViewerRow(item);
}
@@ -238,6 +258,7 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
+ @Override
public Object getElement() {
return item.getData();
}
@@ -249,7 +270,8 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
- public Widget getItem()
+ @Override
+ public Widget getItem()
{
return item;
}
@@ -257,7 +279,8 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
- public int getVisualIndex(int creationIndex) {
+ @Override
+ public int getVisualIndex(int creationIndex) {
int[] order = item.getParent().getColumnOrder();
for (int i = 0; i < order.length; i++) {
@@ -272,6 +295,7 @@ public class GridViewerRow extends ViewerRow
/**
* {@inheritDoc}
*/
+ @Override
public int getCreationIndex(int visualIndex) {
if( item != null && ! item.isDisposed() && hasColumns() && isValidOrderIndex(visualIndex) ) {
return item.getParent().getColumnOrder()[visualIndex];
@@ -305,6 +329,7 @@ public class GridViewerRow extends ViewerRow
*
* @return <code>true</code> if the column is visible
*/
+ @Override
protected boolean isColumnVisible(int columnIndex) {
return item.getParent().getColumn(columnIndex).isVisible();
}
diff --git a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java
index 6894a9a..ff4dc35 100644
--- a/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java
+++ b/widgets/grid/org.eclipse.nebula.widgets.grid/src/org/eclipse/nebula/widgets/grid/GridItem.java
@@ -1607,7 +1607,7 @@ public class GridItem extends Item {
*
* @return Returns the visible.
*/
- boolean isVisible() {
+ public boolean isVisible() {
return visible;
}