[jbosstools-commits] JBoss Tools SVN: r30812 - in branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples: fixes and 3 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Mon Apr 25 11:12:36 EDT 2011
Author: snjeza
Date: 2011-04-25 11:12:36 -0400 (Mon, 25 Apr 2011)
New Revision: 30812
Modified:
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java
branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java
Log:
JBIDE-8399 Improve US States SOAP Service Project Example
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/FixDialog.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.dialog;
import java.util.ArrayList;
@@ -34,6 +44,11 @@
import org.jboss.tools.project.examples.model.ProjectFix;
import org.jboss.tools.project.examples.wizard.NewProjectExamplesWizardPage;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class FixDialog extends Dialog {
private static final int FIX_BUTTON = 1;
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/PluginFix.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.fixes;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -9,6 +19,11 @@
import org.jboss.tools.project.examples.model.ProjectFix;
import org.osgi.framework.Bundle;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class PluginFix implements ProjectExamplesFix {
public boolean canFix(Project project, ProjectFix fix) {
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/ProjectExamplesFix.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.fixes;
import org.eclipse.core.runtime.IProgressMonitor;
@@ -4,6 +14,11 @@
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
+/**
+ *
+ * @author snjeza
+ *
+ */
public interface ProjectExamplesFix {
boolean canFix(Project project, ProjectFix fix);
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/SeamRuntimeFix.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.fixes;
import java.util.StringTokenizer;
@@ -16,6 +26,11 @@
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.osgi.service.prefs.BackingStoreException;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class SeamRuntimeFix implements ProjectExamplesFix {
public boolean canFix(Project project, ProjectFix fix) {
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/fixes/WTPRuntimeFix.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.fixes;
import java.io.File;
@@ -28,16 +38,24 @@
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.tools.portlet.core.internal.PortletRuntimeComponentProvider;
import org.jboss.tools.project.examples.Messages;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectFix;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class WTPRuntimeFix implements ProjectExamplesFix {
+ private static final String TEIID_DEPLOYER = "teiid.deployer"; //$NON-NLS-1$
private static final String RIFTSAW_SAR = "riftsaw.sar"; //$NON-NLS-1$
private static final String BPEL = "bpel"; //$NON-NLS-1$
+ private static final String TEIID = "teiid"; //$NON-NLS-1$
private static final String JBOSSESB_SAR = "jbossesb.sar"; //$NON-NLS-1$
private static final String JBOSSESB_ESB = "jbossesb.esb"; //$NON-NLS-1$
private static final String ESB = "esb"; //$NON-NLS-1$
@@ -66,6 +84,9 @@
IProject eclipseProject = eclipseProjects[i];
try {
IFacetedProject facetedProject = ProjectFacetsManager.create(eclipseProject);
+ if (facetedProject == null) {
+ continue;
+ }
org.eclipse.wst.common.project.facet.core.runtime.IRuntime wtpRuntime = facetedProject.getPrimaryRuntime();
if (wtpRuntime != null) {
IRuntime runtime = getRuntime(wtpRuntime);
@@ -212,6 +233,11 @@
return null;
}
}
+ if (TEIID.equals(component)) {
+ if (!isTeiidPresent(location, runtime)) {
+ return null;
+ }
+ }
return runtime;
}
return null;
@@ -248,6 +274,20 @@
}
return false;
}
+
+ public static boolean isTeiidPresent(final File location,
+ IRuntime runtime) {
+ IJBossServerRuntime jbossRuntime = (IJBossServerRuntime)runtime.loadAdapter(IJBossServerRuntime.class, new NullProgressMonitor());
+ if (jbossRuntime != null) {
+ IPath jbossLocation = runtime.getLocation();
+ IPath configPath = jbossLocation.append(IJBossServerConstants.SERVER).append(jbossRuntime.getJBossConfiguration());
+ IPath deployersPath = configPath.append(IJBossRuntimeResourceConstants.DEPLOYERS);
+ File deployersFile = deployersPath.toFile();
+ File teiidFile = new File(deployersFile, TEIID_DEPLOYER);
+ return teiidFile.exists();
+ }
+ return false;
+ }
private static boolean exists(final File location,String esbDir) {
if (Platform.getOS().equals(Platform.OS_WIN32)) {
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectFix.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.model;
import java.util.HashMap;
@@ -3,12 +13,7 @@
import java.util.Map;
-import org.eclipse.equinox.internal.p2.ui.sdk.ProvSDKUIActivator;
-import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.internal.p2.ui.IProvHelpContextIds;
-import org.eclipse.equinox.internal.p2.ui.ProvUIActivator;
-import org.eclipse.equinox.internal.p2.ui.QueryableMetadataRepositoryManager;
import org.eclipse.equinox.internal.p2.ui.dialogs.InstallWizard;
import org.eclipse.equinox.internal.p2.ui.dialogs.ProvisioningWizardDialog;
-import org.eclipse.equinox.p2.ui.Policy;
import org.eclipse.equinox.p2.ui.ProvisioningUI;
import org.eclipse.jface.preference.PreferenceDialog;
@@ -18,8 +23,12 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.PreferencesUtil;
import org.jboss.tools.project.examples.Messages;
-import org.jboss.tools.project.examples.ProjectExamplesActivator;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class ProjectFix {
public final static String WTP_RUNTIME = "wtpruntime"; //$NON-NLS-1$
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/SiteCategory.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.model;
import java.util.Set;
@@ -2,2 +12,7 @@
+/**
+ *
+ * @author snjeza
+ *
+ */
public class SiteCategory implements IProjectExampleSite {
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencePage.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.preferences;
import java.net.URL;
@@ -32,6 +42,11 @@
import org.jboss.tools.project.examples.model.ProjectUtil;
import org.jboss.tools.project.examples.model.SiteCategory;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class ProjectExamplesPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/ProjectExamplesPreferencesInitializer.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,11 +1,26 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
+
package org.jboss.tools.project.examples.preferences;
-
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.core.runtime.preferences.DefaultScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class ProjectExamplesPreferencesInitializer extends
AbstractPreferenceInitializer {
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/SiteDialog.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.preferences;
import java.io.File;
@@ -27,6 +37,11 @@
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.model.ProjectExampleSite;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class SiteDialog extends TitleAreaDialog {
private static final String ADD_PROJECT_EXAMPLE_SITE = Messages.SiteDialog_Add_Project_Example_Site;
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/preferences/Sites.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.preferences;
import java.util.HashSet;
@@ -8,6 +18,11 @@
import org.jboss.tools.project.examples.model.ProjectUtil;
import org.jboss.tools.project.examples.model.SiteCategory;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class Sites {
private SiteCategory[] siteCategories;
private SiteCategory userSite;
Modified: branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java
===================================================================
--- branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java 2011-04-24 16:39:08 UTC (rev 30811)
+++ branches/jbosstools-3.2.x/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java 2011-04-25 15:12:36 UTC (rev 30812)
@@ -1,3 +1,13 @@
+/*************************************************************************************
+ * Copyright (c) 2008-2011 JBoss by Red Hat and others.
+ * 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:
+ * JBoss by Red Hat - Initial implementation.
+ ************************************************************************************/
package org.jboss.tools.project.examples.wizard;
import java.util.List;
@@ -9,6 +19,11 @@
import org.jboss.tools.project.examples.model.Project;
import org.jboss.tools.project.examples.model.ProjectModelElement;
+/**
+ *
+ * @author snjeza
+ *
+ */
public class SiteFilter extends ViewerFilter {
private String site;
More information about the jbosstools-commits
mailing list