Skip to content
Snippets Groups Projects
Commit b15facfd authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

bugfix

refs 1612
parent 3a5beaff
No related branches found
No related tags found
No related merge requests found
......@@ -106,7 +106,7 @@ import org.fortiss.tooling.kernel.ui.service.IEditPartFactoryService;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating YELLOW Hash: 9E72ED3F824111F92720F85EF823E3DF
* @ConQAT.Rating YELLOW Hash: C4D39F316D63A63B989D0D26178C9793
*/
public class DiagramEditorBase<T extends EObject> extends GEFEditorBase<T> implements
IPostSelectionProvider, ContextMenuContextProvider {
......@@ -129,29 +129,28 @@ public class DiagramEditorBase<T extends EObject> extends GEFEditorBase<T> imple
/** A container for editor actions */
private final ActionRegistry actionRegistry = new ActionRegistry();
/** A counter for the selection of connectors. */
private int connectorsSelectionCount;
/** A counter for the selection of hierarchic elements. */
private int hierarchicElementssSelectionCount;
/** The number of times the hints about creating connections should be displayed. */
private static final int HINTS_COUNT = 2;
/** Selection listener used to update selection actions. */
private final ISelectionListener selectionListener = new ISelectionListener() {
/** A counter for the selection. */
private int selectionCount = 0;
/** The number of times the hints about creating connections should be displayed. */
private final int HINTS_COUNT = 4;
@Override
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
EditPart ep = SelectionUtils.checkAndPickFirstSafe(selection, EditPart.class);
if(ep != null) {
Control control = ep.getViewer().getControl();
if(ep.getModel() instanceof IConnector && connectorsSelectionCount < HINTS_COUNT) {
if(ep.getModel() instanceof IConnector && selectionCount < HINTS_COUNT) {
control.setToolTipText("Link two connectors by pressing ALT and dragging from source to target.");
connectorsSelectionCount++;
selectionCount++;
} else if(ep.getModel() instanceof IHierarchicElement &&
hierarchicElementssSelectionCount < HINTS_COUNT) {
selectionCount < HINTS_COUNT) {
control.setToolTipText("Create a connection by pressing ALT and dragging.");
hierarchicElementssSelectionCount++;
selectionCount++;
} else {
control.setToolTipText("");
}
}
updateActions(selectionActions);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment