Author: adietish
Date: 2011-12-06 17:32:12 -0500 (Tue, 06 Dec 2011)
New Revision: 37024
Removed:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/JavaProjectUtils.java
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java
Log:
[JBIDE-10171] removed erroneous #setMatchEmptySelection(false), replaced check for java
nature by check for wtp proj (checking for module nature)
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-12-06
22:16:56 UTC (rev 37023)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/META-INF/MANIFEST.MF 2011-12-06
22:32:12 UTC (rev 37024)
@@ -31,11 +31,11 @@
org.eclipse.wst.common.modulecore;bundle-version="1.2.100",
org.eclipse.team.ui;bundle-version="3.6.100",
org.eclipse.jdt.launching;bundle-version="3.6.0",
- org.eclipse.jdt.core;bundle-version="3.7.0",
org.eclipse.debug.ui;bundle-version="3.7.0",
org.eclipse.ui.navigator;bundle-version="3.5.100",
org.eclipse.ui.console;bundle-version="3.5.100",
- org.eclipse.core.expressions;bundle-version="3.4.300"
+ org.eclipse.core.expressions;bundle-version="3.4.300",
+ org.eclipse.wst.common.modulecore;bundle-version="1.2.101"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.jboss.tools.common.databinding,
Modified:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java 2011-12-06
22:16:56 UTC (rev 37023)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/SelectExistingProjectDialog.java 2011-12-06
22:32:12 UTC (rev 37024)
@@ -15,24 +15,28 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.ElementListSelectionDialog;
import org.eclipse.ui.ide.IDE.SharedImages;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
import org.jboss.tools.openshift.egit.core.EGitUtils;
-import org.jboss.tools.openshift.express.internal.utils.JavaProjectUtils;
/**
* @author André Dietisheim
*/
public class SelectExistingProjectDialog extends ElementListSelectionDialog {
- public SelectExistingProjectDialog(Shell shell) {
+ public SelectExistingProjectDialog(String openShiftAppName, Shell shell) {
super(shell, new ProjectLabelProvider());
setTitle("Project Selection");
- setMessage("Please select the project that shall be pushed to OpenShift");
+ setMessage(NLS.bind(
+ "Select an existing project for {0}.\nOnly java projects which are not Team
shared can be used.",
+ openShiftAppName));
setMultipleSelection(false);
setAllowDuplicates(false);
setElements(getProjects());
@@ -57,13 +61,21 @@
return false;
}
- if (!JavaProjectUtils.isJavaProject(project)) {
+ if (!hasModuleNature(project)) {
return false;
}
return true;
}
+ private boolean hasModuleNature(IProject project) {
+ try {
+ return project.hasNature(IModuleConstants.MODULE_NATURE_ID);
+ } catch(CoreException e) {
+ return false;
+ }
+ }
+
private static class ProjectLabelProvider extends LabelProvider {
@Override
Deleted:
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/JavaProjectUtils.java
===================================================================
---
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/JavaProjectUtils.java 2011-12-06
22:16:56 UTC (rev 37023)
+++
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/utils/JavaProjectUtils.java 2011-12-06
22:32:12 UTC (rev 37024)
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is 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:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.openshift.express.internal.utils;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jdt.core.JavaCore;
-
-/**
- * @author André Dietisheim
- */
-public class JavaProjectUtils {
-
- public static boolean isJavaProject(IProject project) {
- try {
- if (!project.hasNature(JavaCore.NATURE_ID)) {
- return false;
- }
- } catch (CoreException e) {
- // project is not opened, does not exist, etc.
- return false;
- }
- return true;
- }
-
-}