int editor = model.getEditorType(); removeEditor();
    public void onDataObjectSave(DataObject data, int operation)    {        int state = model.getState();        if (operation == REMOVE_OBJECT && state != SAVE)            throw new IllegalStateException("This method can only be " +                    "invoked in the SAVE state");        switch (state) {            case DISCARDED:                throw new IllegalStateException("This method cannot be " +                        "invoked in the DISCARDED state");        }        if (data == null)             throw new IllegalArgumentException("No data object. ");        switch (operation) {            case CREATE_OBJECT:            case UPDATE_OBJECT:             case REMOVE_OBJECT:                  break;            default:                throw new IllegalArgumentException("Save operation not " +                        "supported.");        }            int editor = model.getEditorType();        removeEditor(); //remove the currently selected editor.        if (operation == REMOVE_OBJECT) {            model.setState(READY);            fireStateChange();        }        view.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));        Browser browser = model.getSelectedBrowser();        browser.refreshEdition(data, operation);        if (operation == UPDATE_OBJECT) {            Map browsers = model.getBrowsers();            Iterator i = browsers.keySet().iterator();            while (i.hasNext()) {                browser = (Browser) browsers.get(i.next());                if (!(browser.equals(model.getSelectedBrowser())))                    browser.refreshEdition(data, operation);            }        }        if (editor == CREATE_EDITOR) {            PropertiesCmd cmd = new PropertiesCmd(this);            cmd.execute();        }        setStatus(false, "", true);        view.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));    }