protected void updateState() { OWLClass selectedClass = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); setEnabled(selectedClass != null); }
/** * The initialise method is called at the start of a * plugin instance life cycle. * This method is called to give the plugin a chance * to intitialise itself. All plugin initialisation * should be done in this method rather than the plugin * constructor, since the initialisation might need to * occur at a point after plugin instance creation, and * a each plugin must have a zero argument constructor. */ final public void initialise() throws Exception { listener = () -> updateState(); getOWLWorkspace().getOWLSelectionModel().addListener(listener); updateState(); }
@Nullable protected OWLClass getOWLClass() { return getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); }
public void selectionChanged() throws Exception { updateState(); } };
@Nullable protected OWLClass getOWLClass() { return getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); }
public void selectionChanged() throws Exception { updateState(); } };
protected void updateState() { OWLClass selectedClass = getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); setEnabled(selectedClass != null); }
/** * The initialise method is called at the start of a * plugin instance life cycle. * This method is called to give the plugin a chance * to intitialise itself. All plugin initialisation * should be done in this method rather than the plugin * constructor, since the initialisation might need to * occur at a point after plugin instance creation, and * a each plugin must have a zero argument constructor. */ final public void initialise() throws Exception { listener = () -> updateState(); getOWLWorkspace().getOWLSelectionModel().addListener(listener); updateState(); }
/** * This method is called at the end of a plugin * life cycle, when the plugin needs to be removed * from the system. Plugins should remove any listeners * that they setup and perform other cleanup, so that * the plugin can be garbage collected. */ public void dispose() { if (listener != null) { getOWLWorkspace().getOWLSelectionModel().removeListener(listener); } } }
protected void updateState() { OWLSelectionModel selectionModel = getOWLWorkspace().getOWLSelectionModel(); Optional<OWLClass> selectedEntity = new OWLEntitySelectionModel(selectionModel).getSelectedClass(); setEnabled(selectedEntity.isPresent()); }
/** * The initialise method is called at the start of a * plugin instance life cycle. * This method is called to give the plugin a chance * to intitialise itself. All plugin initialisation * should be done in this method rather than the plugin * constructor, since the initialisation might need to * occur at a point after plugin instance creation, and * a each plugin must have a zero argument constructor. */ final public void initialise() throws Exception { listener = new OWLSelectionModelListener() { public void selectionChanged() throws Exception { updateState(); } }; getOWLWorkspace().getOWLSelectionModel().addListener(listener); updateState(); }
protected OWLClass getOWLClass() { return getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); }
protected void updateState() { OWLSelectionModel selectionModel = getOWLWorkspace().getOWLSelectionModel(); Optional<OWLClass> selectedEntity = new OWLEntitySelectionModel(selectionModel).getSelectedClass(); setEnabled(selectedEntity.isPresent()); }
/** * The initialise method is called at the start of a * plugin instance life cycle. * This method is called to give the plugin a chance * to intitialise itself. All plugin initialisation * should be done in this method rather than the plugin * constructor, since the initialisation might need to * occur at a point after plugin instance creation, and * a each plugin must have a zero argument constructor. */ final public void initialise() throws Exception { listener = new OWLSelectionModelListener() { public void selectionChanged() throws Exception { updateState(); } }; getOWLWorkspace().getOWLSelectionModel().addListener(listener); updateState(); }
/** * This method is called at the end of a plugin * life cycle, when the plugin needs to be removed * from the system. Plugins should remove any listeners * that they setup and perform other cleanup, so that * the plugin can be garbage collected. */ public void dispose() { if (listener != null) { getOWLWorkspace().getOWLSelectionModel().removeListener(listener); } } }
/** * This method is called at the end of a plugin * life cycle, when the plugin needs to be removed * from the system. Plugins should remove any listeners * that they setup and perform other cleanup, so that * the plugin can be garbage collected. */ public void dispose() { if (listener != null) { getOWLWorkspace().getOWLSelectionModel().removeListener(listener); } } }
/** * This method is called at the end of a plugin * life cycle, when the plugin needs to be removed * from the system. Plugins should remove any listeners * that they setup and perform other cleanup, so that * the plugin can be garbage collected. */ public void dispose() { if (listener != null) { getOWLWorkspace().getOWLSelectionModel().removeListener(listener); } } }
protected OWLClass getOWLClass() { return getOWLWorkspace().getOWLSelectionModel().getLastSelectedClass(); }