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
No related branches found
No related tags found
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 {
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_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_GIF = "icon_gif";
......@@ -70,6 +71,9 @@ public class EditorImageRegistry implements IBMotionStudioImageRegistry {
BMotionStudioImage
.registerImage(IMG_ICON_TR_UP, BMotionEditorPlugin.PLUGIN_ID,
"icons/eclipse16/updated_co.gif");
BMotionStudioImage.registerImage(IMG_ICON_TR_LEFT,
BMotionEditorPlugin.PLUGIN_ID,
"icons/eclipse16/updated_col.gif");
BMotionStudioImage.registerImage(IMG_ICON_JPG,
BMotionEditorPlugin.PLUGIN_ID, "icons/icon_jpg.gif");
......
......@@ -9,7 +9,6 @@ public class TableColumnFigure extends AbstractTableFigure {
public TableColumnFigure() {
ToolbarLayout toolbarLayout = new ToolbarLayout();
toolbarLayout.setSpacing(0);
setLayoutManager(toolbarLayout);
setOpaque(true);
}
......
......@@ -15,7 +15,6 @@ public class TableFigure extends AbstractTableFigure {
public TableFigure() {
ToolbarLayout toolbarLayout = new ToolbarLayout();
toolbarLayout.setHorizontal(true);
toolbarLayout.setStretchMinorAxis(false);
setLayoutManager(toolbarLayout);
setOpaque(true);
}
......@@ -25,7 +24,7 @@ public class TableFigure extends AbstractTableFigure {
Rectangle r = getClientArea();
g.setForegroundColor(getForegroundColor());
// 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);
super.paintBorder(g);
}
......
......@@ -4,11 +4,14 @@ import java.beans.PropertyChangeEvent;
import java.util.List;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Label;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gef.EditPolicy;
import org.eclipse.swt.graphics.RGB;
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.editpolicy.AppDeletePolicy;
import de.bmotionstudio.gef.editor.editpolicy.BMotionNodeEditPolicy;
......@@ -22,7 +25,15 @@ public class BTablePart extends AppAbstractEditPart {
@Override
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
......@@ -54,7 +65,7 @@ public class BTablePart extends AppAbstractEditPart {
figure.getParent().setConstraint(
figure,
new Rectangle(control.getLocation().x, control.getLocation().y,
width + 1, (rows * 20) + 15));
width + 21, (rows * 20) + 15));
// 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