From ede215cf93ba81c963ae62d665d0f32c9407551c Mon Sep 17 00:00:00 2001 From: Tudor Florea Date: Fri, 10 Oct 2014 03:49:30 +0200 Subject: initial commit for Enea Linux 4.0-140929 Migrated from the internal git server on the daisy-enea-point-release branch Signed-off-by: Tudor Florea --- .../sdk/remotetools/actions/DialogHandler.java | 42 ++++++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java (limited to 'plugins/org.yocto.sdk.remotetools/src/org/yocto/sdk/remotetools/actions/DialogHandler.java') 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 @@ +/******************************************************************************* + * Copyright (c) 2013 Intel Corporation. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Intel - initial API and implementation + *******************************************************************************/ +package org.yocto.sdk.remotetools.actions; + +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.rse.core.model.IHost; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.handlers.HandlerUtil; +import org.yocto.remote.utils.TerminalHandler; + +abstract public class DialogHandler extends TerminalHandler { + + protected BaseSettingDialog setting; + + abstract protected String getDialogTitle(); + + protected void initialize(ExecutionEvent event) throws ExecutionException{ + IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event); + shell = window.getShell(); + setting = new SimpleSettingDialog(shell, getDialogTitle(), getConnnectionName()); + } + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + initialize(event); + + if(setting.open() == BaseSettingDialog.OK) { + IHost currentHost = setting.getHost(); + execute(currentHost); + } + return null; + } +} -- cgit v1.2.3-54-g00ecf