hdt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rsha...@apache.org
Subject [3/6] git commit: HDT-53: prompt user for hadoop perspective on adding zookeeper server/hadoop server
Date Fri, 23 May 2014 03:21:10 GMT
HDT-53: prompt user for hadoop perspective on adding zookeeper server/hadoop server


Project: http://git-wip-us.apache.org/repos/asf/incubator-hdt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hdt/commit/ec415a98
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hdt/tree/ec415a98
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hdt/diff/ec415a98

Branch: refs/heads/hadoop-eclipse-merge-development
Commit: ec415a9809821a077ec0ed48d0dca45a7817d48a
Parents: 4514771
Author: Rahul Sharma <rsharma@apache.org>
Authored: Thu May 15 14:51:02 2014 +0530
Committer: Rahul Sharma <rsharma@apache.org>
Committed: Fri May 23 08:46:13 2014 +0530

----------------------------------------------------------------------
 .../hdt/ui/internal/hdfs/NewHDFSWizard.java     | 22 ++++++++++++++++--
 .../internal/zookeeper/NewZooKeeperWizard.java  | 24 +++++++++++++++++++-
 2 files changed, 43 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/ec415a98/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/hdfs/NewHDFSWizard.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/hdfs/NewHDFSWizard.java b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/hdfs/NewHDFSWizard.java
index 4cd40de..9b0706c 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/hdfs/NewHDFSWizard.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/hdfs/NewHDFSWizard.java
@@ -20,17 +20,23 @@ package org.apache.hdt.ui.internal.hdfs;
 import org.apache.hdt.core.internal.hdfs.HDFSManager;
 import org.apache.hdt.ui.Activator;
 import org.apache.log4j.Logger;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
 
-public class NewHDFSWizard extends Wizard implements INewWizard {
+public class NewHDFSWizard extends Wizard implements INewWizard,IExecutableExtension {
 
 	private static Logger logger = Logger.getLogger(NewHDFSWizard.class);
 	private NewHDFSServerWizardPage serverLocationWizardPage = null;
+	private IConfigurationElement configElement;
 
 	public NewHDFSWizard() {
 		// TODO Auto-generated constructor stub
@@ -56,6 +62,11 @@ public class NewHDFSWizard extends Wizard implements INewWizard {
 
 	@Override
 	public boolean performFinish() {
+		Display.getDefault().syncExec(new Runnable() {
+			public void run() {
+				BasicNewProjectResourceWizard.updatePerspective(configElement);
+			}
+		});
 		if (serverLocationWizardPage != null) {
 			String ambariUrl = serverLocationWizardPage.getHdfsServerLocation();
 			if (ambariUrl != null) {
@@ -79,7 +90,14 @@ public class NewHDFSWizard extends Wizard implements INewWizard {
 		}
 		return false;
 	}
-
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData
+	 * (org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+	 */
+	@Override
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object
data) throws CoreException {
+		this.configElement=config;
+	}
 	
 
 }

http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/ec415a98/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
index 405773a..60e740b 100644
--- a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/zookeeper/NewZooKeeperWizard.java
@@ -19,18 +19,26 @@ package org.apache.hdt.ui.internal.zookeeper;
 
 import org.apache.hdt.core.internal.zookeeper.ZooKeeperManager;
 import org.apache.hdt.ui.Activator;
+import org.apache.hdt.ui.internal.launch.HadoopLocationWizard;
+import org.apache.hdt.ui.internal.launch.ServerRegistry;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
 import org.eclipse.core.runtime.Status;
 import org.eclipse.core.runtime.jobs.Job;
 import org.eclipse.jface.preference.IPreferenceStore;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.INewWizard;
 import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.wizards.newresource.BasicNewProjectResourceWizard;
 
-public class NewZooKeeperWizard extends Wizard implements INewWizard {
+public class NewZooKeeperWizard extends Wizard implements INewWizard,IExecutableExtension
{
 
 	//private static Logger logger = Logger.getLogger(NewZooKeeperWizard.class);
 	private NewZooKeeperServerWizardPage serverLocationWizardPage = null;
+	private IConfigurationElement configElement;
 
 	public NewZooKeeperWizard() {
 	}
@@ -55,6 +63,11 @@ public class NewZooKeeperWizard extends Wizard implements INewWizard {
 
 	@Override
 	public boolean performFinish() {
+		Display.getDefault().syncExec(new Runnable() {
+			public void run() {
+				BasicNewProjectResourceWizard.updatePerspective(configElement);
+			}
+		});
 		if (serverLocationWizardPage != null) {
 			String ambariUrl = serverLocationWizardPage.getZkServerLocation();
 			if (ambariUrl != null) {
@@ -78,4 +91,13 @@ public class NewZooKeeperWizard extends Wizard implements INewWizard {
 		return false;
 	}
 
+	/* (non-Javadoc)
+	 * @see org.eclipse.core.runtime.IExecutableExtension#setInitializationData
+	 * (org.eclipse.core.runtime.IConfigurationElement, java.lang.String, java.lang.Object)
+	 */
+	@Override
+	public void setInitializationData(IConfigurationElement config, String propertyName, Object
data) throws CoreException {
+		this.configElement=config;
+	}
+
 }


Mime
View raw message