summaryrefslogtreecommitdiffstats
path: root/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SimpleSettingDialog.java
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SimpleSettingDialog.java')
-rw-r--r--plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SimpleSettingDialog.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SimpleSettingDialog.java b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SimpleSettingDialog.java
new file mode 100644
index 0000000..140d892
--- /dev/null
+++ b/plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/SimpleSettingDialog.java
@@ -0,0 +1,54 @@
1/*******************************************************************************
2 * Copyright (c) 2010 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 *******************************************************************************/
11package org.yocto.sdk.remotetools.actions;
12
13import org.yocto.sdk.remotetools.Activator;
14import org.eclipse.jface.dialogs.IDialogSettings;
15import org.eclipse.swt.widgets.Composite;
16import org.eclipse.swt.widgets.Control;
17import org.eclipse.swt.widgets.Shell;
18
19public class SimpleSettingDialog extends BaseSettingDialog {
20
21 private final String connPropName;
22 /*
23 protected SimpleSettingDialog(Shell parentShell, String title, String conn) {
24 super(parentShell,title,conn);
25 }
26 */
27
28 public SimpleSettingDialog(Shell parentShell, String title, String connPropertyName) {
29 super(parentShell,
30 title,
31 Activator.getDefault().getDialogSettings().get(connPropertyName)
32 );
33 connPropName=connPropertyName;
34 }
35
36 @Override
37 protected Control createDialogArea(Composite parent) {
38 return super.createDialogArea(parent);
39 }
40
41 @Override
42 protected void okPressed() {
43 IDialogSettings settings = Activator.getDefault().getDialogSettings();
44 // store the value of the generate sections checkbox
45 if(getCurrentConnection()==null) {
46 settings.put(connPropName,
47 (String)null);
48 }else {
49 settings.put(connPropName,
50 getCurrentConnection().getAliasName());
51 }
52 super.okPressed();
53 }
54}