import org.springframework.remoting.RemoteConnectFailureException;
import eu.etaxonomy.taxeditor.model.MessagingUtils;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
*/
@Override
public String getInitialWindowPerspectiveId() {
+ if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_CHECKLIST_PERSPECTIVE)){
+ return "eu.etaxonomy.taxeditor.perspective.checklistperspective";
+ }
+
return "eu.etaxonomy.taxeditor.application.perspective.taxonomic";
}
import org.eclipse.e4.ui.workbench.modeling.EModelService;
import org.eclipse.e4.ui.workbench.modeling.EPartService;
import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IPerspectiveRegistry;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.osgi.service.event.Event;
import eu.etaxonomy.taxeditor.model.IContextListener;
+import eu.etaxonomy.taxeditor.preference.IPreferenceKeys;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.store.CdmStore;
parent.getChildren().remove(part);
}
}
+
}
/**
public void contextStart(IMemento memento, IProgressMonitor monitor) {
PreferencesUtil.updateDBPreferences();
hideParts();
+ if (PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_CHECKLIST_PERSPECTIVE)){
+ IWorkbench workbench = PlatformUI.getWorkbench();
+ IWorkbenchWindow window = workbench
+ .getActiveWorkbenchWindow();
+
+ IPerspectiveRegistry registry = workbench.getPerspectiveRegistry();
+ IWorkbenchPage page = window.getActivePage();
+ page.setPerspective(registry.findPerspectiveWithId("eu.etaxonomy.taxeditor.perspective.checklistperspective"));
+ }
}
/**
public void createInitialLayout(IPageLayout layout) {
IFolderLayout navigationFolder = layout.createFolder("navigation",
IPageLayout.LEFT, 0.25f, layout.getEditorArea());
+//
+// navigationFolder.addView(NAVIGATOR);
+// navigationFolder.addPlaceholder(SEARCH_RESULTS);
+// navigationFolder.addPlaceholder(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DESCRIPTIVEDATASET_DESCRIPTIVEDATASETNAVIGATOR);
+//
+// IFolderLayout folder = layout.createFolder("Folder", IPageLayout.BOTTOM, 0.6f, layout.getEditorArea());
+// folder.addView(FACTUAL_DATA_VIEW);
+// folder.addView(DETAILS_VIEW);
+// folder.addView(MediaViewPart.ID);
+
+// createAdditionalFolder(layout, layout.getEditorArea());
+
navigationFolder.addView(NAVIGATOR);
- navigationFolder.addPlaceholder(SEARCH_RESULTS);
+ navigationFolder.addPlaceholder(SEARCH_RESULTS);
navigationFolder.addPlaceholder(AppModelId.PARTDESCRIPTOR_EU_ETAXONOMY_TAXEDITOR_EDITOR_DESCRIPTIVEDATASET_DESCRIPTIVEDATASETNAVIGATOR);
- IFolderLayout folder = layout.createFolder("Folder", IPageLayout.BOTTOM, 0.6f, layout.getEditorArea());
- folder.addView(FACTUAL_DATA_VIEW);
- folder.addView(DETAILS_VIEW);
-// folder.addView(MediaViewPart.ID);
+ layout.addPlaceholder(NAME_EDITOR, IPageLayout.BOTTOM, 0.25f, layout.getEditorArea());
+
+ layout.addView(DETAILS_VIEW, IPageLayout.RIGHT, 0.6f, layout.getEditorArea());
+ IFolderLayout supplementalFolder = layout.createFolder(SUPPLEMENTAL_VIEW+"stack", IPageLayout.BOTTOM, 0.6f, DETAILS_VIEW);
+ supplementalFolder.addView(SUPPLEMENTAL_VIEW);
+
+ supplementalFolder.addPlaceholder(REFERENCING_VIEW);
+
+ layout.addView(FACTUAL_DATA_VIEW, IPageLayout.BOTTOM, 0.6f, layout.getEditorArea());
+
+
+ createAdditionalFolder(layout, layout.getEditorArea());
-// createAdditionalFolder(layout, layout.getEditorArea());
}
}
import eu.etaxonomy.taxeditor.editor.view.checklist.listener.ChecklistModifyListener;
import eu.etaxonomy.taxeditor.model.IDirtyMarkable;
import eu.etaxonomy.taxeditor.model.IPartContentHasDetails;
-import eu.etaxonomy.taxeditor.model.IPartContentHasFactualData;
import eu.etaxonomy.taxeditor.preference.PreferencesUtil;
import eu.etaxonomy.taxeditor.preference.Resources;
import eu.etaxonomy.taxeditor.preference.wizard.AvailableDistributionWizard;
* @author k.luther
*
*/
-public class ChecklistEditorE4 implements IPartContentHasFactualData, IConversationEnabled,
+public class ChecklistEditorE4 implements IConversationEnabled,
IDirtyMarkable, IPartContentHasDetails, IE4SavablePart, IDistributionEditor{
private static final String DISTRIBUTION_EDITOR = "Distribution Editor";
boolean isShowIOMenu = true;
+ boolean isShowMediaView = true;
+ boolean isShowCheckListPerspective = false;
/**
* {@inheritDoc}
*/
if (isShowSpecimenPref != null){
this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
}
+
+ key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.ShowMediaView);
+ CdmPreference isShowMediaViewPref = service.find(key);
+ if (isShowMediaViewPref != null){
+ this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
+ }
+
+ key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.ShowChecklistPerspective);
+ CdmPreference isShowChecklistPref = service.find(key);
+ if (isShowChecklistPref != null){
+ this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
+ }
}
final Button showIOMenuButton = new Button(composite, SWT.CHECK);
}
});
+
+ final Button showMediaViewButton = new Button(composite, SWT.CHECK);
+
+ showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
+
+ showMediaViewButton.setSelection(isShowMediaView);
+ showMediaViewButton.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ isShowMediaView = showIOMenuButton.getSelection();
+
+ }
+ });
+ final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
+
+ showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
+
+ showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
+ showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
+
+ }
+ });
+
return composite;
}
CdmPreference pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowImportExportMenu, Boolean.toString(this.isShowIOMenu));
pref.setAllowOverride(false);
service.set(pref);
+ pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowMediaView, Boolean.toString(this.isShowMediaView));
+ pref.setAllowOverride(false);
+ service.set(pref);
+ pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowChecklistPerspective, Boolean.toString(this.isShowCheckListPerspective));
+ pref.setAllowOverride(false);
+ service.set(pref);
PreferencesUtil.updateDBPreferences();
public static String Distribution_status_selection;
+
+ public static String DatabasePreferncesPage_Show_MediaView;
+
+
+ public static String DatabasePreferncesPage_Show_ChecklistPerspective;
+
static {
// initialize resource bundle
NLS.initializeMessages(BUNDLE_NAME, Messages.class);
SpecimenConfiguration_description=Select whether you want to edit specimen related data and how they should be displayed.
DatabasePreferncesPage_Show_IOMenu=Show Import/Export menu entries
Distribution_status_selection=Status Selection
+DatabasePreferncesPage_Show_MediaView=Show Media View
+DatabasePreferncesPage_Show_ChecklistPerspective=Show Checklist Perspective as default Perspective
\ No newline at end of file
SpecimenConfiguration_description=Wählen Sie aus, ob sie specimenbezogene Daten editieren wollen und wie diese angezeigt werden sollen.
DatabasePreferncesPage_Show_IOMenu=Zeige Import/Export Menü Einträge an
Distribution_status_selection=Status Auswahl
+DatabasePreferncesPage_Show_MediaView=Zeige den Media View an
+DatabasePreferncesPage_Show_ChecklistPerspective=Zeige Checklist Perspektive als Default Perspektive an
public static final String FILTER_COMMON_NAME_REFERENCES = "eu.etaxonomy.taxeditor.references.selection.filterCommonNameReferences";
public static final String SHOW_IO_MENU = "eu.etaxonomy.taxeditor.menu.showIO";
+ public static final String SHOW_MEDIA = "eu.etaxonomy.taxeditor.view.showMedia";
+ public static final String SHOW_CHECKLIST_PERSPECTIVE = "eu.etaxonomy.taxeditor.perspective.showChecklist";
+
prefStore.setValue(SHOW_IO_MENU, preference.getValue());
}
}
+
+ preference = getPreferenceFromDB(PreferencePredicate.ShowMediaView);
+ if (preference != null){
+ if(!prefStore.getBoolean(SHOW_MEDIA) || !preference.isAllowOverride()){
+ prefStore.setValue(SHOW_MEDIA, preference.getValue());
+ }
+ }
+
+ preference = getPreferenceFromDB(PreferencePredicate.ShowChecklistPerspective);
+ if (preference != null){
+ if(!prefStore.getBoolean(SHOW_CHECKLIST_PERSPECTIVE) || !preference.isAllowOverride()){
+ prefStore.setValue(SHOW_CHECKLIST_PERSPECTIVE, preference.getValue());
+ }
+ }
+
//Specimen Details
preference = getPreferenceFromDB(PreferencePredicate.ShowSpecimen);
if (preference != null){