diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:36:50 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 15:25:03 +0100 |
commit | 41ac47d732eed8392d60d0f6773e5a279d49b999 (patch) | |
tree | cf19d099db9cfdb8d73aa21c31e7aa1cc86ff860 /plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java | |
download | eclipse-poky-juno-41ac47d732eed8392d60d0f6773e5a279d49b999.tar.gz |
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java')
-rw-r--r-- | plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java new file mode 100644 index 0000000..231de77 --- /dev/null +++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java | |||
@@ -0,0 +1,42 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2013 Intel Corporation. | ||
3 | * All rights reserved. This program and the accompanying materials | ||
4 | * are made available under the terms of the Eclipse Public License v1.0 | ||
5 | * which accompanies this distribution, and is available at | ||
6 | * http://www.eclipse.org/legal/epl-v10.html | ||
7 | * | ||
8 | * Contributors: | ||
9 | * Intel - initial API and implementation | ||
10 | *******************************************************************************/ | ||
11 | package org.yocto.sdk.remotetools.actions; | ||
12 | |||
13 | import org.eclipse.core.commands.ExecutionEvent; | ||
14 | import org.eclipse.core.commands.ExecutionException; | ||
15 | import org.eclipse.rse.core.model.IHost; | ||
16 | import org.eclipse.ui.IWorkbenchWindow; | ||
17 | import org.eclipse.ui.handlers.HandlerUtil; | ||
18 | import org.yocto.remote.utils.TerminalHandler; | ||
19 | |||
20 | abstract public class DialogHandler extends TerminalHandler { | ||
21 | |||
22 | protected BaseSettingDialog setting; | ||
23 | |||
24 | abstract protected String getDialogTitle(); | ||
25 | |||
26 | protected void initialize(ExecutionEvent event) throws ExecutionException{ | ||
27 | IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); | ||
28 | shell = window.getShell(); | ||
29 | setting = new SimpleSettingDialog(shell, getDialogTitle(), getConnnectionName()); | ||
30 | } | ||
31 | |||
32 | @Override | ||
33 | public Object execute(ExecutionEvent event) throws ExecutionException { | ||
34 | initialize(event); | ||
35 | |||
36 | if(setting.open() == BaseSettingDialog.OK) { | ||
37 | IHost currentHost = setting.getHost(); | ||
38 | execute(currentHost); | ||
39 | } | ||
40 | return null; | ||
41 | } | ||
42 | } | ||