minor changes in admin name details view configuration
authorKatja Luther <k.luther@bgbm.org>
Wed, 5 Jul 2017 13:24:54 +0000 (15:24 +0200)
committerPatrick Plitzner <p.plitzner@bgbm.org>
Thu, 6 Jul 2017 12:55:26 +0000 (14:55 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/AbstractPreferenceWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/DatabasePreferencesPage.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/wizard/NameDetailsViewComposite.java

index ff1efcaeeb6dff077baf500e05f2ea2942dc9fd2..c874b8fb286c3e9649491048dc91312c2486d717 100755 (executable)
@@ -41,14 +41,14 @@ public abstract class AbstractPreferenceWizard extends WizardPage {
              if (composite == null) {
                  composite = new Composite(getShell(), SWT.NONE);
              }
-             tabFolder = new TabFolder(composite, SWT.NONE);
+             tabFolder = new TabFolder(composite, SWT.NULL);
              tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
          }
 
          TabItem item = new TabItem(tabFolder, SWT.NONE);
          item.setText(text);
 
-         Composite currentTab = new Composite(tabFolder, SWT.NULL);
+         Composite currentTab = new Composite(tabFolder, SWT.NONE);
          GridLayout layout = new GridLayout();
          currentTab.setLayout(layout);
          currentTab.setFont(composite.getFont());
index 6f3ac0ccabd61419bec71c3e34bc7096d2b9f387..b1dbdd7f39fa2491f07c340b1abacc49bc468964 100755 (executable)
@@ -168,6 +168,7 @@ public class DatabasePreferencesPage extends AbstractPreferenceWizard implements
 
     public void createNameDetailsViewConfigurationTab(Composite parent, NameDetailsConfigurator config){
         composite = parent;
+        
         composite = addTab(Messages.DatabasePreferencesPage_details_view_configuration);
         GridLayout gridLayout = new GridLayout();
         gridLayout.numColumns = 2;
index b9d06fd1b0343e22d24eec7726b28112d0828caf..06d5dd99c7eb1f81542c8e682d2ad3c384f241c3 100755 (executable)
@@ -12,6 +12,7 @@ import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
 import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Button;
 import org.eclipse.swt.widgets.Composite;
@@ -43,11 +44,12 @@ public class NameDetailsViewComposite extends Composite {
     boolean isShowProtologue;
     boolean isShowTypeDesignation;
     boolean isShowNameRelationship;
+    boolean isShowHybrid;
     Composite child;
 
     public NameDetailsViewComposite(Composite parent, int style, NameDetailsConfigurator config){
 
-        super(parent, style);
+        super(parent, SWT.NONE);
 //        TabItem tbtmNameDetailsConfiguration = new TabItem(tabFolder, SWT.NONE);
 //        Composite c2 = new Composite(tabFolder, SWT.BORDER);
 //        c2.setLayout(new GridLayout(1, true));
@@ -56,10 +58,11 @@ public class NameDetailsViewComposite extends Composite {
        this.config = config;
 
       // Composite composite = new Composite(parent, SWT.NULL);
+       
        this.setLayout(new GridLayout());
-
        isSimpleDetailsViewActivated= PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION);
        final Button activateCheckButton = new Button(this, SWT.CHECK);
+       activateCheckButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true, 1, 1));
        activateCheckButton.setText("Show only a simple name details view");
        activateCheckButton.setSelection(isSimpleDetailsViewActivated);
        activateCheckButton.addSelectionListener(new SelectionAdapter(){
@@ -78,6 +81,7 @@ public class NameDetailsViewComposite extends Composite {
         });
 
        child = new Composite(this, SWT.NULL);
+      
        child.setLayout(new GridLayout());
        child.setVisible(isSimpleDetailsViewActivated);
 
@@ -246,6 +250,19 @@ public class NameDetailsViewComposite extends Composite {
 
              }
         });
+       
+       final Button showHybrid = new Button(child, SWT.CHECK);
+       isShowHybrid = PreferencesUtil.getPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID);
+       showHybrid.setText("Show hybrid section");
+       showHybrid.setSelection(isShowHybrid);
+       showHybrid.addSelectionListener(new SelectionAdapter(){
+            @Override
+            public void widgetSelected(SelectionEvent e) {
+                isShowHybrid = showHybrid.getSelection();
+
+             }
+        });
+       this.redraw();
 
        if(isSimpleDetailsViewActivated){
            child.setEnabled(true);
@@ -276,6 +293,7 @@ public class NameDetailsViewComposite extends Composite {
       config.setSimpleDetailsViewActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_SECTION));
       config.setTaxonSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_SIMPLE_NAME_DETAILS_TAXON));
       config.setTypeDesignationSectionActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_TYPE_DESIGNATION));
+      config.setHybridActivated(doGetPreferenceStore().getBoolean(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID));
       return config;
    }
 
@@ -310,6 +328,8 @@ public class NameDetailsViewComposite extends Composite {
                 isShowTypeDesignation);
         PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_NAME_RELATIONSHIP,
                 isShowNameRelationship);
+        PreferencesUtil.getPreferenceStore().setValue(IPreferenceKeys.SHOW_NAME_DETAILS_SECTION_HYBRID,
+                isShowHybrid);
 
     }