@Override public void setId(final String id) { super.setId(id); if (state != null) { state.setId(id); } }
/** * <p> * Adds a state to this command. This will add this state to the active * handler, if the active handler is an instance of {@link IObjectWithState}. * </p> * <p> * A single instance of {@link State} cannot be registered with multiple * commands. Each command requires its own unique instance. * </p> * * @param id * The identifier of the state to add; must not be * <code>null</code>. * @param state * The state to add; must not be <code>null</code>. * @since 3.2 */ @Override public void addState(final String id, final State state) { super.addState(id, state); state.setId(id); if (handler instanceof IObjectWithState) { ((IObjectWithState) handler).addState(id, state); } }
private void saveCurrentState(SelectInProgress selectInProgress) { State state = new State(); state.setValue(selectInProgress); state.setId(ID_SELECTS_IN_PROGRESS); addState(ID_SELECTS_IN_PROGRESS, state); }
/** * <p> * Adds a state to this command. This will add this state to the active * handler, if the active handler is an instance of {@link IObjectWithState}. * </p> * <p> * A single instance of {@link State} cannot be registered with multiple * commands. Each command requires its own unique instance. * </p> * * @param id * The identifier of the state to add; must not be * <code>null</code>. * @param state * The state to add; must not be <code>null</code>. * @since 3.2 */ @Override public void addState(final String id, final State state) { super.addState(id, state); state.setId(id); if (handler instanceof IObjectWithState) { ((IObjectWithState) handler).addState(id, state); } }
/** * <p> * Adds a state to this command. This will add this state to the active * handler, if the active handler is an instance of {@link IObjectWithState}. * </p> * <p> * A single instance of {@link State} cannot be registered with multiple * commands. Each command requires its own unique instance. * </p> * * @param id * The identifier of the state to add; must not be * <code>null</code>. * @param state * The state to add; must not be <code>null</code>. * @since 3.2 */ @Override public void addState(final String id, final State state) { super.addState(id, state); state.setId(id); if (handler instanceof IObjectWithState) { ((IObjectWithState) handler).addState(id, state); } }
state = (State) configurationElement .createExecutableExtension(stateAttributeName); state.setId(getId()); configurationElement = null;