private void setTargetInternal(Object item) { // the target of description will always be set directly by tabtodo description.setTarget(item); Wizard w = null; if (item instanceof ToDoItem) { w = ((ToDoItem) item).getWizard(); } if (w != null) { showStep(w.getCurrentPanel()); } else { showDescription(); } updateActionsEnabled(item); }
/* * @see org.argouml.cognitive.critics.Critic#initWizard( * org.argouml.cognitive.ui.Wizard) */ public void initWizard(Wizard w) { if (w instanceof WizMEName) { ToDoItem item = (ToDoItem) w.getToDoItem(); Object me = item.getOffenders().get(0); String sug = computeSuggestion(Model.getFacade().getName(me)); String ins = super.getInstructions(); ((WizMEName) w).setInstructions(ins); ((WizMEName) w).setSuggestion(sug); } }
public void initWizard(Wizard w) { if (w instanceof WizMEName) { ToDoItem item = w.getToDoItem(); MModelElement me = (MModelElement) item.getOffenders().elementAt(0); String sug = me.getName(); String ins = "Change the name to something different."; ((WizMEName)w).setInstructions(ins); ((WizMEName)w).setSuggestion(sug); ((WizMEName)w).setMustEdit(true); } }
/* * @see org.argouml.cognitive.critics.Critic#initWizard( * org.argouml.cognitive.ui.Wizard) */ public void initWizard(Wizard w) { if (w instanceof WizMEName) { ToDoItem item = (ToDoItem) w.getToDoItem(); Object me = item.getOffenders().get(0); String ins = super.getInstructions(); String sug = super.getDefaultSuggestion(); if (Model.getFacade().isAAttribute(me)) { Object a = me; int count = 1; if (Model.getFacade().getOwner(a) != null) count = Model.getFacade().getFeatures(Model.getFacade().getOwner(a)).size(); sug = "attr" + (count + 1); } ((WizMEName) w).setInstructions(ins); ((WizMEName) w).setSuggestion(sug); } }