Revision 32f004cd
Added by Patrick Plitzner over 6 years ago
eu.etaxonomy.taxeditor.application/Application.e4xmi | ||
---|---|---|
18 | 18 |
</children> |
19 | 19 |
<mainMenu xmi:id="__eR6EMCnEeeY5_oZn4Cc5g" elementId="eu.etaxonomy.taxeditor.application.menu.main"/> |
20 | 20 |
<trimBars xmi:id="_GyNiEMClEeeY5_oZn4Cc5g" elementId="eu.etaxonomy.taxeditor.application.trimbar.top"/> |
21 |
<trimBars xmi:id="_WpqYMMLwEee0N85Mii-Chg" elementId="eu.etaxonomy.taxeditor.application.trimbar.bottom" side="Bottom"/> |
|
21 | 22 |
</children> |
22 | 23 |
<addons xmi:id="_8ht78cCfEeeY5_oZn4Cc5g" elementId="org.eclipse.e4.core.commands.service" contributionURI="bundleclass://org.eclipse.e4.core.commands/org.eclipse.e4.core.commands.CommandServiceAddon"/> |
23 | 24 |
<addons xmi:id="_8ht78sCfEeeY5_oZn4Cc5g" elementId="org.eclipse.e4.ui.contexts.service" contributionURI="bundleclass://org.eclipse.e4.ui.services/org.eclipse.e4.ui.services.ContextServiceAddon"/> |
eu.etaxonomy.taxeditor.application/src/main/java/eu/etaxonomy/taxeditor/ApplicationActionBarAdvisor.java | ||
---|---|---|
6 | 6 |
import org.eclipse.ui.application.ActionBarAdvisor; |
7 | 7 |
import org.eclipse.ui.application.IActionBarConfigurer; |
8 | 8 |
|
9 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
10 |
|
|
11 | 9 |
/** |
12 | 10 |
* An action bar advisor is responsible for creating, adding, and disposing of |
13 | 11 |
* the actions added to a workbench window. Each window will be populated with |
... | ... | |
31 | 29 |
} |
32 | 30 |
|
33 | 31 |
/** {@inheritDoc} */ |
34 |
protected void makeActions(final IWorkbenchWindow window) { |
|
35 |
StoreUtil.setStatusLineManager(getActionBarConfigurer().getStatusLineManager()); |
|
36 |
|
|
32 |
@Override |
|
33 |
protected void makeActions(final IWorkbenchWindow window) { |
|
34 |
|
|
35 |
//FIXME E4 migrate/ delete statusLineManager |
|
36 |
// StoreUtil.setStatusLineManager(getActionBarConfigurer().getStatusLineManager()); |
|
37 |
|
|
37 | 38 |
saveAction = ActionFactory.SAVE.create(window); |
38 | 39 |
register(saveAction); |
39 | 40 |
|
eu.etaxonomy.taxeditor.navigation/src/test/java/eu/etaxonomy/taxeditor/navigation/ApplicationActionBarAdvisor.java | ||
---|---|---|
9 | 9 |
import org.eclipse.ui.application.ActionBarAdvisor; |
10 | 10 |
import org.eclipse.ui.application.IActionBarConfigurer; |
11 | 11 |
|
12 |
import eu.etaxonomy.taxeditor.store.StoreUtil; |
|
13 |
|
|
14 | 12 |
/** |
15 | 13 |
* An action bar advisor is responsible for creating, adding, and disposing of |
16 | 14 |
* the actions added to a workbench window. Each window will be populated with |
... | ... | |
28 | 26 |
super(configurer); |
29 | 27 |
} |
30 | 28 |
|
31 |
protected void makeActions(final IWorkbenchWindow window) { |
|
29 |
@Override |
|
30 |
protected void makeActions(final IWorkbenchWindow window) { |
|
32 | 31 |
// Creates the actions and registers them. |
33 | 32 |
// Registering is needed to ensure that key bindings work. |
34 | 33 |
// The corresponding commands keybindings are defined in the plugin.xml |
... | ... | |
36 | 35 |
// Registering also provides automatic disposal of the actions when |
37 | 36 |
// the window is closed. |
38 | 37 |
|
39 |
StoreUtil.setStatusLineManager(getActionBarConfigurer().getStatusLineManager()); |
|
40 |
|
|
38 |
|
|
39 |
//FIXME E4 migrate/ delete statusLineManager |
|
40 |
// StoreUtil.setStatusLineManager(getActionBarConfigurer().getStatusLineManager()); |
|
41 |
|
|
41 | 42 |
exitAction = ActionFactory.QUIT.create(window); |
42 | 43 |
register(exitAction); |
43 | 44 |
} |
44 | 45 |
|
45 |
protected void fillMenuBar(IMenuManager menuBar) { |
|
46 |
@Override |
|
47 |
protected void fillMenuBar(IMenuManager menuBar) { |
|
46 | 48 |
MenuManager fileMenu = new MenuManager("&File", |
47 | 49 |
IWorkbenchActionConstants.M_FILE); |
48 | 50 |
menuBar.add(fileMenu); |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/model/AbstractUtility.java | ||
---|---|---|
44 | 44 |
import org.eclipse.e4.ui.di.UISynchronize; |
45 | 45 |
import org.eclipse.e4.ui.model.application.ui.basic.MPart; |
46 | 46 |
import org.eclipse.e4.ui.workbench.modeling.EPartService; |
47 |
import org.eclipse.jface.action.IStatusLineManager; |
|
48 | 47 |
import org.eclipse.jface.viewers.IStructuredSelection; |
49 | 48 |
import org.eclipse.jface.viewers.SelectionChangedEvent; |
50 | 49 |
import org.eclipse.swt.graphics.Color; |
... | ... | |
76 | 75 |
import eu.etaxonomy.taxeditor.ui.dialog.ReportTextDialog; |
77 | 76 |
import eu.etaxonomy.taxeditor.view.e4.AbstractCdmDataViewerE4; |
78 | 77 |
import eu.etaxonomy.taxeditor.view.e4.details.DetailsPartE4; |
78 |
import eu.etaxonomy.taxeditor.workbench.StatusBar; |
|
79 | 79 |
import eu.etaxonomy.taxeditor.workbench.part.IE4SavablePart; |
80 | 80 |
|
81 | 81 |
/** |
... | ... | |
88 | 88 |
|
89 | 89 |
private static final Logger logger = Logger.getLogger(AbstractUtility.class); |
90 | 90 |
|
91 |
/** Constant <code>statusLineManager</code> */
|
|
92 |
protected static IStatusLineManager statusLineManager; |
|
91 |
//FIXME E4 migrate/ delete statusLineManager
|
|
92 |
// protected static IStatusLineManager statusLineManager;
|
|
93 | 93 |
/** Constant <code>DATE_FORMAT_NOW="yyyyMMddHHmm"</code> */ |
94 | 94 |
public static final String DATE_FORMAT_NOW = "yyyyMMddHHmm"; |
95 | 95 |
|
... | ... | |
394 | 394 |
|
395 | 395 |
@Override |
396 | 396 |
public void run() { |
397 |
statusLineManager.setMessage(message);
|
|
397 |
StatusBar.setStatus(message);
|
|
398 | 398 |
} |
399 | 399 |
|
400 | 400 |
}); |
... | ... | |
402 | 402 |
} |
403 | 403 |
|
404 | 404 |
public static IProgressMonitor getMonitor() { |
405 |
statusLineManager.setCancelEnabled(false); |
|
406 |
return statusLineManager.getProgressMonitor(); |
|
405 |
return new NullProgressMonitor(); |
|
406 |
//FIXME E4 migrate/ delete statusLineManager |
|
407 |
// statusLineManager.setCancelEnabled(false); |
|
408 |
// return statusLineManager.getProgressMonitor(); |
|
407 | 409 |
} |
408 | 410 |
|
409 | 411 |
/** |
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/store/StoreUtil.java | ||
---|---|---|
13 | 13 |
|
14 | 14 |
import org.eclipse.core.commands.operations.IOperationHistory; |
15 | 15 |
import org.eclipse.core.commands.operations.IUndoContext; |
16 |
import org.eclipse.jface.action.IStatusLineManager; |
|
17 | 16 |
import org.eclipse.swt.widgets.Composite; |
18 | 17 |
import org.eclipse.ui.forms.widgets.ScrolledForm; |
19 | 18 |
|
... | ... | |
78 | 77 |
getOperationSupport().getOperationHistory(); |
79 | 78 |
} |
80 | 79 |
|
81 |
/** |
|
82 |
* <p>setStatusLineManager</p> |
|
83 |
* |
|
84 |
* @param manager a {@link org.eclipse.jface.action.IStatusLineManager} object. |
|
85 |
*/ |
|
86 |
public static void setStatusLineManager(IStatusLineManager manager) { |
|
87 |
statusLineManager = manager; |
|
88 |
} |
|
89 |
|
|
90 | 80 |
public static void reflowParentScrolledForm(Composite composite, boolean flushCashes){ |
91 | 81 |
ScrolledForm scrolledForm = null; |
92 | 82 |
Composite parent = composite; |
eu.etaxonomy.taxeditor.workbench/fragment.e4xmi | ||
---|---|---|
124 | 124 |
<elements xsi:type="commands:Handler" xmi:id="_UvfiQL2lEeeyWfw0n8-ICQ" elementId="eu.etaxonomy.taxeditor.workbench.handler.CollapseHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.handler.CollapseHandler" command="_S00XkL2gEeeyWfw0n8-ICQ"/> |
125 | 125 |
<elements xsi:type="commands:Handler" xmi:id="_bkScIL4vEeewU62zpvPllA" elementId="eu.etaxonomy.taxeditor.workbench.handler.ExpandHandler" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.handler.ExpandHandler" command="_Z0st0L4vEeewU62zpvPllA"/> |
126 | 126 |
</fragments> |
127 |
<fragments xsi:type="fragment:StringModelFragment" xmi:id="_lRtmsMLwEee0N85Mii-Chg" featurename="children" parentElementId="eu.etaxonomy.taxeditor.application.trimbar.bottom"> |
|
128 |
<elements xsi:type="menu:ToolControl" xmi:id="_oKE68MLwEee0N85Mii-Chg" elementId="eu.etaxonomy.taxeditor.workbench.StatusBar" contributionURI="bundleclass://eu.etaxonomy.taxeditor.workbench/eu.etaxonomy.taxeditor.workbench.StatusBar"/> |
|
129 |
</fragments> |
|
127 | 130 |
</fragment:ModelFragments> |
eu.etaxonomy.taxeditor.workbench/src/main/java/eu/etaxonomy/taxeditor/workbench/StatusBar.java | ||
---|---|---|
1 |
/** |
|
2 |
* Copyright (C) 2017 EDIT |
|
3 |
* European Distributed Institute of Taxonomy |
|
4 |
* http://www.e-taxonomy.eu |
|
5 |
* |
|
6 |
* The contents of this file are subject to the Mozilla Public License Version 1.1 |
|
7 |
* See LICENSE.TXT at the top of this package for the full license terms. |
|
8 |
*/ |
|
9 |
package eu.etaxonomy.taxeditor.workbench; |
|
10 |
|
|
11 |
import javax.annotation.PostConstruct; |
|
12 |
|
|
13 |
import org.eclipse.swt.SWT; |
|
14 |
import org.eclipse.swt.widgets.Composite; |
|
15 |
import org.eclipse.swt.widgets.Label; |
|
16 |
|
|
17 |
/** |
|
18 |
* @author pplitzner |
|
19 |
* @since Nov 6, 2017 |
|
20 |
* |
|
21 |
*/ |
|
22 |
public class StatusBar { |
|
23 |
|
|
24 |
private static Label statusLabel; |
|
25 |
|
|
26 |
@PostConstruct |
|
27 |
public void create(Composite parent){ |
|
28 |
statusLabel = new Label(parent, SWT.NONE); |
|
29 |
} |
|
30 |
|
|
31 |
public static void setStatus(String status){ |
|
32 |
statusLabel.setText(status); |
|
33 |
statusLabel.getParent().layout(); |
|
34 |
} |
|
35 |
|
|
36 |
public static void clearStatus(){ |
|
37 |
statusLabel.setText(""); |
|
38 |
} |
|
39 |
} |
Also available in: Unified diff
ref #6672 Migrate status line