You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hdt.apache.org by rs...@apache.org on 2014/06/26 10:36:33 UTC
[10/27] git commit: HDT-54: Adding a CLusterView Wizard.
HDT-54: Adding a CLusterView Wizard.
Project: http://git-wip-us.apache.org/repos/asf/incubator-hdt/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-hdt/commit/092213c1
Tree: http://git-wip-us.apache.org/repos/asf/incubator-hdt/tree/092213c1
Diff: http://git-wip-us.apache.org/repos/asf/incubator-hdt/diff/092213c1
Branch: refs/heads/hadoop-eclipse-merge
Commit: 092213c1981376f3bca05522b4e0f56669d5c606
Parents: ec415a9
Author: Rahul Sharma <rs...@apache.org>
Authored: Thu May 15 15:30:46 2014 +0530
Committer: Rahul Sharma <rs...@apache.org>
Committed: Fri May 23 08:46:47 2014 +0530
----------------------------------------------------------------------
org.apache.hdt.ui/plugin.xml | 8 +++
.../hdt/ui/internal/mr/NewLocationWizard.java | 75 ++++++++++++++++++++
2 files changed, 83 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/092213c1/org.apache.hdt.ui/plugin.xml
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/plugin.xml b/org.apache.hdt.ui/plugin.xml
index af68ffa..7bc1a36 100644
--- a/org.apache.hdt.ui/plugin.xml
+++ b/org.apache.hdt.ui/plugin.xml
@@ -186,6 +186,14 @@
id="org.apache.hdt.ui.wizard.newZooKeeperServer"
name="New ZooKeeper Server">
</wizard>
+ <wizard
+ category="org.apache.hdt.ui.newWizards.category"
+ class="org.apache.hdt.ui.internal.mr.NewLocationWizard"
+ finalPerspective="org.apache.hdt.ui.perspective"
+ icon="icons/location-new-16x16.png"
+ id="org.apache.hdt.ui.wizard.newMRCluster"
+ name="New MR Cluster">
+ </wizard>
<wizard category="org.apache.hdt.ui.newWizards.category"
class="org.apache.hdt.ui.internal.mr.NewMapperWizard"
icon="icons/mapper16.png"
http://git-wip-us.apache.org/repos/asf/incubator-hdt/blob/092213c1/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/mr/NewLocationWizard.java
----------------------------------------------------------------------
diff --git a/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/mr/NewLocationWizard.java b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/mr/NewLocationWizard.java
new file mode 100644
index 0000000..ee4e399
--- /dev/null
+++ b/org.apache.hdt.ui/src/org/apache/hdt/ui/internal/mr/NewLocationWizard.java
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.hdt.ui.internal.mr;
+
+import org.apache.hdt.core.launch.AbstractHadoopCluster;
+import org.apache.hdt.ui.internal.launch.HadoopLocationWizard;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExecutableExtension;
+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 NewLocationWizard extends Wizard implements INewWizard,IExecutableExtension{
+
+ private HadoopLocationWizard serverLocationWizardPage;
+ private IConfigurationElement configElement;
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
+ */
+ @Override
+ public void init(IWorkbench workbench, IStructuredSelection selection) {
+ // TODO Auto-generated method stub
+
+ }
+ @Override
+ public void addPages() {
+ super.addPages();
+ if (serverLocationWizardPage == null) {
+ serverLocationWizardPage = new HadoopLocationWizard();
+ }
+ addPage(serverLocationWizardPage);
+ }
+ /* (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;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.wizard.Wizard#performFinish()
+ */
+ @Override
+ public boolean performFinish() {
+ Display.getDefault().syncExec(new Runnable() {
+ public void run() {
+ BasicNewProjectResourceWizard.updatePerspective(configElement);
+ }
+ });
+ AbstractHadoopCluster cluster = serverLocationWizardPage.performFinish();
+ return cluster!=null;
+ }
+
+}
\ No newline at end of file