use of org.yakindu.sct.model.sruntime.ExecutionOperation in project statecharts by Yakindu.
the class ExecutionContextLabelProvider method updateNameCell.
private void updateNameCell(ViewerCell cell) {
Object element = cell.getElement();
if (element instanceof ExecutionEvent) {
ExecutionEvent event = (ExecutionEvent) element;
cell.setText(event.getName());
StyleRange style1 = new StyleRange();
style1.start = 0;
style1.length = event.getName().length();
style1.underline = true;
style1.foreground = ColorConstants.lightBlue;
cell.setText(event.getName());
cell.setStyleRanges(new StyleRange[] { style1 });
if (event.isRaised()) {
cell.setImage(SimulationImages.EVENT_ENABLED.image());
} else if (event.getName().contains("time_event")) {
cell.setImage(SimulationImages.TIMEEVENT.image());
} else {
cell.setImage(SimulationImages.EVENT_DISABLED.image());
}
} else if (element instanceof ExecutionOperation) {
ExecutionVariable variable = (ExecutionVariable) element;
cell.setText(variable.getName());
cell.setImage(SimulationImages.OPERATION.image());
} else if (element instanceof ExecutionVariable) {
ExecutionVariable variable = (ExecutionVariable) element;
cell.setText(variable.getName());
if (((ExecutionVariable) element).isWritable())
cell.setImage(SimulationImages.VARIABLE.image());
else
cell.setImage(SimulationImages.VARIABLE_LOCK.image());
} else if (element instanceof CompositeSlot) {
cell.setText(((CompositeSlot) element).getName());
cell.setImage(SimulationImages.SCOPE.image());
}
}
Aggregations