Project

General

Profile

« Previous | Next » 

Revision cc4e78d1

Added by Katja Luther over 5 years ago

ref #7793: add preference to set checklist perspective as default

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/databaseAdmin/preferencePage/GeneralAdminPreferencePage.java
36 36

  
37 37

  
38 38
    boolean isShowIOMenu = true;
39
    boolean isShowMediaView = true;
40
    boolean isShowCheckListPerspective = false;
39 41
    /**
40 42
     * {@inheritDoc}
41 43
     */
......
53 55
            if (isShowSpecimenPref != null){
54 56
                this.isShowIOMenu = Boolean.valueOf(isShowSpecimenPref.getValue());
55 57
            }
58

  
59
            key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.ShowMediaView);
60
            CdmPreference isShowMediaViewPref = service.find(key);
61
            if (isShowMediaViewPref != null){
62
                this.isShowMediaView = Boolean.valueOf(isShowMediaViewPref.getValue());
63
            }
64

  
65
            key = CdmPreference.NewKey(PreferenceSubject.NewDatabaseInstance(), PreferencePredicate.ShowChecklistPerspective);
66
            CdmPreference isShowChecklistPref = service.find(key);
67
            if (isShowChecklistPref != null){
68
                this.isShowCheckListPerspective = Boolean.valueOf(isShowChecklistPref.getValue());
69
            }
56 70
        }
57 71
        final Button showIOMenuButton = new Button(composite, SWT.CHECK);
58 72

  
......
66 80

  
67 81
              }
68 82
         });
83

  
84
        final Button showMediaViewButton = new Button(composite, SWT.CHECK);
85

  
86
        showMediaViewButton.setText(Messages.DatabasePreferncesPage_Show_MediaView);
87

  
88
        showMediaViewButton.setSelection(isShowMediaView);
89
        showMediaViewButton.addSelectionListener(new SelectionAdapter(){
90
             @Override
91
             public void widgetSelected(SelectionEvent e) {
92
                 isShowMediaView = showIOMenuButton.getSelection();
93

  
94
              }
95
         });
96
        final Button showChecklistPerspectiveButton = new Button(composite, SWT.CHECK);
97

  
98
        showChecklistPerspectiveButton.setText(Messages.DatabasePreferncesPage_Show_ChecklistPerspective);
99

  
100
        showChecklistPerspectiveButton.setSelection(isShowCheckListPerspective);
101
        showChecklistPerspectiveButton.addSelectionListener(new SelectionAdapter(){
102
             @Override
103
             public void widgetSelected(SelectionEvent e) {
104
                 isShowCheckListPerspective = showChecklistPerspectiveButton.getSelection();
105

  
106
              }
107
         });
108

  
69 109
        return composite;
70 110
    }
71 111

  
......
84 124
           CdmPreference pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowImportExportMenu, Boolean.toString(this.isShowIOMenu));
85 125
           pref.setAllowOverride(false);
86 126
           service.set(pref);
127
           pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowMediaView, Boolean.toString(this.isShowMediaView));
128
           pref.setAllowOverride(false);
129
           service.set(pref);
130
           pref = CdmPreference.NewDatabaseInstance(PreferencePredicate.ShowChecklistPerspective, Boolean.toString(this.isShowCheckListPerspective));
131
           pref.setAllowOverride(false);
132
           service.set(pref);
87 133
           PreferencesUtil.updateDBPreferences();
88 134

  
89 135

  

Also available in: Unified diff