Skip to content
Snippets Groups Projects
Commit adde4ee9 authored by Lukas Ladenberger's avatar Lukas Ladenberger
Browse files

better selection of table widget

parent 0dafa7fe
Branches
Tags
No related merge requests found
de.bmotionstudio.gef.editor/icons/eclipse16/updated_col.gif

113 B

...@@ -26,6 +26,7 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -26,6 +26,7 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
public static final String IMG_ICON_NEW_WIZ = "icon_new_wiz"; public static final String IMG_ICON_NEW_WIZ = "icon_new_wiz";
public static final String IMG_ICON_DELETE_EDIT = "icon_delete_edit"; public static final String IMG_ICON_DELETE_EDIT = "icon_delete_edit";
public static final String IMG_ICON_TR_UP = "icon_tr_up"; public static final String IMG_ICON_TR_UP = "icon_tr_up";
public static final String IMG_ICON_TR_LEFT = "icon_tr_left";
public static final String IMG_ICON_JPG = "icon_jpg"; public static final String IMG_ICON_JPG = "icon_jpg";
public static final String IMG_ICON_GIF = "icon_gif"; public static final String IMG_ICON_GIF = "icon_gif";
...@@ -70,6 +71,9 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry { ...@@ -70,6 +71,9 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
BMotionStudioImage BMotionStudioImage
.registerImage(IMG_ICON_TR_UP, BMotionEditorPlugin.PLUGIN_ID, .registerImage(IMG_ICON_TR_UP, BMotionEditorPlugin.PLUGIN_ID,
"icons/eclipse16/updated_co.gif"); "icons/eclipse16/updated_co.gif");
BMotionStudioImage.registerImage(IMG_ICON_TR_LEFT,
BMotionEditorPlugin.PLUGIN_ID,
"icons/eclipse16/updated_col.gif");
BMotionStudioImage.registerImage(IMG_ICON_JPG, BMotionStudioImage.registerImage(IMG_ICON_JPG,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_jpg.gif"); BMotionEditorPlugin.PLUGIN_ID, "icons/icon_jpg.gif");
......
...@@ -9,7 +9,6 @@ public class TableColumnFigure extends AbstractTableFigure { ...@@ -9,7 +9,6 @@ public class TableColumnFigure extends AbstractTableFigure {
public TableColumnFigure() { public TableColumnFigure() {
ToolbarLayout toolbarLayout = new ToolbarLayout(); ToolbarLayout toolbarLayout = new ToolbarLayout();
toolbarLayout.setSpacing(0);
setLayoutManager(toolbarLayout); setLayoutManager(toolbarLayout);
setOpaque(true); setOpaque(true);
} }
......
...@@ -15,7 +15,6 @@ public class TableFigure extends AbstractTableFigure { ...@@ -15,7 +15,6 @@ public class TableFigure extends AbstractTableFigure {
public TableFigure() { public TableFigure() {
ToolbarLayout toolbarLayout = new ToolbarLayout(); ToolbarLayout toolbarLayout = new ToolbarLayout();
toolbarLayout.setHorizontal(true); toolbarLayout.setHorizontal(true);
toolbarLayout.setStretchMinorAxis(false);
setLayoutManager(toolbarLayout); setLayoutManager(toolbarLayout);
setOpaque(true); setOpaque(true);
} }
...@@ -25,7 +24,7 @@ public class TableFigure extends AbstractTableFigure { ...@@ -25,7 +24,7 @@ public class TableFigure extends AbstractTableFigure {
Rectangle r = getClientArea(); Rectangle r = getClientArea();
g.setForegroundColor(getForegroundColor()); g.setForegroundColor(getForegroundColor());
// Right table border line // Right table border line
g.drawLine(r.x + r.width - 1, r.y, r.x + r.width - 1, r.y + r.height g.drawLine(r.x + r.width - 21, r.y, r.x + r.width - 21, r.y + r.height
- 15); - 15);
super.paintBorder(g); super.paintBorder(g);
} }
......
...@@ -4,11 +4,14 @@ import java.beans.PropertyChangeEvent; ...@@ -4,11 +4,14 @@ import java.beans.PropertyChangeEvent;
import java.util.List; import java.util.List;
import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPolicy; import org.eclipse.gef.EditPolicy;
import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.graphics.RGB;
import de.bmotionstudio.gef.editor.AttributeConstants; import de.bmotionstudio.gef.editor.AttributeConstants;
import de.bmotionstudio.gef.editor.BMotionStudioImage;
import de.bmotionstudio.gef.editor.EditorImageRegistry;
import de.bmotionstudio.gef.editor.command.CreateCommand; import de.bmotionstudio.gef.editor.command.CreateCommand;
import de.bmotionstudio.gef.editor.editpolicy.AppDeletePolicy; import de.bmotionstudio.gef.editor.editpolicy.AppDeletePolicy;
import de.bmotionstudio.gef.editor.editpolicy.BMotionNodeEditPolicy; import de.bmotionstudio.gef.editor.editpolicy.BMotionNodeEditPolicy;
...@@ -22,7 +25,15 @@ public class BTablePart extends AppAbstractEditPart { ...@@ -22,7 +25,15 @@ public class BTablePart extends AppAbstractEditPart {
@Override @Override
protected IFigure createEditFigure() { protected IFigure createEditFigure() {
return new TableFigure(); TableFigure tableFigure = new TableFigure();
Label figure = new Label();
figure.setOpaque(true);
tableFigure.add(figure);
if (!isRunning()) {
figure.setIcon(BMotionStudioImage
.getImage(EditorImageRegistry.IMG_ICON_TR_LEFT));
}
return tableFigure;
} }
@Override @Override
...@@ -54,7 +65,7 @@ public class BTablePart extends AppAbstractEditPart { ...@@ -54,7 +65,7 @@ public class BTablePart extends AppAbstractEditPart {
figure.getParent().setConstraint( figure.getParent().setConstraint(
figure, figure,
new Rectangle(control.getLocation().x, control.getLocation().y, new Rectangle(control.getLocation().x, control.getLocation().y,
width + 1, (rows * 20) + 15)); width + 21, (rows * 20) + 15));
// super.refreshEditLayout(figure, control); // super.refreshEditLayout(figure, control);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment