use of com.archimatetool.model.ILineObject in project archi by archimatetool.
the class LineColorAction method run.
@Override
public void run() {
List<?> selection = getSelectedObjects();
ILineObject model = (ILineObject) getFirstValidSelectedModelObject(selection);
if (model == null) {
return;
}
ColorDialog colorDialog = new ColorDialog(getWorkbenchPart().getSite().getShell());
// Set default RGB on first selected object
RGB defaultRGB = null;
String s = model.getLineColor();
if (s != null) {
defaultRGB = ColorFactory.convertStringToRGB(s);
}
if (defaultRGB != null) {
colorDialog.setRGB(defaultRGB);
} else {
colorDialog.setRGB(new RGB(0, 0, 0));
}
RGB newColor = colorDialog.open();
if (newColor != null) {
execute(createCommand(selection, newColor));
}
}
Aggregations