Révision 3743
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/commands/CleanPerspective.java (revision 3743) | ||
---|---|---|
33 | 33 |
//System.out.println("clean perspective"); |
34 | 34 |
|
35 | 35 |
IWorkbenchPage page; |
36 |
if (event == null) {
|
|
36 |
if (event != null) {
|
|
37 | 37 |
IWorkbenchPart part = HandlerUtil.getActivePart(event); |
38 | 38 |
page = part.getSite().getPage(); |
39 | 39 |
} else { |
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/commands/QuitHandler.java (revision 3743) | ||
---|---|---|
1 |
package org.txm.rcp.commands; |
|
2 |
|
|
3 |
import org.eclipse.core.commands.AbstractHandler; |
|
4 |
import org.eclipse.core.commands.ExecutionEvent; |
|
5 |
import org.eclipse.core.commands.ExecutionException; |
|
6 |
import org.eclipse.swt.widgets.Display; |
|
7 |
|
|
8 |
import jline.internal.Log; |
|
9 |
|
|
10 |
/** |
|
11 |
* Call Shell.close() if not the WindowAdvisor.preShellclosed is not called |
|
12 |
* |
|
13 |
* @author mdecorde |
|
14 |
* |
|
15 |
*/ |
|
16 |
public class QuitHandler extends AbstractHandler { |
|
17 |
|
|
18 |
@Override |
|
19 |
public Object execute(ExecutionEvent event) throws ExecutionException { |
|
20 |
|
|
21 |
Log.info("Quit TXM..."); |
|
22 |
|
|
23 |
Display.getCurrent().getActiveShell().close(); |
|
24 |
|
|
25 |
return null; |
|
26 |
} |
|
27 |
} |
|
0 | 28 |
TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchWindowAdvisor.java (revision 3743) | ||
---|---|---|
27 | 27 |
// |
28 | 28 |
package org.txm.rcp; |
29 | 29 |
|
30 |
import java.io.File; |
|
31 | 30 |
import java.util.ArrayList; |
32 | 31 |
import java.util.HashMap; |
33 | 32 |
import java.util.Iterator; |
... | ... | |
57 | 56 |
import org.txm.core.results.TXMResult; |
58 | 57 |
import org.txm.objects.CorpusBuild; |
59 | 58 |
import org.txm.objects.Project; |
59 |
import org.txm.rcp.commands.CleanPerspective; |
|
60 | 60 |
import org.txm.rcp.messages.TXMUIMessages; |
61 | 61 |
import org.txm.utils.logger.Log; |
62 | 62 |
|
... | ... | |
228 | 228 |
return false; |
229 | 229 |
} |
230 | 230 |
} |
231 |
|
|
231 | 232 |
return true; |
232 | 233 |
} |
233 | 234 |
} |
TXM/trunk/bundles/org.txm.rcp/plugin.xml (revision 3743) | ||
---|---|---|
773 | 773 |
style="push"> |
774 | 774 |
</command> |
775 | 775 |
<command |
776 |
commandId="org.eclipse.ui.file.exit"
|
|
776 |
commandId="org.txm.rcp.commands.QuitHandler"
|
|
777 | 777 |
label="%command.label.6" |
778 | 778 |
style="push" |
779 | 779 |
tooltip="%command.tooltip.2"> |
... | ... | |
2827 | 2827 |
id="org.txm.rcp.commands.CleanEditors" |
2828 | 2828 |
name="Close all editors"> |
2829 | 2829 |
</command> |
2830 |
<command |
|
2831 |
defaultHandler="org.txm.rcp.commands.QuitHandler" |
|
2832 |
description="Close TXM" |
|
2833 |
id="org.txm.rcp.commands.QuitHandler" |
|
2834 |
name="Quit"> |
|
2835 |
</command> |
|
2830 | 2836 |
</extension> |
2831 | 2837 |
<extension |
2832 | 2838 |
id="commands" |
Formats disponibles : Unified diff