Author: yzhishko
Date: 2010-04-01 08:26:12 -0400 (Thu, 01 Apr 2010)
New Revision: 21186
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesChecker.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesInfoDialog.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/FileUtil.java
Removed:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesChecker.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesInfoDialog.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6125 - natures checker is moved to *jst.jsp
plug-in directory.
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -35,8 +35,10 @@
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.text.xml.XmlEditorPlugin;
+import org.jboss.tools.jst.jsp.check.ProjectNaturesChecker;
import org.jboss.tools.jst.jsp.preferences.JSPOccurrencePreferenceConstants;
import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
@@ -279,4 +281,12 @@
}
return fImageDescRegistry;
}
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ ProjectNaturesChecker naturesChecker = ProjectNaturesChecker.getInstance();
+ naturesChecker.dispose();
+ naturesChecker = null;
+ super.stop(context);
+ }
}
\ No newline at end of file
Copied:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesChecker.java
(from rev 21185,
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesChecker.java)
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesChecker.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesChecker.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -0,0 +1,202 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.check;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.common.reporting.ProblemReportingHelper;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.util.FileUtil;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.internal.KbProject;
+import org.jboss.tools.jst.web.project.WebProject;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class ProjectNaturesChecker implements IResourceChangeListener {
+
+ private static final String SEARCH_CLASS = "javax.faces.webapp.FacesServlet";
//$NON-NLS-1$
+ public static final QualifiedName IS_NATURES_CHECK_NEED = new QualifiedName(
+ "", "Is natures check"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final QualifiedName IS_JSF_CHECK_NEED = new QualifiedName(
+ "", "Is JSF check"); //$NON-NLS-1$ //$NON-NLS-2$
+ private Set<IProject> projectsCollection;
+ private static final String JSF_NATURE = "JavaServer Faces Nature";
//$NON-NLS-1$
+ private static final String KB_NATURE = "Knowledge Base Nature";
//$NON-NLS-1$
+
+ private static ProjectNaturesChecker checker;
+
+ public static ProjectNaturesChecker getInstance(){
+ if (checker == null) {
+ checker = new ProjectNaturesChecker();
+ }
+ return checker;
+ }
+
+ private ProjectNaturesChecker() {
+ projectsCollection = new HashSet<IProject>(0);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this,
+ IResourceChangeEvent.POST_CHANGE);
+ }
+
+ public void resourceChanged(final IResourceChangeEvent event) {
+ Display display = Display.getDefault();
+ if (display != null) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ handleResourceChangeEvent(event);
+ }
+ });
+ }
+ }
+
+ public void checkNatures(IProject project) throws CoreException {
+ if (project == null) {
+ return;
+ }
+ addProject(project);
+ boolean isJSFCheck = true;
+ boolean isNaturesCheck = true;
+ updateProjectPersistentProperties(project);
+ isJSFCheck = Boolean.parseBoolean(project
+ .getPersistentProperty(IS_JSF_CHECK_NEED));
+ isNaturesCheck = Boolean.parseBoolean(project
+ .getPersistentProperty(IS_NATURES_CHECK_NEED));
+ if (isJSFCheck) {
+ if (isNaturesCheck) {
+ String[] missingNatures = getMissingNatures(project);
+ if (missingNatures != null) {
+ KbProject.checkKBBuilderInstalled(project);
+ ProjectNaturesInfoDialog dialog = new ProjectNaturesInfoDialog(
+ missingNatures, project);
+ dialog.open();
+ }
+ }
+ }
+ }
+
+ private String[] getMissingNatures(IProject project) throws CoreException {
+ List<String> missimgNatures = new ArrayList<String>(0);
+ if (project.getNature(IKbProject.NATURE_ID) == null) {
+ missimgNatures.add(JSF_NATURE);
+ }
+ if (project.getNature(WebProject.JSF_NATURE_ID) == null) {
+ missimgNatures.add(KB_NATURE);
+ }
+ if (missimgNatures.size() == 0) {
+ return null;
+ }
+ return missimgNatures.toArray(new String[0]);
+ }
+
+ private void handleResourceChangeEvent(IResourceChangeEvent changeEvent) {
+ IResourceDelta[] affectedChildren = changeEvent.getDelta()
+ .getAffectedChildren();
+ if (affectedChildren == null) {
+ return;
+ }
+ for (int i = 0; i < affectedChildren.length; i++) {
+ IResourceDelta resourceDelta = affectedChildren[i];
+ if (resourceDelta.getResource() instanceof IProject) {
+ IProject project = (IProject) resourceDelta.getResource();
+ if (resourceDelta.getKind() == IResourceDelta.ADDED) {
+ processAddProject(project);
+ continue;
+ }
+ if (resourceDelta.getKind() == IResourceDelta.REMOVED) {
+ processRemoveProject(project);
+ continue;
+ }
+ try {
+ updateProjectJSFPersistents(project);
+ } catch (CoreException e) {
+ ProblemReportingHelper.reportProblem(JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+ }
+ }
+
+ private void updateProjectPersistentProperties(IProject project)
+ throws CoreException {
+ if (project.isAccessible()) {
+ String jsfCheckString = project
+ .getPersistentProperty(IS_JSF_CHECK_NEED);
+ if (jsfCheckString == null) {
+ updateProjectJSFPersistents(project);
+ }
+ if (project.getPersistentProperty(IS_NATURES_CHECK_NEED) == null) {
+ project.setPersistentProperty(IS_NATURES_CHECK_NEED, "true");
//$NON-NLS-1$
+ }
+ }
+ }
+
+ public IProject getProject(IProject project) {
+ return projectsCollection.contains(project) ? project : null;
+ }
+
+ public void addProject(IProject project) {
+ if (getProject(project) == null) {
+ projectsCollection.add(project);
+ }
+ }
+
+ public void dispose() {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ projectsCollection.clear();
+ }
+
+ private void processAddProject(IProject project) {
+ addProject(project);
+ try {
+ updateProjectJSFPersistents(project);
+ } catch (CoreException e) {
+ ProblemReportingHelper.reportProblem(JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+
+ private void processRemoveProject(IProject project) {
+ projectsCollection.remove(project);
+ }
+
+ private void updateProjectJSFPersistents(IProject project)
+ throws CoreException {
+ if (project.isAccessible()) {
+ try {
+ IJavaElement javaElement = FileUtil.searchForClass(JavaCore
+ .create(project), SEARCH_CLASS);
+ if (javaElement == null) {
+ project.setPersistentProperty(IS_JSF_CHECK_NEED, "false"); //$NON-NLS-1$
+ } else {
+ project.setPersistentProperty(IS_JSF_CHECK_NEED, "true"); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ project.setPersistentProperty(IS_JSF_CHECK_NEED, "false"); //$NON-NLS-1$
+ }
+ }
+ }
+
+}
Copied:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesInfoDialog.java
(from rev 21185,
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesInfoDialog.java)
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesInfoDialog.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesInfoDialog.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.check;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.jboss.tools.common.reporting.ProblemReportingHelper;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class ProjectNaturesInfoDialog extends MessageDialog {
+
+ private Button button;
+ private Link link;
+ private boolean isRemember = false;
+ private static final String QUESTION = "Do not show this dialog again!";
//$NON-NLS-1$
+ private static final String TITLE = "Missing Natures"; //$NON-NLS-1$
+ private IProject project;
+
+ public ProjectNaturesInfoDialog(String[] missingNatures, IProject project) {
+ super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ TITLE, null, "", INFORMATION, //$NON-NLS-1$
+ new String[] { IDialogConstants.OK_LABEL }, 0);
+ this.project = project;
+ message = getMessageInfo(missingNatures, project);
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+
+ GridLayout gridLayout = (GridLayout) parent.getLayout();
+ gridLayout.numColumns = 2;
+ gridLayout.makeColumnsEqualWidth = true;
+ parent.setLayout(gridLayout);
+ button = new Button(parent, SWT.CHECK);
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ button.setLayoutData(gridData);
+ button.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ isRemember = !isRemember;
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ isRemember = !isRemember;
+ }
+ });
+ button.setText(QUESTION);
+ link = new Link(parent, SWT.NONE);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ gridData.grabExcessHorizontalSpace = true;
+ link.setLayoutData(gridData);
+ link.setText("<A>" + JstUIMessages.DOCS_INFO_LINK_TEXT +
"</A>"); //$NON-NLS-1$ //$NON-NLS-2$
+ link.setToolTipText(JstUIMessages.DOCS_INFO_LINK);
+ link.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ processLink(link);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ processLink(link);
+ }
+
+ });
+ return parent;
+ }
+
+ @Override
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == 0) {
+ try {
+ project.setPersistentProperty(
+ ProjectNaturesChecker.IS_NATURES_CHECK_NEED, Boolean
+ .toString(!isRemember));
+ } catch (CoreException e) {
+ }
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ private void processLink(Link link) {
+ BusyIndicator.showWhile(link.getDisplay(), new Runnable() {
+ public void run() {
+ URL theURL = null;
+ ;
+ try {
+ theURL = new URL(JstUIMessages.DOCS_INFO_LINK);
+ } catch (MalformedURLException e) {
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
+ }
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ try {
+ support.getExternalBrowser().openURL(theURL);
+ } catch (PartInitException e) {
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+ });
+ }
+
+ @SuppressWarnings("unused")
+ private String arrayToString(String[] strings) {
+ StringBuilder builder = new StringBuilder(""); //$NON-NLS-1$
+ for (int i = 0; i < strings.length; i++) {
+ builder.append(strings[i] + "\n"); //$NON-NLS-1$
+ }
+ return builder.toString();
+ }
+
+ private String getMessageInfo(String[] missingNatures, IProject project) {
+ String dialogMessage = "JBoss Tools Visual Editor might not fully work in project
\"" + project.getName() + //$NON-NLS-1$
+ "\" because it does not have JSF and code completion enabled
completely.\n\n"
+ + //$NON-NLS-1$
+ "Please use the Configure menu on the project to enable JSF if "
+ + //$NON-NLS-1$
+ "you want all features of the editor working."; //$NON-NLS-1$
+ return dialogMessage;
+ }
+
+}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -7,12 +7,13 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jst.jsp.jspeditor;
import java.util.ArrayList;
import java.util.Iterator;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.SafeRunnable;
@@ -32,16 +33,23 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
+import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.INestableKeyBindingService;
+import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
import org.eclipse.ui.part.MultiPageEditorSite;
import org.eclipse.ui.part.MultiPageSelectionProvider;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
+import org.jboss.tools.common.reporting.ProblemReportingHelper;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.check.ProjectNaturesChecker;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
/**
*
@@ -52,6 +60,8 @@
private ArrayList nestedEditors = new ArrayList(3);
+ private ActivationListener activationListener = new ActivationListener();
+
protected JSPMultiPageEditorPart() {
super();
}
@@ -123,6 +133,8 @@
public final void createPartControl(Composite parent) {
this.container = createContainer(parent);
createPages();
+ IWorkbenchWindow window = getSite().getWorkbenchWindow();
+ window.getPartService().addPartListener(activationListener);
// set the active page (page 0 by default), unless it has already been
// done
if (getActivePage() == -1)
@@ -132,6 +144,11 @@
protected abstract IEditorSite createSite(IEditorPart editor);
public void dispose() {
+ if (activationListener != null) {
+ IWorkbenchWindow window = getSite().getWorkbenchWindow();
+ window.getPartService().removePartListener(activationListener);
+ activationListener = null;
+ }
getSite().setSelectionProvider(null);
for (int i = 0; i < nestedEditors.size(); ++i) {
IEditorPart editor = (IEditorPart) nestedEditors.get(i);
@@ -291,7 +308,7 @@
if (service instanceof INestableKeyBindingService) {
final INestableKeyBindingService nestableService = (INestableKeyBindingService)
service;
nestableService.activateKeyBindingService(null);
- }
+ }
return;
}
@@ -327,4 +344,58 @@
protected void setPageText(int pageIndex, String text) {
getItem(pageIndex).setText(text);
}
+
+ private void checkNaturesFromPart(IWorkbenchPart part) throws CoreException {
+ if (part == this) {
+ IEditorInput editorInput = getEditorInput();
+ if (editorInput instanceof IFileEditorInput) {
+ ProjectNaturesChecker.getInstance()
+ .checkNatures(
+ ((IFileEditorInput) editorInput).getFile()
+ .getProject());
+ }
+ }
+ }
+
+ private class ActivationListener implements IPartListener {
+
+ public void partActivated(IWorkbenchPart part) {
+
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ boolean isCheck = true;
+ String isCheckString = System
+ .getProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER");
//$NON-NLS-1$
+ if (isCheckString != null) {
+ isCheck = Boolean.parseBoolean(isCheckString);
+ }
+ if (isCheck) {
+ if (JspEditorPlugin
+ .getDefault()
+ .getPreferenceStore()
+ .getBoolean(
+ IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE))
{
+ try {
+ checkNaturesFromPart(part);
+ } catch (CoreException e) {
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+ }
+ }
+ }
}
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/JstUIMessages.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -120,4 +120,7 @@
public static String CSS_REMOVE_CSS_CLASS_TIP;
public static String CSS_MOVE_UP_CSS_CLASS_TIP;
public static String CSS_MOVE_DOWN_CSS_CLASS_TIP;
+ public static String INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE;
+ public static String DOCS_INFO_LINK;
+ public static String DOCS_INFO_LINK_TEXT;
}
\ No newline at end of file
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2010-04-01
12:26:12 UTC (rev 21186)
@@ -96,4 +96,8 @@
JSPDialogContentProposalProvider_NewELExpression=New EL Expression
PROPERTY_NAME_COLUMN=Attribute
-PROPERTY_VALUE_COLUMN=Value
\ No newline at end of file
+PROPERTY_VALUE_COLUMN=Value
+
+INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE=Inform when a project might
not be configured properly for Visual Page Editor
+DOCS_INFO_LINK=http://www.jboss.org/community/docs/DOC-10862
+DOCS_INFO_LINK_TEXT=See JBoss Tools Visual Editor FAQ
\ No newline at end of file
Added:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/FileUtil.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/FileUtil.java
(rev 0)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/util/FileUtil.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.jsp.util;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.core.search.IJavaSearchConstants;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.eclipse.jdt.core.search.SearchEngine;
+import org.eclipse.jdt.core.search.SearchMatch;
+import org.eclipse.jdt.core.search.SearchParticipant;
+import org.eclipse.jdt.core.search.SearchPattern;
+import org.eclipse.jdt.core.search.SearchRequestor;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class FileUtil {
+
+ public static IJavaElement searchForClass(IJavaProject javaProject, String className)
throws JavaModelException {
+// Get the search pattern
+ SearchPattern pattern = SearchPattern.createPattern(className,
IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH
| SearchPattern.R_CASE_SENSITIVE);
+ // Get the search scope
+ IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {
javaProject });
+
+ final List<SearchMatch> matches = new ArrayList<SearchMatch>();
+ // Get the search requestor
+ SearchRequestor requestor = new SearchRequestor() {
+ public void acceptSearchMatch(SearchMatch match) throws CoreException {
+ matches.add(match);
+ }
+ };
+
+ // Search
+ SearchEngine searchEngine = new SearchEngine();
+ try {
+ searchEngine.search(pattern, new SearchParticipant[]
{SearchEngine.getDefaultSearchParticipant()}, scope, requestor, null);
+ } catch (CoreException ex) {
+ // Ignore
+// ExtensionsPlugin.log(ex);
+ }
+ for (Iterator i = matches.iterator(); i != null && i.hasNext();) {
+ IJavaElement element = (IJavaElement)((SearchMatch)i.next()).getElement();
+ String classQualifiedName = getQualifiedClassName(element);
+ if (className.equals(classQualifiedName))
+ return element;
+ }
+ return javaProject.findType(className, new NullProgressMonitor());
+ }
+
+ private static String getQualifiedClassName(IJavaElement element) {
+ if(element instanceof IType) {
+ return ((IType)element).getFullyQualifiedName('.');
+ }
+ return null;
+ }
+
+}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/VpePlugin.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -18,7 +18,6 @@
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
-import org.jboss.tools.vpe.editor.util.ProjectNaturesChecker;
import org.jboss.tools.vpe.xulrunner.browser.XulRunnerBrowser;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
@@ -54,9 +53,6 @@
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
- ProjectNaturesChecker naturesChecker = ProjectNaturesChecker.getInstance();
- naturesChecker.dispose();
- naturesChecker = null;
super.stop(context);
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeEditorPart.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -79,7 +79,6 @@
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.mozilla.MozillaPreview;
import org.jboss.tools.vpe.editor.mozilla.listener.EditorLoadWindowListener;
-import org.jboss.tools.vpe.editor.util.ProjectNaturesChecker;
import org.jboss.tools.vpe.editor.xpl.CustomSashForm;
import org.jboss.tools.vpe.editor.xpl.EditorSettings;
import org.jboss.tools.vpe.editor.xpl.SashSetting;
@@ -121,7 +120,6 @@
private Splitter verticalToolbarSplitter = null;
private Composite verticalToolbarEmpty = null;
private ToolBar toolBar = null;
- private ProjectNaturesChecker naturesChecker;
public StructuredTextEditor getSourceEditor() {
return sourceEditor;
@@ -1016,21 +1014,7 @@
}
public void partOpened(IWorkbenchPart part) {
- boolean isCheck = true;
- String isCheckString =
System.getProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER");
//$NON-NLS-1$
- if (isCheckString != null) {
- isCheck = Boolean.parseBoolean(isCheckString);
- }
- if (isCheck) {
- if (JspEditorPlugin.getDefault().getPreferenceStore().
- getBoolean(IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE))
{
- try {
- checkNaturesFromPart(part);
- } catch (CoreException e) {
- VpePlugin.getPluginLog().logError(e);
- }
- }
- }
+
}
@Override
@@ -1250,14 +1234,4 @@
}
}
- private void checkNaturesFromPart(IWorkbenchPart part) throws CoreException{
- if (part == multiPageEditor) {
- IEditorInput editorInput = multiPageEditor.getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- naturesChecker = ProjectNaturesChecker.getInstance();
- naturesChecker.checkNatures(((IFileEditorInput)editorInput).getFile().getProject());
- }
- }
- }
-
}
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/FileUtil.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -326,42 +326,4 @@
return inputPath;
}
- public static IJavaElement searchForClass(IJavaProject javaProject, String className)
throws JavaModelException {
-// Get the search pattern
- SearchPattern pattern = SearchPattern.createPattern(className,
IJavaSearchConstants.TYPE, IJavaSearchConstants.DECLARATIONS, SearchPattern.R_EXACT_MATCH
| SearchPattern.R_CASE_SENSITIVE);
- // Get the search scope
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(new IJavaElement[] {
javaProject });
-
- final List<SearchMatch> matches = new ArrayList<SearchMatch>();
- // Get the search requestor
- SearchRequestor requestor = new SearchRequestor() {
- public void acceptSearchMatch(SearchMatch match) throws CoreException {
- matches.add(match);
- }
- };
-
- // Search
- SearchEngine searchEngine = new SearchEngine();
- try {
- searchEngine.search(pattern, new SearchParticipant[]
{SearchEngine.getDefaultSearchParticipant()}, scope, requestor, null);
- } catch (CoreException ex) {
- // Ignore
-// ExtensionsPlugin.log(ex);
- }
- for (Iterator i = matches.iterator(); i != null && i.hasNext();) {
- IJavaElement element = (IJavaElement)((SearchMatch)i.next()).getElement();
- String classQualifiedName = getQualifiedClassName(element);
- if (className.equals(classQualifiedName))
- return element;
- }
- return javaProject.findType(className, new NullProgressMonitor());
- }
-
- private static String getQualifiedClassName(IJavaElement element) {
- if(element instanceof IType) {
- return ((IType)element).getFullyQualifiedName('.');
- }
- return null;
- }
-
}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesChecker.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesChecker.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesChecker.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor.util;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceChangeEvent;
-import org.eclipse.core.resources.IResourceChangeListener;
-import org.eclipse.core.resources.IResourceDelta;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.QualifiedName;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.swt.widgets.Display;
-import org.jboss.tools.jst.web.kb.IKbProject;
-import org.jboss.tools.jst.web.kb.internal.KbProject;
-import org.jboss.tools.jst.web.project.WebProject;
-import org.jboss.tools.vpe.VpePlugin;
-
-/**
- *
- * @author yzhishko
- *
- */
-
-public class ProjectNaturesChecker implements IResourceChangeListener {
-
- private static final String SEARCH_CLASS = "javax.faces.webapp.FacesServlet";
//$NON-NLS-1$
- public static final QualifiedName IS_NATURES_CHECK_NEED = new QualifiedName(
- "", "Is natures check"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final QualifiedName IS_JSF_CHECK_NEED = new QualifiedName(
- "", "Is JSF check"); //$NON-NLS-1$ //$NON-NLS-2$
- private Set<IProject> projectsCollection;
- private static final String JSF_NATURE = "JavaServer Faces Nature";
//$NON-NLS-1$
- private static final String KB_NATURE = "Knowledge Base Nature";
//$NON-NLS-1$
-
- private static ProjectNaturesChecker checker;
-
- public static ProjectNaturesChecker getInstance(){
- if (checker == null) {
- checker = new ProjectNaturesChecker();
- }
- return checker;
- }
-
- private ProjectNaturesChecker() {
- projectsCollection = new HashSet<IProject>(0);
- ResourcesPlugin.getWorkspace().addResourceChangeListener(this,
- IResourceChangeEvent.POST_CHANGE);
- }
-
- public void resourceChanged(final IResourceChangeEvent event) {
- Display display = Display.getDefault();
- if (display != null) {
- display.asyncExec(new Runnable() {
- public void run() {
- handleResourceChangeEvent(event);
- }
- });
- }
- }
-
- public void checkNatures(IProject project) throws CoreException {
- if (project == null) {
- return;
- }
- addProject(project);
- boolean isJSFCheck = true;
- boolean isNaturesCheck = true;
- updateProjectPersistentProperties(project);
- isJSFCheck = Boolean.parseBoolean(project
- .getPersistentProperty(IS_JSF_CHECK_NEED));
- isNaturesCheck = Boolean.parseBoolean(project
- .getPersistentProperty(IS_NATURES_CHECK_NEED));
- if (isJSFCheck) {
- if (isNaturesCheck) {
- String[] missingNatures = getMissingNatures(project);
- if (missingNatures != null) {
- KbProject.checkKBBuilderInstalled(project);
- ProjectNaturesInfoDialog dialog = new ProjectNaturesInfoDialog(
- missingNatures, project);
- dialog.open();
- }
- }
- }
- }
-
- private String[] getMissingNatures(IProject project) throws CoreException {
- List<String> missimgNatures = new ArrayList<String>(0);
- if (project.getNature(IKbProject.NATURE_ID) == null) {
- missimgNatures.add(JSF_NATURE);
- }
- if (project.getNature(WebProject.JSF_NATURE_ID) == null) {
- missimgNatures.add(KB_NATURE);
- }
- if (missimgNatures.size() == 0) {
- return null;
- }
- return missimgNatures.toArray(new String[0]);
- }
-
- private void handleResourceChangeEvent(IResourceChangeEvent changeEvent) {
- IResourceDelta[] affectedChildren = changeEvent.getDelta()
- .getAffectedChildren();
- if (affectedChildren == null) {
- return;
- }
- for (int i = 0; i < affectedChildren.length; i++) {
- IResourceDelta resourceDelta = affectedChildren[i];
- if (resourceDelta.getResource() instanceof IProject) {
- IProject project = (IProject) resourceDelta.getResource();
- if (resourceDelta.getKind() == IResourceDelta.ADDED) {
- processAddProject(project);
- continue;
- }
- if (resourceDelta.getKind() == IResourceDelta.REMOVED) {
- processRemoveProject(project);
- continue;
- }
- try {
- updateProjectJSFPersistents(project);
- } catch (CoreException e) {
- VpePlugin.getPluginLog().logError(e);
- }
- }
- }
- }
-
- private void updateProjectPersistentProperties(IProject project)
- throws CoreException {
- if (project.isAccessible()) {
- String jsfCheckString = project
- .getPersistentProperty(IS_JSF_CHECK_NEED);
- if (jsfCheckString == null) {
- updateProjectJSFPersistents(project);
- }
- if (project.getPersistentProperty(IS_NATURES_CHECK_NEED) == null) {
- project.setPersistentProperty(IS_NATURES_CHECK_NEED, "true");
//$NON-NLS-1$
- }
- }
- }
-
- public IProject getProject(IProject project) {
- return projectsCollection.contains(project) ? project : null;
- }
-
- public void addProject(IProject project) {
- if (getProject(project) == null) {
- projectsCollection.add(project);
- }
- }
-
- public void dispose() {
- ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
- projectsCollection.clear();
- }
-
- private void processAddProject(IProject project) {
- addProject(project);
- try {
- updateProjectJSFPersistents(project);
- } catch (CoreException e) {
- VpePlugin.getPluginLog().logError(e);
- }
- }
-
- private void processRemoveProject(IProject project) {
- projectsCollection.remove(project);
- }
-
- private void updateProjectJSFPersistents(IProject project)
- throws CoreException {
- if (project.isAccessible()) {
- try {
- IJavaElement javaElement = FileUtil.searchForClass(JavaCore
- .create(project), SEARCH_CLASS);
- if (javaElement == null) {
- project.setPersistentProperty(IS_JSF_CHECK_NEED, "false"); //$NON-NLS-1$
- } else {
- project.setPersistentProperty(IS_JSF_CHECK_NEED, "true"); //$NON-NLS-1$
- }
- } catch (CoreException e) {
- project.setPersistentProperty(IS_JSF_CHECK_NEED, "false"); //$NON-NLS-1$
- }
- }
- }
-
-}
Deleted:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesInfoDialog.java
===================================================================
---
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesInfoDialog.java 2010-04-01
09:23:01 UTC (rev 21185)
+++
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/ProjectNaturesInfoDialog.java 2010-04-01
12:26:12 UTC (rev 21186)
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007-2010 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.vpe.editor.util;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
-import org.jboss.tools.vpe.VpePlugin;
-import org.jboss.tools.vpe.messages.VpeUIMessages;
-
-/**
- *
- * @author yzhishko
- *
- */
-
-public class ProjectNaturesInfoDialog extends MessageDialog {
-
- private Button button;
- private Link link;
- private boolean isRemember = false;
- private static final String QUESTION = "Do not show this dialog again!";
//$NON-NLS-1$
- private static final String TITLE = "Missing Natures"; //$NON-NLS-1$
- private IProject project;
-
- public ProjectNaturesInfoDialog(String[] missingNatures, IProject project) {
- super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
- TITLE, null, "", INFORMATION, //$NON-NLS-1$
- new String[] { IDialogConstants.OK_LABEL }, 0);
- this.project = project;
- message = getMessageInfo(missingNatures, project);
- }
-
- @Override
- protected Control createCustomArea(Composite parent) {
-
- GridLayout gridLayout = (GridLayout) parent.getLayout();
- gridLayout.numColumns = 2;
- gridLayout.makeColumnsEqualWidth = true;
- parent.setLayout(gridLayout);
- button = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- button.setLayoutData(gridData);
- button.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- isRemember = !isRemember;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- isRemember = !isRemember;
- }
- });
- button.setText(QUESTION);
- link = new Link(parent, SWT.NONE);
- gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- gridData.grabExcessHorizontalSpace = true;
- link.setLayoutData(gridData);
- link.setText("<A>" + VpeUIMessages.MOZILLA_LOADING_ERROR_LINK_TEXT +
"</A>"); //$NON-NLS-1$ //$NON-NLS-2$
- link.setToolTipText(VpeUIMessages.MOZILLA_LOADING_ERROR_LINK);
- link.addSelectionListener(new SelectionListener() {
-
- public void widgetSelected(SelectionEvent e) {
- processLink(link);
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- processLink(link);
- }
-
- });
- return parent;
- }
-
- @Override
- protected void buttonPressed(int buttonId) {
- if (buttonId == 0) {
- try {
- project.setPersistentProperty(ProjectNaturesChecker.IS_NATURES_CHECK_NEED,
Boolean.toString(!isRemember));
- } catch (CoreException e) {
- }
- }
- super.buttonPressed(buttonId);
- }
-
- private void processLink(Link link) {
- BusyIndicator.showWhile(link.getDisplay(), new Runnable() {
- public void run() {
- URL theURL = null;
- ;
- try {
- theURL = new URL(VpeUIMessages.MOZILLA_LOADING_ERROR_LINK);
- } catch (MalformedURLException e) {
- VpePlugin.reportProblem(e);
- }
- IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
- .getBrowserSupport();
- try {
- support.getExternalBrowser().openURL(theURL);
- } catch (PartInitException e) {
- VpePlugin.reportProblem(e);
- }
- }
- });
- }
-
- @SuppressWarnings("unused")
- private String arrayToString(String[] strings){
- StringBuilder builder = new StringBuilder(""); //$NON-NLS-1$
- for (int i = 0; i < strings.length; i++) {
- builder.append(strings[i]+"\n"); //$NON-NLS-1$
- }
- return builder.toString();
- }
-
- private String getMessageInfo(String[] missingNatures, IProject project){
- String dialogMessage = "JBoss Tools Visual Editor might not fully work in project
\"" + project.getName() + //$NON-NLS-1$
- "\" because it does not have JSF and code completion enabled
completely.\n\n" + //$NON-NLS-1$
- "Please use the Configure menu on the project to enable JSF if " +
//$NON-NLS-1$
- "you want all features of the editor working."; //$NON-NLS-1$
- return dialogMessage;
- }
-
-}