return new ApplicationWorkbenchWindowAdvisor(configurer);
}
- /**
- * <p>getInitialWindowPerspectiveId</p>
- *
- * @return a {@link java.lang.String} object.
- */
@Override
public String getInitialWindowPerspectiveId() {
// if (PreferencesUtil.getBooleanValue(IPreferenceKeys.SHOW_CHECKLIST_PERSPECTIVE)){
private Throwable previousT;
@Override
- public void handle(StatusAdapter statusAdapter, int style)
- {
+ public void handle(StatusAdapter statusAdapter, int style){
if(statusAdapter.getStatus().matches(IStatus.ERROR)) {
@Override
public void focusLost(FocusEvent e) {
super.focusLost(e);
-
persistName();
}
};
getTaxonBase().setTitleCache((getTaxonBase().generateTitle()));
setDirty(false);
getNameViewer().getTextWidget().setEnabled(true);
-
}
}
@Override
public void initialize(IManagedForm form) {
// TODO Auto-generated method stub
-
}
@Override
public void dispose() {
if (getControl() != null) {
-
getControl().dispose();
}
}
TaxonNameEditorE4 editor = (TaxonNameEditorE4) activePart.getObject();
- Object selecteObject = selection.getFirstElement();
+ Object selectedObject = selection.getFirstElement();
- if(! (selecteObject instanceof Synonym)){
+ if(! (selectedObject instanceof Synonym)){
return ;
}
- Synonym synonym = (Synonym) selecteObject;
+ Synonym synonym = (Synonym) selectedObject;
HomotypicalGroup group = synonym.getHomotypicGroup();
private boolean isOpenInEditor = false;
private boolean success = true;
- /**
- * <p>Constructor for AbstractNewEntityWizard.</p>
- *
- * @param <T> a T object.
- */
@Inject
public NewTaxonNodeWizard(){
setWindowTitle(Messages.TaxonNodeWizardPage_new);
UpdateResult result;
TaxonNode parent = getParentEntity();
- Map<Language, LanguageString> nodes = ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).getMultiLanguageTextExcludedNotes();
+ Map<Language, LanguageString> notes = ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).getMultiLanguageTextExcludedNotes();
UUID refUuid = parent.getReference() != null? parent.getReference().getUuid(): null;
- TaxonNodeStatus status = null;
- if( ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).isUnplaced()){
- status = TaxonNodeStatus.UNPLACED;
- }else if( ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).isPlacementDoubtful()){
- status = TaxonNodeStatus.DOUBTFUL;
- }else if (((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).isExcluded()){
- status = TaxonNodeStatus.EXCLUDED;
- }
+ TaxonNodeStatus status = ((TaxonNodeDetailElement)taxonNodePage.getDetailElement()).getTaxonNodeStatus();
if (status == null){
- nodes = null;
+ notes = null;
}
result = CdmStore.getService(ITaxonNodeService.class).createNewTaxonNode(parent.getUuid(), taxon, refUuid, parent.getMicroReference(),
- status, nodes);
-
+ status, notes);
if (result.isOk()){
this.setEntity((TaxonNode)result.getCdmEntity());
// return null;
// }
-
- /**
- * <p>
- * openInEditor
- * </p>
- *
- * @return a boolean.
- */
public boolean openInEditor() {
return isOpenInEditor ;
}
this.isOpenInEditor = isOpenInEditor;
}
- /**
- * <p>openEmpty</p>
- *
- * @return a boolean.
- */
public boolean openEmpty(){
return openInEditor() && openEmptyEditor;
}
- /**
- * <p>getTaxonNode</p>
- *
- * @return a {@link eu.etaxonomy.cdm.model.taxon.TaxonNode} object.
- */
public TaxonNode getTaxonNode(){
if(generatedTaxonNodeUuid != null){
return CdmStore.getService(ITaxonNodeService.class).load(generatedTaxonNodeUuid);
this.wizardPageListener = wizardPageListener;
}
-
public boolean isSuccess() {
return success;
}
-
public void setSuccess(boolean success) {
this.success = success;
}
}
}
}
-
-
}
/**
* @author k.luther
* @since 23.01.2019
- *
*/
public class NewTaxonNodeWizardDialog extends WizardDialog {
private Button finishAndOpen;
private IWizard newTaxonNodeWizard;
- /**
- * @param parentShell
- * @param newWizard
- */
+
public NewTaxonNodeWizardDialog(Shell parentShell, IWizard newWizard) {
super(parentShell, newWizard);
newTaxonNodeWizard = newWizard;
finishAndOpen = createButton(parent, IDialogConstants.FINISH_ID,"Finish and Open", false);
finishAndOpen.addSelectionListener(new SelectionListener() {
- /*
- * @see SelectionListener.widgetSelected (SelectionEvent)
- */
@Override
public void widgetSelected(SelectionEvent e) {
((NewTaxonNodeWizard)newTaxonNodeWizard).setOpenInEditor(true);
finishPressed();
}
- /*
- * @see SelectionListener.widgetDefaultSelected(SelectionEvent)
- */
@Override
public void widgetDefaultSelected(SelectionEvent e) {
* Creates an empty <code>TaxonName</code> instance with the nomenclatural code
* currently set in preferences.
*
- * @return a {@link eu.etaxonomy.cdm.model.name.TaxonNameBase} object.
+ * @return the newly created {@link TaxonName}.
*/
public static TaxonName createEmptyName(){
return (TaxonName)nonViralNameParser.getNonViralNameInstance("", PreferencesUtil.getPreferredNomenclaturalCode());
public static String getStringValue(String name, boolean local) {
CdmPreference pref = getDBPreferenceValue(name);
- String prefValue = null;
boolean override = getOverrideForPreference(name);
return multiLanguageTextStatusNotes.getMultilanguageText();
}
- public boolean isExcluded() {
- return status == null? false : status.equals(TaxonNodeStatus.EXCLUDED);
- }
-
- public boolean isUnplaced() {
- return status == null? false : status.equals(TaxonNodeStatus.UNPLACED);
- }
-
- public boolean isPlacementDoubtful() {
- return status == null? false : status.equals(TaxonNodeStatus.DOUBTFUL);
- }
+ public TaxonNodeStatus getTaxonNodeStatus(){
+ return status;
+ }
public Reference getRef() {
return selection_Ref.getEntity();
}
- /** {@inheritDoc} */
@Override
public TaxonNodeDetailElement createElement(ICdmFormElement rootElement) {
TaxonNodeDetailElement detailElement = formFactory.createTaxonNodeDetailElement(rootElement, this.isCreateNew);
return detailElement;
}
-
-
- /** {@inheritDoc} */
@Override
public void propertyChange(PropertyChangeEvent event) {
checkComplete();
setPageComplete(false);
}
- /**
- * <p>
- * Getter for the field <code>parentTreeNode</code>.
- * </p>
- *
- * @return a {@link eu.etaxonomy.cdm.model.taxon.ITaxonTreeNode} object.
- */
public TaxonNode getParentTreeNode() {
- return ((TaxonNodeDetailElement) getDetailElement())
- .getParentTreeNode();
+ return ((TaxonNodeDetailElement) getDetailElement()).getParentTreeNode();
}
public CreateTaxonDTO createTaxon() {