Revision c9285745
Added by Cherian Mathew almost 9 years ago
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/view/sessions/InspectSessionsDialog.java | ||
---|---|---|
1 | 1 |
// $Id$ |
2 | 2 |
/** |
3 |
* Copyright (C) 2015 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 |
*/ |
|
3 |
* Copyright (C) 2015 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 | 10 |
package eu.etaxonomy.taxeditor.view.sessions; |
11 | 11 |
|
12 | 12 |
import java.util.List; |
... | ... | |
14 | 14 |
import net.sf.ehcache.Cache; |
15 | 15 |
import net.sf.ehcache.Element; |
16 | 16 |
|
17 |
import org.eclipse.jface.viewers.ILabelProvider; |
|
17 | 18 |
import org.eclipse.jface.viewers.ITreeContentProvider; |
18 | 19 |
import org.eclipse.jface.viewers.StyledCellLabelProvider; |
19 | 20 |
import org.eclipse.jface.viewers.StyledString; |
... | ... | |
24 | 25 |
import org.eclipse.swt.custom.SashForm; |
25 | 26 |
import org.eclipse.swt.events.SelectionAdapter; |
26 | 27 |
import org.eclipse.swt.events.SelectionEvent; |
28 |
import org.eclipse.swt.graphics.Image; |
|
27 | 29 |
import org.eclipse.swt.layout.GridData; |
28 | 30 |
import org.eclipse.swt.layout.GridLayout; |
29 | 31 |
import org.eclipse.swt.widgets.Button; |
... | ... | |
33 | 35 |
import org.eclipse.swt.widgets.Label; |
34 | 36 |
import org.eclipse.swt.widgets.Shell; |
35 | 37 |
import org.eclipse.swt.widgets.Text; |
36 |
import org.eclipse.swt.widgets.Tree; |
|
38 |
import org.eclipse.ui.dialogs.FilteredTree; |
|
39 |
import org.eclipse.ui.dialogs.PatternFilter; |
|
37 | 40 |
import org.eclipse.wb.swt.SWTResourceManager; |
38 | 41 |
|
39 | 42 |
import eu.etaxonomy.taxeditor.remoting.cache.CdmModelFieldPropertyFromClass; |
... | ... | |
111 | 114 |
sashForm = new SashForm(shlInspectSessions, SWT.VERTICAL); |
112 | 115 |
sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); |
113 | 116 |
|
114 |
treeViewer = new TreeViewer(sashForm, SWT.BORDER); |
|
115 |
Tree tree = treeViewer.getTree(); |
|
117 |
PatternFilter filter = new PatternFilter(); |
|
118 |
FilteredTree tree = new FilteredTree(sashForm, SWT.MULTI | SWT.H_SCROLL | SWT.BORDER |
|
119 |
| SWT.V_SCROLL, filter, true); |
|
120 |
treeViewer = tree.getViewer(); |
|
121 |
//treeViewer = new TreeViewer(sashForm, SWT.BORDER); |
|
122 |
//Tree tree = treeViewer.getTree(); |
|
116 | 123 |
|
117 |
compositeDebug = new Composite(sashForm, SWT.NONE);
|
|
118 |
compositeDebug.setLayout(new GridLayout(1, false));
|
|
124 |
compositeDebug = new Composite(sashForm, SWT.NONE); |
|
125 |
compositeDebug.setLayout(new GridLayout(1, false)); |
|
119 | 126 |
|
120 |
lblDebugInformation = new Label(compositeDebug, SWT.NONE);
|
|
121 |
lblDebugInformation.setAlignment(SWT.CENTER);
|
|
122 |
lblDebugInformation.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1));
|
|
123 |
lblDebugInformation.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL));
|
|
124 |
lblDebugInformation.setText("Debug Information");
|
|
127 |
lblDebugInformation = new Label(compositeDebug, SWT.NONE); |
|
128 |
lblDebugInformation.setAlignment(SWT.CENTER); |
|
129 |
lblDebugInformation.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, true, false, 1, 1)); |
|
130 |
lblDebugInformation.setFont(SWTResourceManager.getFont("Ubuntu", 10, SWT.NORMAL)); |
|
131 |
lblDebugInformation.setText("Debug Information"); |
|
125 | 132 |
|
126 |
txtDebugInfo = new Text(compositeDebug, SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
|
|
127 |
txtDebugInfo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
|
|
128 |
sashForm.setWeights(new int[] {338, 184});
|
|
133 |
txtDebugInfo = new Text(compositeDebug, SWT.BORDER | SWT.READ_ONLY | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI); |
|
134 |
txtDebugInfo.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1)); |
|
135 |
sashForm.setWeights(new int[] {338, 184}); |
|
129 | 136 |
|
130 | 137 |
btnClose = new Button(shlInspectSessions, SWT.NONE); |
131 | 138 |
btnClose.addSelectionListener(new SelectionAdapter() { |
... | ... | |
221 | 228 |
|
222 | 229 |
} |
223 | 230 |
|
224 |
class SessionsTreeLabelProvider extends StyledCellLabelProvider { |
|
231 |
class SessionsTreeLabelProvider extends StyledCellLabelProvider implements ILabelProvider {
|
|
225 | 232 |
|
226 | 233 |
@Override |
227 | 234 |
public void update(ViewerCell cell) { |
... | ... | |
234 | 241 |
cell.setStyleRanges(text.getStyleRanges()); |
235 | 242 |
super.update(cell); |
236 | 243 |
} |
244 |
|
|
245 |
/* (non-Javadoc) |
|
246 |
* @see org.eclipse.jface.viewers.ILabelProvider#getImage(java.lang.Object) |
|
247 |
*/ |
|
248 |
@Override |
|
249 |
public Image getImage(Object element) { |
|
250 |
// TODO Auto-generated method stub |
|
251 |
return null; |
|
252 |
} |
|
253 |
|
|
254 |
/* (non-Javadoc) |
|
255 |
* @see org.eclipse.jface.viewers.ILabelProvider#getText(java.lang.Object) |
|
256 |
*/ |
|
257 |
@Override |
|
258 |
public String getText(Object element) { |
|
259 |
CdmEntityInfo cei = (CdmEntityInfo)element; |
|
260 |
return cei.getLabel(); |
|
261 |
} |
|
237 | 262 |
} |
238 | 263 |
} |
239 | 264 |
|
Also available in: Unified diff
InspectSessionsDialog : added filtering
CdmStore : clearing caches and session before connecting
ParseHandler : using NonViralName instead of TaxonNameBase
AbstractPostTaxonOperation, AbstractPostOperation, AbstractPersistentPostOperation : added CdmEntitySessionEnabled object to constructor
NewTaxonNodeWizard : explicitly fire changes