aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Weigelt2012-03-27 09:43:03 (EDT)
committerMichael Jastram2012-04-05 06:38:10 (EDT)
commit8ba0dd94fd850df68c1200ccfcc8b955b78a7c33 (patch)
treeb3f20061a05dc18fc9e14e91071f67f840585af5
parent59547cccd2e327f419fe85f4f25cb00eb18b7d85 (diff)
downloadorg.eclipse.rmf-8ba0dd94fd850df68c1200ccfcc8b955b78a7c33.zip
org.eclipse.rmf-8ba0dd94fd850df68c1200ccfcc8b955b78a7c33.tar.gz
org.eclipse.rmf-8ba0dd94fd850df68c1200ccfcc8b955b78a7c33.tar.bz2
Testing dnd functionality
-rw-r--r--org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java26
-rw-r--r--org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGrid.java3
-rw-r--r--org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java10
3 files changed, 39 insertions, 0 deletions
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java
index 13ea012..bd29995 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/AbstractProrCellRenderer.java
@@ -18,6 +18,7 @@ import javax.xml.datatype.XMLGregorianCalendar;
import org.agilemore.agilegrid.AgileGrid;
import org.agilemore.agilegrid.SWTResourceManager;
+import org.agilemore.agilegrid.SWTX;
import org.agilemore.agilegrid.renderers.TextCellRenderer;
import org.eclipse.emf.common.notify.AdapterFactory;
import org.eclipse.emf.edit.provider.ItemProviderAdapter;
@@ -26,6 +27,7 @@ import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.EnumValue;
import org.eclipse.rmf.reqif10.datatypes.XhtmlContent;
import org.eclipse.rmf.reqif10.util.Reqif10Util;
+import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.GC;
import org.eclipse.swt.graphics.Rectangle;
@@ -97,5 +99,29 @@ public class AbstractProrCellRenderer extends TextCellRenderer {
background = SWTResourceManager.getColor(223, 227, 237);
}
}
+
+ @Override
+ protected void drawGridLines(GC gc, Rectangle rect, int row, int col) {
+ Color vBorderColor = COLOR_LINE_LIGHTGRAY;
+ Color hBorderColor = COLOR_LINE_LIGHTGRAY;
+
+ if (agileGrid instanceof ProrAgileGrid){
+ if (((ProrAgileGrid)agileGrid).dndHoverCell != null && row == ((ProrAgileGrid)agileGrid).dndHoverCell.row){
+ hBorderColor = COLOR_LINE_DARKGRAY;
+ }
+ }
+
+ if ((style & INDICATION_SELECTION_ROW) != 0) {
+ vBorderColor = COLOR_BGROWSELECTION;
+ hBorderColor = COLOR_BGROWSELECTION;
+ }
+
+ if ((agileGrid.getStyle() & SWTX.NOT_SHOW_GRID_LINE) == SWTX.NOT_SHOW_GRID_LINE) {
+ vBorderColor = COLOR_BACKGROUND;
+ hBorderColor = COLOR_BACKGROUND;
+ }
+
+ drawDefaultCellLine(gc, rect, vBorderColor, hBorderColor);
+ }
}
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGrid.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGrid.java
index f61ebb0..4cc3032 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGrid.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGrid.java
@@ -11,6 +11,7 @@
package org.eclipse.rmf.pror.reqif10.editor.agilegrid;
import org.agilemore.agilegrid.AgileGrid;
+import org.agilemore.agilegrid.Cell;
import org.eclipse.swt.widgets.Composite;
/**
@@ -22,6 +23,8 @@ import org.eclipse.swt.widgets.Composite;
*/
public class ProrAgileGrid extends AgileGrid {
+ protected Cell dndHoverCell;
+
public ProrAgileGrid(Composite parent, int style) {
super(parent, style);
diff --git a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java
index bfbfaff..0ea7520 100644
--- a/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java
+++ b/org.eclipse.rmf.pror.reqif10.editor/src/org/eclipse/rmf/pror/reqif10/editor/agilegrid/ProrAgileGridViewer.java
@@ -53,6 +53,7 @@ import org.eclipse.rmf.pror.reqif10.configuration.ProrSpecViewConfiguration;
import org.eclipse.rmf.pror.reqif10.editor.agilegrid.ProrAgileGridContentProvider.ProrRow;
import org.eclipse.rmf.pror.reqif10.util.ConfigurationUtil;
import org.eclipse.rmf.pror.reqif10.util.ProrUtil;
+import org.eclipse.rmf.reqif10.AttributeValue;
import org.eclipse.rmf.reqif10.Reqif10Factory;
import org.eclipse.rmf.reqif10.Reqif10Package;
import org.eclipse.rmf.reqif10.SpecHierarchy;
@@ -570,8 +571,17 @@ public class ProrAgileGridViewer extends Viewer {
Object target = contentProvider.getProrRow(cell.row).element;
if (target instanceof SpecHierarchy) {
dragTarget = (SpecHierarchy) target;
+ agileGrid.dndHoverCell = cell;
+ agileGrid.redraw();
}
}
+
+ @Override
+ protected float getLocation(DropTargetEvent event) {
+ //return 1.0F;
+ return super.getLocation(event);
+ }
+
});
}