Project

General

Profile

« Previous | Next » 

Revision 6940e7af

Added by Patrick Plitzner over 7 years ago

Delete unused class
I81n for store plugin

View differences:

eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/bundle.properties
1
#Properties file for eu.etaxonomy.taxeditor.store
2
page.name = Taxonomic Editor
3
page.name.0 = Description
4
page.name.1 = Features
5
page.name.2 = Distribution Status
6
page.name.3 = Taxonomic
7
page.name.4 = Nomenclatural Code
8
page.name.5 = Ranks
9
page.name.6 = Nomenclatural Status
10
page.name.7 = Name Relationships
11
page.name.8 = Concept Relationships
12
page.name.9 = Type Designation (Specimen)
13
page.name.10 = Available Languages
14
page.name.11 = Marker
15
page.name.12 = Extension Types
16
page.name.13 = Type Designation (Name)
17
page.name.14 = Named Area Type
18
page.name.15 = Matching (Experimental)
19
page.name.16 = Taxon Name Matching Strategy
20
page.name.17 = Reference Matching Strategy
21
page.name.18 = Team or Person Matching Strategy
22
page.name.19 = Stage
23
page.name.20 = Preservation Method
24
page.name.21 = Feature Tree
25
page.name.22 = Default Feature Trees
26
page.name.23 = Representation
27
page.name.24 = Mobot Open Url
28
page.name.25 = Type Designations
29
view.name = Datasource
30
view.name.0 = Progress
31
view.name.1 = Message
32
view.name.2 = Reporting
33
view.name.3 = Supplemental Data
34
view.name.4 = Details
35
view.name.5 = Use Records
36
view.name.6 = Derivative Search
37
editor.name = Defined Term Editor
38
menu.label = Show View
39
command.label = Derivative Search
40
command.label.0 = Details
41
command.label.1 = Supplemental
42
command.label.2 = Datasource
43
command.label.3 = Error Log
44
command.label.4 = Reporting
45
command.label.5 = Switch User
46
command.label.6 = Connect
47
command.label.7 = New
48
command.label.8 = Edit
49
command.label.9 = Delete
50
command.label.10 = Close Active Connection
51
command.label.11 = Update Datamodel
52
menu.label.0 = New
53
command.label.12 = Vocabulary
54
command.label.13 = Defined Term
55
command.label.14 = Delete
56
extension.name = Popup Menu Commands
57
command.name = Connect Datasource
58
command.name.0 = Edit Datasource
59
command.name.1 = Create Datasource
60
command.name.2 = Close Active Connection
61
command.name.3 = Update Datasource
62
command.name.4 = Show Login Window
63
command.name.5 = Open Defined Term Editor
64
commandParameter.name = inputType
65
commandParameter.name.0 = inputType
66
command.name.6 = New Defined Term
67
command.name.7 = New Term Vocabulary
68
category.name = CDM
69
wizard.name = TCS
70
wizard.name.0 = Berlin Model
71
wizard.name.1 = Endnote
72
wizard.name.2 = Excel Normal Explicit Taxa
73
wizard.name.3 = ABCD
74
wizard.name.4 = SDD
75
wizard.name.5 = Specimen CDM Excel
76
category.name.0 = CDM
77
wizard.name.6 = JAXB
78
wizard.name.7 = Berlin Model
79
category.name.1 = Excel
80
wizard.name.8 = SDD
81
wizard.name.9 = DwC-A
82
wizard.name.10 = Reference
83
wizard.name.11 = Name
84
wizard.name.12 = Team
85
wizard.name.13 = Person
86
wizard.name.14 = Specimen
87
wizard.name.15 = Polytomous Key
88
category.name.2 = CDM
89
wizard.name.16 = Taxon
90
wizard.name.17 = Classification
91
themeElementCategory.label = Taxonomic Editor
92
themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor
93
colorDefinition.label = List Background
94
colorDefinition.label.0 = Global Text Color
95
colorDefinition.label.1 = Global Color Composite Background
96
colorDefinition.label.2 = Global Color Composite Irrelevant
97
colorDefinition.label.3 = Global Text Color Disabled
98
colorDefinition.label.4 = Global Background Color Disabled
99
themeElementCategory.label.0 = Details View
100
themeElementCategory.description.0 = Colors and fonts for the details view
101
colorDefinition.label.5 = Entity Element List Background Odd
102
colorDefinition.label.6 = Entity Element List Background Even
103
themeElementCategory.label.1 = Name Editor
104
themeElementCategory.description.1 = Colors and fonts for the name editor
105
colorDefinition.label.7 = Container Background
106
colorDefinition.label.8 = Container Selected Focus
107
colorDefinition.label.9 = Container Selected
108
colorDefinition.label.10 = Container Drag Enter
109
fontDefinition.label = Accepted Taxon Font
110
fontDefinition.label.0 = Synonym Font
111
fontDefinition.label.1 = Misapplication Font
112
fontDefinition.label.2 = Concept Font
113
fontDefinition.label.3 = Default Font
114
themeElementCategory.label.2 = Search View
115
themeElementCategory.description.2 = Colors and fonts for the search view
116
colorDefinition.label.11 = Search View Foreground
117
colorDefinition.label.12 = Search View Focus
118
fontDefinition.label.4 = Accepted font
119
fontDefinition.description = The font that is used for accepted taxa in the search result list.
120
fontDefinition.label.5 = Synonym font
121
fontDefinition.description.0 = The font that is used for synonyms in the search result list.
122
fontDefinition.label.6 = Other font
123
fontDefinition.description.1 = The font used by default in the search result list.
124
colorDefinition.label.13 = Parse Error
125
colorDefinition.label.14 = Disabled Name Editor Field
126
colorDefinition.label.15 = Editor On Error
127
page.name.26 = Specimens and FieldUnits
128
page.name.27 = Media
129
page.name.28 = Checklist Editor
130
page.name.29 = Editor Profile
131
page.name.30 = Language
132
command.label.clone = Clone
133
command.label.openInSpecimenEditor = Open in Specimen Editor
134
page.name.31 = Order of Taxonnodes
135
extension.name.0 = Popup Menu Commands
136
command.name.8 = Clone Datasource
137
command.name.9 = Open Feature Tree Editor Wizard
138
command.name.10 = Open Password Wizard
139
command.name.11 = Open Distribution Editor Wizard
140
command.name.12 = Connect
141
wizard.name.18 = CSV
142
wizard.name.19 = CSV_NAME
143
wizard.name.20 = CSV_PRINT
144
activity.description = DELETE permission dependent ui contributions
145
activity.name = Delete
146
activity.description.0 = UPDATE permission dependent ui contributions
147
activity.name.0 = Update
148
activity.description.1 = CREATE permission dependent ui contributions
149
activity.name.1 = Delete
150
activity.description.2 = ROLE_USER_MANAGER dependent ui contributions
151
activity.name.2 = UserManagement
152
activity.description.3 = ROLE_PROJECT_MANAGER dependent ui contributions
153
activity.name.3 = ProjectManagement
154
Bundle-Vendor = EDIT
155
Bundle-Name = DataStore Bundle
156
command.name.13 = delete
157
command.name.14 = delete
158
page.name.32 = Taxon Navigator
159
page.name.33 = Sort of Taxonnodes
160
command.name.15 = Open
161
view.name.SESSIONS = Sessions
162
command.label.SESSION = Sessions
163
command.label.CONNECT = Connect
164
command.label.RE_CONNECT = Re-Connect
165
command.name.CONNECT = Connect
166
command.name.RE_CONNECT = Re-Connect
1
#Properties file for eu.etaxonomy.taxeditor.store

2
page.name = Taxonomic Editor

3
page.name.0 = Description

4
page.name.1 = Features

5
page.name.2 = Distribution Status

6
page.name.3 = Taxonomic

7
page.name.4 = Nomenclatural Code

8
page.name.5 = Ranks

9
page.name.6 = Nomenclatural Status

10
page.name.7 = Name Relationships

11
page.name.8 = Concept Relationships

12
page.name.9 = Type Designation (Specimen)

13
page.name.10 = Available Languages

14
page.name.11 = Marker

15
page.name.12 = Extension Types

16
page.name.13 = Type Designation (Name)

17
page.name.14 = Named Area Type

18
page.name.15 = Matching (Experimental)

19
page.name.16 = Taxon Name Matching Strategy

20
page.name.17 = Reference Matching Strategy

21
page.name.18 = Team or Person Matching Strategy

22
page.name.19 = Stage

23
page.name.20 = Preservation Method

24
page.name.21 = Feature Tree

25
page.name.22 = Default Feature Trees

26
page.name.23 = Representation

27
page.name.24 = Mobot Open Url

28
page.name.25 = Type Designations

29
view.name = Datasource

30
view.name.0 = Progress

31
view.name.1 = Message

32
view.name.2 = Reporting

33
view.name.3 = Supplemental Data

34
view.name.4 = Details

35
view.name.5 = Use Records

36
view.name.6 = Derivative Search

37
editor.name = Defined Term Editor

38
menu.label = Show View

39
command.label = Derivative Search

40
command.label.0 = Details

41
command.label.1 = Supplemental

42
command.label.2 = Datasource

43
command.label.3 = Error Log

44
command.label.4 = Reporting

45
command.label.5 = Switch User

46
command.label.6 = Connect

47
command.label.7 = New

48
command.label.8 = Edit

49
command.label.9 = Delete

50
command.label.10 = Close Active Connection

51
command.label.11 = Update Datamodel

52
menu.label.0 = New

53
command.label.12 = Vocabulary

54
command.label.13 = Defined Term

55
command.label.14 = Delete

56
extension.name = Popup Menu Commands

57
command.name = Connect Datasource

58
command.name.0 = Edit Datasource

59
command.name.1 = Create Datasource

60
command.name.2 = Close Active Connection

61
command.name.3 = Update Datasource

62
command.name.4 = Show Login Window

63
command.name.5 = Open Defined Term Editor

64
commandParameter.name = inputType

65
commandParameter.name.0 = inputType

66
command.name.6 = New Defined Term

67
command.name.7 = New Term Vocabulary

68
category.name = CDM

69
wizard.name = TCS

70
wizard.name.0 = Berlin Model

71
wizard.name.1 = Endnote

72
wizard.name.2 = Excel Normal Explicit Taxa

73
wizard.name.3 = ABCD

74
wizard.name.4 = SDD

75
wizard.name.5 = Specimen CDM Excel

76
category.name.0 = CDM

77
wizard.name.6 = JAXB

78
wizard.name.7 = Berlin Model

79
category.name.1 = Excel

80
wizard.name.8 = SDD

81
wizard.name.9 = DwC-A

82
wizard.name.10 = Reference

83
wizard.name.11 = Name

84
wizard.name.12 = Team

85
wizard.name.13 = Person

86
wizard.name.14 = Specimen

87
wizard.name.15 = Polytomous Key

88
category.name.2 = CDM

89
wizard.name.16 = Taxon

90
wizard.name.17 = Classification

91
themeElementCategory.label = Taxonomic Editor

92
themeElementCategory.description = Color and font definitions for the EDIT Taxonomic Editor

93
colorDefinition.label = List Background

94
colorDefinition.label.0 = Global Text Color

95
colorDefinition.label.1 = Global Color Composite Background

96
colorDefinition.label.2 = Global Color Composite Irrelevant

97
colorDefinition.label.3 = Global Text Color Disabled

98
colorDefinition.label.4 = Global Background Color Disabled

99
themeElementCategory.label.0 = Details View

100
themeElementCategory.description.0 = Colors and fonts for the details view

101
colorDefinition.label.5 = Entity Element List Background Odd

102
colorDefinition.label.6 = Entity Element List Background Even

103
themeElementCategory.label.1 = Name Editor

104
themeElementCategory.description.1 = Colors and fonts for the name editor

105
colorDefinition.label.7 = Container Background

106
colorDefinition.label.8 = Container Selected Focus

107
colorDefinition.label.9 = Container Selected

108
colorDefinition.label.10 = Container Drag Enter

109
fontDefinition.label = Accepted Taxon Font

110
fontDefinition.label.0 = Synonym Font

111
fontDefinition.label.1 = Misapplication Font

112
fontDefinition.label.2 = Concept Font

113
fontDefinition.label.3 = Default Font

114
themeElementCategory.label.2 = Search View

115
themeElementCategory.description.2 = Colors and fonts for the search view

116
colorDefinition.label.11 = Search View Foreground

117
colorDefinition.label.12 = Search View Focus

118
fontDefinition.label.4 = Accepted font

119
fontDefinition.description = The font that is used for accepted taxa in the search result list.

120
fontDefinition.label.5 = Synonym font

121
fontDefinition.description.0 = The font that is used for synonyms in the search result list.

122
fontDefinition.label.6 = Other font

123
fontDefinition.description.1 = The font used by default in the search result list.

124
colorDefinition.label.13 = Parse Error

125
colorDefinition.label.14 = Disabled Name Editor Field

126
colorDefinition.label.15 = Editor On Error

127
page.name.26 = Specimens and FieldUnits

128
page.name.27 = Media

129
page.name.28 = Checklist Editor

130
page.name.29 = Editor Profile

131
page.name.30 = Language

132
command.label.clone = Clone

133
command.label.openInSpecimenEditor = Open in Specimen Editor

134
page.name.31 = Order of Taxonnodes

135
extension.name.0 = Popup Menu Commands

136
command.name.8 = Clone Datasource

137
command.name.9 = Open Feature Tree Editor Wizard

138
command.name.10 = Open Password Wizard

139
command.name.11 = Open Distribution Editor Wizard

140
command.name.12 = Connect

141
wizard.name.18 = CSV

142
wizard.name.19 = CSV_NAME

143
wizard.name.20 = CSV_PRINT

144
activity.description = DELETE permission dependent ui contributions

145
activity.name = Delete

146
activity.description.0 = UPDATE permission dependent ui contributions

147
activity.name.0 = Update

148
activity.description.1 = CREATE permission dependent ui contributions

149
activity.name.1 = Delete

150
activity.description.2 = ROLE_USER_MANAGER dependent ui contributions

151
activity.name.2 = UserManagement

152
activity.description.3 = ROLE_PROJECT_MANAGER dependent ui contributions

153
activity.name.3 = ProjectManagement

154
Bundle-Vendor = EDIT

155
Bundle-Name = DataStore Bundle

156
command.name.13 = delete

157
command.name.14 = delete

158
page.name.32 = Taxon Navigator

159
page.name.33 = Sort of Taxonnodes

160
command.name.15 = Open

161
view.name.SESSIONS = Sessions

162
command.label.SESSION = Sessions

163
command.label.CONNECT = Connect

164
command.label.RE_CONNECT = Re-Connect

165
command.name.CONNECT = Connect

166
command.name.RE_CONNECT = Re-Connect

167 167
command.name.OPEN_CLASSIFICATION_WIZARD = Open Classification Wizard
eu.etaxonomy.taxeditor.store/OSGI-INF/l10n/messages.properties
1
CdmDataSourceViewPart_1=Loading datasources
2
CdmDataSourceViewPart_10=Server
3
CdmDataSourceViewPart_11=Name
4
CdmDataSourceViewPart_12=Connected
5
CdmDataSourceViewPart_2=Notes
6
CdmDataSourceViewPart_3=Compatible
7
CdmDataSourceViewPart_4=CDM Version
8
CdmDataSourceViewPart_5=Created
9
CdmDataSourceViewPart_6=Nomenclatural Code
10
CdmDataSourceViewPart_7=Database
11
CdmDataSourceViewPart_8=Type
12
CdmDataSourceViewPart_9=Up
13
LanguageEditorPreferencePage_ChooseDefaultLanguage=Please choose your default language for the editor: 
14
LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restarted, in order to complete the language switch.\nDo you want to restart now?
15
LanguageEditorPreferencePage_PleaseRestart=Please Restart
16
LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect.
17
OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required.
18
OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.
19
UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! 
20
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid.
21
UriWithLabelElement_INVALID_URL=Invalid URI
22
UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser
23

  
24
ChangeConnectionHandler_ALREADY_CONNECTING=Already connecting
25
ChangeConnectionHandler_CONFIRM_DATASOURCE=Confirm Datasource Connection
26
ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently connecting to a different datasource already.
27
ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available
28
ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Do you really want to connect to this datasource?\n\n
29
ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource.
30

  
31
LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database.
32
LoginDialog_LOGIN=Login
33
LoginDialog_PASSWORD=Password
34
LoginDialog_REALLY_CANCEL=Do you really want to cancel?
35
LoginDialog_USER_LOGIN=User Login
36
LoginDialog_USER_NAME=Username
37

  
38
CdmViewerContextMenu_OPEN=Open (%s)
39
CdmViewerContextMenu_OPEN_IN=Open in...
1
CdmDataSourceViewPart_1=Loading datasources
2
CdmDataSourceViewPart_10=Server
3
CdmDataSourceViewPart_11=Name
4
CdmDataSourceViewPart_12=Connected
5
CdmDataSourceViewPart_2=Notes
6
CdmDataSourceViewPart_3=Compatible
7
CdmDataSourceViewPart_4=CDM Version
8
CdmDataSourceViewPart_5=Created
9
CdmDataSourceViewPart_6=Nomenclatural Code
10
CdmDataSourceViewPart_7=Database
11
CdmDataSourceViewPart_8=Type
12
CdmDataSourceViewPart_9=Up
13
LanguageEditorPreferencePage_ChooseDefaultLanguage=Please choose your default language for the editor: 
14
LanguageEditorPreferencePage_EditorHasToRestart=The application has to be restarted, in order to complete the language switch.\nDo you want to restart now?
15
LanguageEditorPreferencePage_PleaseRestart=Please Restart
16
LanguageEditorPreferencePage_RestartRequired=After changing the default language, a restart is required,\nin order for the new settings to take effect.
17
OrderPreferencePage_NewNavigatorWindowRequired=After changing the order of the taxon nodes, closing and reopen of the taxon navigator is required.
18
OrderPreferencePage_PleaseReopenNavigator=Please close and reopen the taxon navigator.
19
UriWithLabelElement_URL_NOT_SAVED=URI won't be saved\! 
20
UriWithLabelElement_COULD_NOT_OPEN_BROWSER=Could not open external browser. URI is invalid.
21
UriWithLabelElement_INVALID_URL=Invalid URI
22
UriWithLabelElement_OPEN_EXTERNAL_BROWSER=Open in external browser
23

  
24
ChangeConnectionHandler_ALREADY_CONNECTING=Already connecting
25
ChangeConnectionHandler_CONFIRM_DATASOURCE=Confirm Datasource Connection
26
ChangeConnectionHandler_CURRENTLY_CONNECTING_ALREADY=You are currently connecting to a different datasource already.
27
ChangeConnectionHandler_DATASOURCE_NOT_AVAILABLE=Chosen datasource is not available
28
ChangeConnectionHandler_REALLY_WANT_TO_CONNECT=Do you really want to connect to this datasource?\n\n
29
ChangeConnectionHandler_NOT_AVAILABLE_REASONS=This could mean that either the database server is not running or the machine is not reachable.\n\n Please also make sure that you are connected to the network when trying to connect to a remote datasource.
30

  
31
LoginDialog_CANCEL_MESSAGE=Aborting the login procedure will close the database.
32
LoginDialog_LOGIN=Login
33
LoginDialog_PASSWORD=Password
34
LoginDialog_REALLY_CANCEL=Do you really want to cancel?
35
LoginDialog_USER_LOGIN=User Login
36
LoginDialog_USER_NAME=Username
37

  
38
CdmViewerContextMenu_OPEN=Open (%s)
39
CdmViewerContextMenu_OPEN_IN=Open in...
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/AbstractSplitableViewPart.java
1
// $Id$
2
/**
3
* Copyright (C) 2007 EDIT
4
* European Distributed Institute of Taxonomy 
5
* http://www.e-taxonomy.eu
6
* 
7
* The contents of this file are subject to the Mozilla Public License Version 1.1
8
* See LICENSE.TXT at the top of this package for the full license terms.
9
*/
10

  
11
package eu.etaxonomy.taxeditor.view;
12

  
13
import org.eclipse.jface.dialogs.IDialogSettings;
14
import org.eclipse.jface.viewers.Viewer;
15
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.custom.SashForm;
17
import org.eclipse.swt.events.ControlEvent;
18
import org.eclipse.swt.events.ControlListener;
19
import org.eclipse.swt.graphics.Point;
20
import org.eclipse.swt.widgets.Composite;
21
import org.eclipse.swt.widgets.Label;
22
import org.eclipse.ui.ISelectionListener;
23
import org.eclipse.ui.ISelectionService;
24
import org.eclipse.ui.part.PageBook;
25
import org.eclipse.ui.part.ViewPart;
26

  
27
import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
28

  
29
/**
30
 * <p>Abstract AbstractSplitableViewPart class.</p>
31
 *
32
 * @author n.hoffmann
33
 * @created Feb 12, 2010
34
 * @version 1.0
35
 */
36
public abstract class AbstractSplitableViewPart extends ViewPart implements ISelectionListener{
37
	
38
	static final int VIEW_ORIENTATION_VERTICAL = 0;
39
	static final int VIEW_ORIENTATION_HORIZONTAL = 1;
40
	static final int VIEW_ORIENTATION_SINGLE = 2;
41
	static final int VIEW_ORIENTATION_AUTOMATIC = 3;
42

  
43
	private static final int PAGE_EMPTY = 0;
44
    private static final int PAGE_VIEWER = 1;
45
	
46
	private final IDialogSettings dialogSettings;
47
	
48
	private SashForm detailSplitter;
49

  
50
	private Composite parent;
51

  
52
	private PageBook pagebook;
53

  
54
	private int orientation;
55

  
56
	private int currentOrientation;
57
//
58
	private boolean showViewer2;
59

  
60
	private Viewer viewer1;
61
	
62
	private Viewer viewer2;
63
	
64
	private Label emptySelectionLabel;
65

  
66
	private ISelectionService selectionService;
67

  
68
	
69
	/**
70
	 * <p>Constructor for AbstractSplitableViewPart.</p>
71
	 */
72
	public AbstractSplitableViewPart() {
73
		super();
74
		
75
		dialogSettings = TaxeditorStorePlugin.getDefault().getDialogSettings();
76
		
77
	}
78
	
79
	/* (non-Javadoc)
80
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
81
	 */
82
	/** {@inheritDoc} */
83
	@Override
84
	public void createPartControl(Composite parent) {	
85
		selectionService = getSite().getWorkbenchWindow().getSelectionService();
86
		selectionService.addSelectionListener(this);
87
		selectionService.addPostSelectionListener(this);
88
		
89
		
90
		this.parent = parent;
91
		addResizeListener(parent);
92
		pagebook = new PageBook(parent, SWT.NULL);
93
		
94
		// Page 1: Viewers
95
		createDetailSplitter(pagebook);
96
		viewer1 = createViewer1(detailSplitter);
97
		viewer2 = createViewer2(detailSplitter);
98
		
99
		// Page 2: Nothing selected
100
        emptySelectionLabel = new Label(pagebook, SWT.TOP + SWT.LEFT + SWT.WRAP);
101
        emptySelectionLabel.setText("Current selection does not support this view"); //
102
		
103
		showPage(PAGE_EMPTY);
104
		
105
		initOrientation();
106
		
107
		// FIXME since this class is not used at the moment we will not have to fix this soon
108
		// it might also become irrelevant in future uses
109
		// set the selection if there is an open editor
110
//		if(EditorUtil.getActiveMultiPageTaxonEditor() != null){
111
//			selectionChanged(EditorUtil.getActiveMultiPageTaxonEditor(), EditorUtil.getCurrentSelection());
112
//		}
113
	}
114
	
115
    private void initOrientation() {
116

  
117
        try {
118
            orientation = dialogSettings.getInt(getDialogstoreVieworientationKey());
119

  
120
            if ((orientation < 0) || (orientation > 3)) {
121
            	orientation = VIEW_ORIENTATION_AUTOMATIC;
122
            }
123
        } catch (NumberFormatException e) {
124
        	orientation = VIEW_ORIENTATION_AUTOMATIC;
125
        }
126

  
127
        // force the update
128
        currentOrientation = -1;
129
        setOrientation(orientation);
130
    }
131
	
132
    /**
133
     * <p>getDialogstoreVieworientationKey</p>
134
     *
135
     * @return a {@link java.lang.String} object.
136
     */
137
    protected abstract String getDialogstoreVieworientationKey();
138

  
139
    /**
140
     * <p>showEmptyPage</p>
141
     */
142
    public void showEmptyPage(){
143
    	showPage(PAGE_EMPTY);
144
    }
145
    
146
    /**
147
     * <p>showViewer</p>
148
     */
149
    public void showViewer(){
150
    	showPage(PAGE_VIEWER);
151
    }
152
    
153
	private void showPage(int page) {
154
        if (page == PAGE_EMPTY) {
155
            pagebook.showPage(emptySelectionLabel);
156
        } else {
157
            pagebook.showPage(detailSplitter);
158
        }
159
    }
160

  
161
	private void addResizeListener(Composite parent) {
162
		parent.addControlListener(new ControlListener() {
163
			public void controlMoved(ControlEvent e) {
164
			}
165
			public void controlResized(ControlEvent e) {
166
				computeOrientation();
167
			}
168
		});
169
	}
170
	
171
	void computeOrientation() {
172
		saveSplitterRatio();
173
		dialogSettings.put(getDialogstoreVieworientationKey(), orientation);
174
		if (orientation != VIEW_ORIENTATION_AUTOMATIC) {
175
			setOrientation(orientation);
176
		}
177
		else {
178
			if (orientation == VIEW_ORIENTATION_SINGLE)
179
				return;
180
			Point size= parent.getSize();
181
			if (size.x != 0 && size.y != 0) {
182
				if (size.x > size.y)
183
					setOrientation(VIEW_ORIENTATION_HORIZONTAL);
184
				else
185
					setOrientation(VIEW_ORIENTATION_VERTICAL);
186
			}
187
		}
188
	}
189
	
190
	private void saveSplitterRatio() {
191
		if (detailSplitter != null && ! detailSplitter.isDisposed()) {
192
	        int[] weigths = detailSplitter.getWeights();
193
	        int ratio = (weigths[0] * 1000) / (weigths[0] + weigths[1]);
194
			String key= getDialogStoreRatioKey() + currentOrientation;
195
	        dialogSettings.put(key, ratio);
196
		}
197
	}
198
	
199
    /**
200
     * <p>getDialogStoreRatioKey</p>
201
     *
202
     * @return a {@link java.lang.String} object.
203
     */
204
    protected abstract String getDialogStoreRatioKey();
205

  
206
	void setOrientation(int orientation) {
207
        if (currentOrientation != orientation) {
208
            if ((getViewer1() != null) 
209
            	&& !getViewer1().getControl().isDisposed() 
210
            	&& (detailSplitter != null) 
211
            	&& !detailSplitter.isDisposed()) {
212
                
213
            	if (orientation == VIEW_ORIENTATION_SINGLE) {
214
                    setShowViewer2(false);
215
                } else {
216
                    if (currentOrientation == VIEW_ORIENTATION_SINGLE) {
217
                    	setShowViewer2(true);
218
                    }
219
                    boolean horizontal = orientation == VIEW_ORIENTATION_HORIZONTAL;
220
                    detailSplitter.setOrientation(horizontal ? SWT.HORIZONTAL
221
                                                                     : SWT.VERTICAL);
222
                }
223

  
224
                detailSplitter.layout();
225
            }
226

  
227
            updateCheckedState();
228

  
229
            currentOrientation = orientation;
230

  
231
			restoreSplitterRatio();
232
        }
233
    }
234
    
235
	/**
236
	 * @param show
237
	 */
238
	private void setShowViewer2(boolean show) {
239
		showViewer2 = show;
240
		showOrHideViewer2();		
241
	}
242

  
243
	/**
244
	 * 
245
	 */
246
	private void showOrHideViewer2() {
247
        if (showViewer2) {
248
        	detailSplitter.setMaximizedControl(null);
249
        } else {
250
        	detailSplitter.setMaximizedControl(getViewer1().getControl());
251
        }
252
	}
253

  
254
	private void restoreSplitterRatio() {
255
		String ratio= dialogSettings.get(getDialogStoreRatioKey() + currentOrientation);
256
		if (ratio == null)
257
			return;
258
		int intRatio= Integer.parseInt(ratio);
259
		detailSplitter.setWeights(new int[] {intRatio, 1000 - intRatio});
260
	}
261
    
262
	private void updateCheckedState() {
263
//		for (int i= 0; i < fToggleOrientationActions.length; i++) {
264
//			fToggleOrientationActions[i].setChecked(fOrientation == fToggleOrientationActions[i].getOrientation());
265
//		}
266
	}
267
	
268
	/**
269
	 * <p>createViewer1</p>
270
	 *
271
	 * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
272
	 * @return a {@link org.eclipse.jface.viewers.Viewer} object.
273
	 */
274
	protected abstract Viewer createViewer1(Composite parent);
275
	
276

  
277
	/**
278
	 * <p>createViewer2</p>
279
	 *
280
	 * @param parent a {@link org.eclipse.swt.widgets.Composite} object.
281
	 * @return a {@link org.eclipse.jface.viewers.Viewer} object.
282
	 */
283
	protected abstract Viewer createViewer2(Composite parent);
284
	
285

  
286
	/**
287
	 * @param pagebook2
288
	 */
289
	private void createDetailSplitter(Composite parent) {
290
		detailSplitter = new SashForm(parent, SWT.HORIZONTAL);
291
	}
292
	
293
	/* (non-Javadoc)
294
	 * @see org.eclipse.ui.part.WorkbenchPart#dispose()
295
	 */
296
	/** {@inheritDoc} */
297
	@Override
298
	public void dispose() {
299
		selectionService.removeSelectionListener(this);
300
		selectionService.removePostSelectionListener(this);
301
		super.dispose();
302
	}
303

  
304
	/**
305
	 * <p>Getter for the field <code>viewer1</code>.</p>
306
	 *
307
	 * @return a {@link org.eclipse.jface.viewers.Viewer} object.
308
	 */
309
	protected Viewer getViewer1() {
310
		return viewer1;
311
	}
312

  
313
	/**
314
	 * <p>Getter for the field <code>viewer2</code>.</p>
315
	 *
316
	 * @return a {@link org.eclipse.jface.viewers.Viewer} object.
317
	 */
318
	protected Viewer getViewer2() {
319
		return viewer2;
320
	}
321
}

Also available in: Unified diff