@Override public void setModel(MItem item) { if (!(item instanceof MHandledItem)) { throw new IllegalArgumentException("Only instances of MHandledItem are allowed"); //$NON-NLS-1$ } super.setModel(item); generateCommand(); if (getModel().getCommand() == null) { if (logger != null) { logger.error("Element " + getModel().getElementId() + " invalid, no command defined."); //$NON-NLS-1$ //$NON-NLS-2$ } } }
public void setModel(MHandledItem item) { model = item; setId(model.getElementId()); generateCommand(); if (model.getCommand() == null) { if (logger != null) { logger.error("Element " + model.getElementId() + " invalid, no command defined."); //$NON-NLS-1$ //$NON-NLS-2$ } } updateVisible(); }
private String getToolTipText() { String text = model.getLocalizedTooltip(); ParameterizedCommand parmCmd = model.getWbCommand(); if (parmCmd == null) { generateCommand(); parmCmd = model.getWbCommand(); } if (parmCmd != null && text == null) { try { text = parmCmd.getName(); } catch (NotDefinedException e) { return null; } } TriggerSequence sequence = bindingService.getBestSequenceFor(parmCmd); if (sequence != null) { text = text + " (" + sequence.format() + ')'; //$NON-NLS-1$ } return text; }
private String getToolTipText(boolean attachKeybinding) { String text = getModel().getLocalizedTooltip(); ParameterizedCommand parmCmd = getModel().getWbCommand(); if (parmCmd == null) { generateCommand(); parmCmd = getModel().getWbCommand(); } if (parmCmd != null && text == null) { try { text = parmCmd.getName(); } catch (NotDefinedException e) { return null; } } TriggerSequence sequence = bindingService.getBestSequenceFor(parmCmd); if (attachKeybinding && sequence != null) { text = text + " (" + sequence.format() + ')'; //$NON-NLS-1$ } return text; }