Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jsf/plugins/org.eclipse.jst.jsf.ui')
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/.classpath7
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/.cvsignore5
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/.project28
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.core.resources.prefs4
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.core.prefs77
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.ui.prefs3
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/META-INF/MANIFEST.MF39
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/about.html22
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/build.properties20
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/icons/attr_val.gifbin124 -> 0 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/icons/full/wizban/addlibrary_wiz.gifbin3148 -> 0 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_l_obj.gifbin581 -> 0 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_obj.gifbin587 -> 0 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/library_obj.gifbin338 -> 0 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/icons/sample.gifbin983 -> 0 bytes
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/plugin.properties31
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml177
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/JSFUiPlugin.java103
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java379
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibrariesPreferencePage.java404
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryContainerWizardPage.java579
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryEditControl.java499
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationEvent.java54
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationListener.java23
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryWizard.java285
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialog.java137
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialogWithToggle.java144
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentDetailTableProvider.java130
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeView.java390
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeViewProvider.java64
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/DTJSFViewModel.java91
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/JSFContentAssistProcessor.java295
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/el/JSFELContentAssistProcessor.java124
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/IJSFImplLibraryCreationListener.java26
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFImplLibraryCreationEvent.java44
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControl.java997
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeEvent.java36
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeListener.java24
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java107
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ELHyperlinkDetector.java90
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ITestHyperlink.java16
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSFELHover.java67
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSPSourceUtil.java119
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java76
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties109
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/preferences/EmptyRootPreferencePage.java109
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/project/facet/JSFFacetInstallPage.java610
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TagRegistryView.java369
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TaglibContentProvider.java341
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ELPrefPanel.java115
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidationPreferencePage.java86
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidator.java128
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/MyLocalizedMessage.java103
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/OptionsConfigurationBlock.java979
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PixelConverter.java74
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PreferencesMessages.java209
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ProblemSeveritiesConfigurationBlock.java421
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ScrolledPageContent.java81
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationMessageFactory.java95
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationReporter.java48
-rw-r--r--jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/messages.properties64
61 files changed, 0 insertions, 9657 deletions
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/.classpath b/jsf/plugins/org.eclipse.jst.jsf.ui/.classpath
deleted file mode 100644
index 304e86186..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/.cvsignore b/jsf/plugins/org.eclipse.jst.jsf.ui/.cvsignore
deleted file mode 100644
index 117a1fe6b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-bin
-@dot*
-temp.folder
-build.xml
-javaCompiler...args
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/.project b/jsf/plugins/org.eclipse.jst.jsf.ui/.project
deleted file mode 100644
index 45f845d24..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jst.jsf.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.core.resources.prefs b/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index c8e6e652e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,4 +0,0 @@
-#Sun May 27 16:04:34 EDT 2007
-eclipse.preferences.version=1
-encoding//src/org/eclipse/jst/jsf/ui/internal/messages.properties=8859_1
-encoding/<project>=ISO-8859-1
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.core.prefs b/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 123186cd0..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,77 +0,0 @@
-#Tue Apr 10 09:49:41 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.doc.comment.support=enabled
-org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.autoboxing=warning
-org.eclipse.jdt.core.compiler.problem.deprecation=warning
-org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
-org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
-org.eclipse.jdt.core.compiler.problem.discouragedReference=ignore
-org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
-org.eclipse.jdt.core.compiler.problem.fatalOptionalError=enabled
-org.eclipse.jdt.core.compiler.problem.fieldHiding=warning
-org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
-org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
-org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
-org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
-org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
-org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
-org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
-org.eclipse.jdt.core.compiler.problem.invalidJavadoc=error
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTags=enabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsDeprecatedRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled
-org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.localVariableHiding=warning
-org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
-org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingJavadocComments=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocCommentsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingJavadocTags=warning
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.missingJavadocTagsVisibility=protected
-org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
-org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
-org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
-org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
-org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
-org.eclipse.jdt.core.compiler.problem.nullReference=ignore
-org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
-org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
-org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
-org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore
-org.eclipse.jdt.core.compiler.problem.rawTypeReference=ignore
-org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore
-org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
-org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
-org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
-org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
-org.eclipse.jdt.core.compiler.problem.typeParameterHiding=ignore
-org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=ignore
-org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=error
-org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
-org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
-org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
-org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
-org.eclipse.jdt.core.compiler.problem.unusedImport=error
-org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
-org.eclipse.jdt.core.compiler.problem.unusedLocal=error
-org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
-org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
-org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=error
-org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.ui.prefs b/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.ui.prefs
deleted file mode 100644
index 39df0950a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/.settings/org.eclipse.jdt.ui.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Tue Apr 10 09:49:42 PDT 2007
-eclipse.preferences.version=1
-org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8"?><templates/>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/META-INF/MANIFEST.MF b/jsf/plugins/org.eclipse.jst.jsf.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 5a43a4961..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,39 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %plugin.name
-Bundle-SymbolicName: org.eclipse.jst.jsf.ui; singleton:=true
-Bundle-Version: 1.0.1.qualifier
-Bundle-Activator: org.eclipse.jst.jsf.ui.internal.JSFUiPlugin
-Bundle-Vendor: %plugin.provider
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.jst.jsf.core;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.core.resources;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.jst.jsf.common;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.jface.text;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.0,1.2.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.0.100,1.1.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.0.101,1.2.0)",
- org.eclipse.emf.ecore;bundle-version="[2.2.0,3.0.0)",
- org.eclipse.jst.jsp.ui;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.0.101,1.2.0)",
- org.eclipse.ui.forms;bundle-version="[3.2.0,4.0.0)",
- org.eclipse.jst.jsf.common.runtime;bundle-version="[1.0.0,1.1.0)",
- org.eclipse.jst.jsp.core,
- org.eclipse.wst.validation;bundle-version="1.1.103"
-Bundle-ActivationPolicy: lazy
-Export-Package: org.eclipse.jst.jsf.ui.internal;x-friends:="org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.ui.internal.classpath;x-friends:="org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.ui.internal.contentassist;x-internal:=true,
- org.eclipse.jst.jsf.ui.internal.contentassist.el;x-internal:=true,
- org.eclipse.jst.jsf.ui.internal.jsflibraryconfig;x-internal:=true,
- org.eclipse.jst.jsf.ui.internal.jspeditor;x-internal:=true,
- org.eclipse.jst.jsf.ui.internal.preferences;x-internal:=true,
- org.eclipse.jst.jsf.ui.internal.project.facet;x-friends:="org.eclipse.jst.jsf.ui.tests",
- org.eclipse.jst.jsf.ui.internal.validation;x-internal:=true
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/about.html b/jsf/plugins/org.eclipse.jst.jsf.ui/about.html
deleted file mode 100644
index 04d4782f4..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/about.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-</body>
-</html>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/build.properties b/jsf/plugins/org.eclipse.jst.jsf.ui/build.properties
deleted file mode 100644
index 8d7f59016..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .,\
- plugin.xml,\
- icons/,\
- plugin.properties,\
- about.html
-javacSource=1.5
-javacTarget=1.5 \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/attr_val.gif b/jsf/plugins/org.eclipse.jst.jsf.ui/icons/attr_val.gif
deleted file mode 100644
index d4cb4254d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/attr_val.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/full/wizban/addlibrary_wiz.gif b/jsf/plugins/org.eclipse.jst.jsf.ui/icons/full/wizban/addlibrary_wiz.gif
deleted file mode 100644
index 128c9d190..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/full/wizban/addlibrary_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_l_obj.gif b/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_l_obj.gif
deleted file mode 100644
index 6cb185cff..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_l_obj.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_obj.gif b/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_obj.gif
deleted file mode 100644
index 2fa1d777b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/jar_obj.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/library_obj.gif b/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/library_obj.gif
deleted file mode 100644
index cb55e33b5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/obj16/library_obj.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/sample.gif b/jsf/plugins/org.eclipse.jst.jsf.ui/icons/sample.gif
deleted file mode 100644
index 34fb3c9d8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/icons/sample.gif
+++ /dev/null
Binary files differ
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.properties b/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.properties
deleted file mode 100644
index 27d91bb60..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-###############################################################################
-# Copyright (c) 2005, 2006 Oracle Corporation.
-# 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:
-# Gerry Kessler - initial API and implementation
-###############################################################################
-plugin.name=JavaServer Faces Tools - UI
-plugin.provider=Eclipse.org
-EL_Hyperlinkdetector_name=JSF EL Symbol
-
-jsf.library.reference=JSF Library References
-jsf.library.wizard.name=JSF Library
-
-preferencepage.jsflibraries.name=Libraries
-preferencepage.jsfvalidation.name=Validation
-preferencepage.jsf.name=JavaServer Faces Tools
-
-classpathContainerPage.name.0 = JSF Libraries
-
-jsf.ui.views.category.name=JavaServer Faces
-
-jsf.ui.views.componentview.name=JSF Component Tree
-jsf.ui.views.jsftagregistry.name=Tag Registry
-
-JSFNonELAttributeValueValidator=JSF View Validator
-JSFAppConfigValidator=JSF Application Configuration Validator
-JSPSemanticsValidatorMarker=JSF Problem \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml b/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml
deleted file mode 100644
index c1a2954bd..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/plugin.xml
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!-- JSF Project Facet -->
- <extension
- point="org.eclipse.ui.preferencePages">
- <page
- category="org.eclipse.jst.jsf.ui.JSFRootPage"
- class="org.eclipse.jst.jsf.ui.internal.classpath.JSFLibrariesPreferencePage"
- id="org.eclipse.jst.jsf.ui.jsfLibraryPage"
- name="%preferencepage.jsflibraries.name"/>
- <page
- category="org.eclipse.jst.jsf.ui.JSFRootPage"
- class="org.eclipse.jst.jsf.ui.internal.validation.JSFValidationPreferencePage"
- id="org.eclipse.jst.jsf.ui.JSFValidationPage"
- name="%preferencepage.jsfvalidation.name"/>
- <page
- category="org.eclipse.wst.html.ui.preferences.web"
- class="org.eclipse.jst.jsf.ui.internal.preferences.EmptyRootPreferencePage"
- id="org.eclipse.jst.jsf.ui.JSFRootPage"
- name="%preferencepage.jsf.name">
- </page>
- </extension>
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.wizardPages">
- <wizard-pages action="jst.jsf.v11.install">
- <page class="org.eclipse.jst.jsf.ui.internal.project.facet.JSFFacetInstallPage"/>
- </wizard-pages>
- <wizard-pages action="jst.jsf.v12.install">
- <page class="org.eclipse.jst.jsf.ui.internal.project.facet.JSFFacetInstallPage"/>
- </wizard-pages>
- </extension>
-
- <extension point="org.eclipse.wst.sse.ui.editorConfiguration">
- <sourceViewerConfiguration
- class="org.eclipse.jst.jsp.ui.StructuredTextViewerConfigurationJSP"
- target="org.eclipse.jst.jsp.core.jspsource"/>
- <provisionalConfiguration
- type="contentassistprocessor"
- class="org.eclipse.jst.jsf.ui.internal.contentassist.el.JSFELContentAssistProcessor"
- target="org.eclipse.jst.jsp.SCRIPT.JSP_EL2" />
- <provisionalConfiguration
- type="contentassistprocessor"
- class="org.eclipse.jst.jsf.ui.internal.contentassist.JSFContentAssistProcessor"
- target="org.eclipse.jst.jsp.JSP_DEFAULT,org.eclipse.jst.jsp.JSP_DIRECTIVE" />
- <documentationTextHover
- class="org.eclipse.jst.jsf.ui.internal.jspeditor.JSFELHover"
- target="org.eclipse.jst.jsp.SCRIPT.JSP_EL2">
- </documentationTextHover>
- </extension>
- <extension point="org.eclipse.wst.sse.ui.sourcevalidation">
- <validator
- scope="total"
- class="org.eclipse.jst.jsf.ui.internal.validation.JSFValidator"
- id="org.eclipse.jst.jsf.validation.JSFAttributeValueValidator">
- <contentTypeIdentifier
- id="org.eclipse.jst.jsp.core.jspsource">
- <partitionType id="org.eclipse.jst.jsp.DEFAULT_JSP">
- </partitionType>
- <partitionType id="org.eclipse.jst.jsp.JSP_DIRECTIVE">
- </partitionType>
- <partitionType id="org.eclipse.jst.jsp.SCRIPT.JSP_EL2">
- </partitionType>
- </contentTypeIdentifier>
- </validator>
- </extension>
- <extension
- point="org.eclipse.jdt.ui.classpathContainerPage">
- <classpathContainerPage
- class="org.eclipse.jst.jsf.ui.internal.classpath.JSFLibraryContainerWizardPage"
- id="org.eclipse.jst.jsf.core.internal.jsflibrarycontainer"
- name="%classpathContainerPage.name.0">
- </classpathContainerPage>
- </extension>
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.jst.jsf.ui.internal.jspeditor.ELHyperlinkDetector"
- id="org.eclipse.jst.jsf.ui.elhyperlinkdetector"
- name="%EL_Hyperlinkdetector_name"
- targetId="org.eclipse.jst.jsp.core.jspsource">
- </hyperlinkDetector>
- </extension>
-
- <extension
- point="org.eclipse.ui.views">
- <category
- name="%jsf.ui.views.category.name"
- id="org.eclipse.jst.jsf.ui.view.category">
- </category>
- <view
- name="%jsf.ui.views.componentview.name"
- icon="icons/sample.gif"
- category="org.eclipse.jst.jsf.ui.view.category"
- class="org.eclipse.jst.jsf.ui.internal.component.ComponentTreeView"
- id="org.eclipse.jst.jsf.ui.component.ComponentTreeView">
- </view>
- <view
- name="%jsf.ui.views.jsftagregistry.name"
- icon="icons/sample.gif"
- category="org.eclipse.jst.jsf.ui.view.category"
- class="org.eclipse.jst.jsf.ui.internal.tagregistry.TagRegistryView"
- id="org.eclipse.jst.jsf.ui.tagregistry.TagRegistryView">
- </view>
- </extension>
-
- <extension
- id="JSPSemanticsValidatorMarker"
- name="%JSPSemanticsValidatorMarker"
- point="org.eclipse.core.resources.markers">
- <super
- type="org.eclipse.wst.validation.problemmarker">
- </super>
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validator"
- id="JSFNonELAttributeValueValidator"
- name="%JSFNonELAttributeValueValidator">
- <validator>
- <projectNature id="org.eclipse.wst.common.modulecore.ModuleCoreNature" />
- <projectNature id="org.eclipse.jdt.core.javanature" />
- <enablement>
- <and>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.java"/>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.web"/>
- <test property="org.eclipse.wst.common.project.facet.core.projectFacet" value="jst.jsf"/>
- </and>
- </enablement>
-
- <markerId
- markerIdValue="JSPSemanticsValidatorMarker">
- </markerId>
- <helper
- class="org.eclipse.wst.validation.internal.operations.WorkbenchContext">
- </helper>
- <run
- class="org.eclipse.jst.jsf.ui.internal.validation.JSFValidator"
- incremental="true"
- fullBuild="true"
- />
- <contentTypeBinding
- contentTypeId="org.eclipse.jst.jsp.core.jspsource">
- </contentTypeBinding>
- <contentTypeBinding
- contentTypeId="org.eclipse.jst.jsp.core.jspfragmentsource">
- </contentTypeBinding>
- </validator>
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validator"
- id="JSFAppConfigValidator"
- name="%JSFAppConfigValidator">
- <validator>
- <projectNature id="org.eclipse.wst.common.modulecore.ModuleCoreNature" />
- <projectNature id="org.eclipse.jdt.core.javanature" />
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="faces-config.xml">
- </filter>
- <markerId
- markerIdValue="JSPSemanticsValidatorMarker">
- </markerId>
- <helper
- class="org.eclipse.wst.validation.internal.operations.WorkbenchContext">
- </helper>
- <run
- class="org.eclipse.jst.jsf.validation.internal.appconfig.AppConfigValidator"
- incremental="true"
- fullBuild="true"
- />
- </validator>
- </extension>
-
-</plugin>
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/JSFUiPlugin.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/JSFUiPlugin.java
deleted file mode 100644
index b80b6cf48..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/JSFUiPlugin.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * 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:
- * Gerry Kessler - initial API and implementation
- * Ian Trimble - added logging methods
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JSF UI plugin.
- *
- * @author Gerry Kessler - Oracle, Ian Trimble - Oracle
- */
-public class JSFUiPlugin extends AbstractUIPlugin {
-
- /**
- * The plugin id
- */
- public static final String PLUGIN_ID = "org.eclipse.jst.jsf.ui"; //$NON-NLS-1$
- //The shared instance.
- private static JSFUiPlugin plugin;
-
- /**
- * The constructor.
- */
- public JSFUiPlugin() {
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- * @return the default plugin instance
- */
- public static JSFUiPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- path = "icons/" + path; //$NON-NLS-1$
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.jst.jsf.ui", path); //$NON-NLS-1$
- }
-
- /**
- * @return the plugin id
- */
- public String getPluginID() {
- return PLUGIN_ID;
- }
-
- /**
- * Logs using the default ILog implementation provided by getLog().
- *
- * @param severity Severity (IStatus constant) of log entry
- * @param message Human-readable message describing log entry
- * @param ex Throwable instance (can be null)
- */
- public static void log(int severity, String message, Throwable ex) {
- getDefault().getLog().log(new Status(severity, PLUGIN_ID, IStatus.OK, message, ex));
- }
-
- /**
- * Logs using the default ILog implementation provided by getLog().
- *
- * @param severity Severity (IStatus constant) of log entry
- * @param message Human-readable message describing log entry
- */
- public static void log(int severity, String message) {
- log(severity, message, null);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java
deleted file mode 100644
index 15592d6eb..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/Messages.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * 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:
- * Gerry Kessler - initial API and implementation
- * Ian Trimble - changed to work correctly with org.eclipse.osgi.util.NLS
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * String resource handler.
- *
- * @author Gerry Kessler - Oracle, Ian Trimble - Oracle
- */
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.eclipse.jst.jsf.ui.internal.messages"; //$NON-NLS-1$
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_JSFLibraryLabel0;
-
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_title;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_description;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_JSFImplLabel;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_Add1;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_Add2;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_DeployJarsLabel;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_JSFConfigLabel;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_JSFServletNameLabel;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_JSFServletClassNameLabel;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_JSFURLMappingLabel;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_PatternDialogTitle;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_PatternDialogDesc;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_Remove;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_PatternEmptyMsg;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_PatternSpecifiedMsg;
- /**
- * see messages.properties
- */
- public static String JSFFacetInstallPage_ErrorNoWebAppDataModel;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_DEFAULT_IMPL_DESC;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_DefinedJSFLibraries;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_IMPL_DESC;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_MISSING_DESC;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_New;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_Edit;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_Remove;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_CannotRemovePluginProvidedTitle;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_CannotRemovePluginProvidedMessage;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_MakeDefault;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_Description;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_CannotModifyPluginProvidedTitle;
- /**
- * see messages.properties
- */
- public static String JSFLibrariesPreferencePage_CannotModifyPluginProvidedMessage;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_Add;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_AddAll;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_ComponentLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_DeployButtonLabel;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_DeployJAR;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_ImplementationLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_NewComponentLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_NewImplButtonTooltip;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_NewImplementationLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_NullProject;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_Remove;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_RemoveAll;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_ServerSuppliedButtonLabel;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_ServerSuppliedButtonTooltip;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_TH_Deploy;
- /**
- * see messages.properties
- */
- public static String JSFLibraryConfigControl_TH_LibraryName;
-
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_PageName;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_Title;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_Description;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_WarningNoJSFFacet;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_JSFLibraries;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_Add;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_Edit;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_ErrorInitializing;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_ImplAlreadyPresent;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_SelectOneImpl;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_V1Registry_Warning_DialogTitle;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_V1Registry_Warning_DialogText;
- /**
- * see messages.properties
- */
- public static String JSFLibraryContainerWizardPage_EditLibrary_DescriptionText;
- /**
- * see messages.properties
- */
- public static String JSFLibraryPropertyPage_No_JSF_Facet_Installed;
- /**
- * see messages.properties
- */
- public static String JSFLibraryPropertyPage_No_JSF_Implementation_Lib_Selected;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_DESCRIPTION;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_IMPLS_ONLY_DESC;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_CreateImplementation;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_CreateJSFLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_EditJSFLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_JSFLibrary;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_JSFLibraryWizard_DontShowThisAgain_CheckBoxLabel;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_LibraryName;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_V1JSFLibrary_DialogMessage;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_V1JSFLibrary_DialogTitle;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_VersionSupported;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_LibraryJars;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_IsJSFImplementation;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_DeployJars;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_Add;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_Remove;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_ExtJarFileDialogTitle;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_ValidateNoJars;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_ValidateNoLibraryName;
- /**
- * see messages.properties
- */
- public static String JSFLibraryWizard_ValidateExistingLibraryName;
-
- /**
- * Title set on the el validation preference panel
- */
- public static String JSFValidationPreferencePage_ELPrefPanel_Title;
- /**
- * Title set on the checkbox that enables/disables build validation for EL
- */
- public static String JSFValidationPreferencePage_ELPrefPanel_BuildValidationCheckBoxTitle;
- /**
- * Title set on the checkbox that enables/disables incremental (as you type)
- * validation for EL
- */
- public static String JSFValidationPreferencePage_ELPrefPanel_IncrementalValidationCheckBoxTitle;
-
- /**
- * see messages.properties
- */
- public static String JSFLibraryEditControl_ImplVersion_UNKNOWN;
-
- /**
- * see messages.properties
- */
- public static String JSFPreferences_RootPage_Description;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibrariesPreferencePage.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibrariesPreferencePage.java
deleted file mode 100644
index db7235285..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibrariesPreferencePage.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.Label;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.IWorkbenchWizard;
-
-/**
- * Provides a preference page for JSF Libraries.
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFLibrariesPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
-{
- private IWorkbench wb;
-
- private TreeViewer tv;
- private TreeViewerAdapter tvAdapter;
- private TreeLabelProvider tvLabelProvider;
-
- private Composite btnComp;
-
- private Button btnNew;
- private Button btnEdit;
- private Button btnDelete;
- private Button btnMakeDefaultImpl;
-
- protected Control createContents(Composite parent) {
- Composite c = new Composite(parent, SWT.NONE);
- c.setLayout(new GridLayout(2, false));
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Label lblLibs = new Label(c, SWT.NONE);
- lblLibs.setText(Messages.JSFLibrariesPreferencePage_DefinedJSFLibraries);
- GridData gd1 = new GridData();
- gd1.horizontalSpan = 2;
- lblLibs.setLayoutData(gd1);
-
- tv = new TreeViewer(c, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- tvAdapter = new TreeViewerAdapter();
- tvLabelProvider = new TreeLabelProvider();
- tv.setContentProvider(tvAdapter);
- tv.setLabelProvider(tvLabelProvider);
- tv.addSelectionChangedListener(tvAdapter);
- tv.addDoubleClickListener(tvAdapter);
- tv.setComparator(tvAdapter);
- tv.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
- tv.setInput(getJSFLibraries());
-
- createButtons(c);
-
- return c;
- }
-
- private void createButtons(Composite c){
- btnComp = new Composite(c, SWT.NONE);
- GridLayout gl1 = new GridLayout(1, false);
- gl1.marginHeight = 0;
- gl1.marginWidth = 0;
- btnComp.setLayout(gl1);
- btnComp.setLayoutData(new GridData(GridData.END | GridData.VERTICAL_ALIGN_FILL));
-
- btnNew = new Button(btnComp, SWT.NONE);
- btnNew.setText(Messages.JSFLibrariesPreferencePage_New);
- btnNew.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
- btnNew.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- openJSFLibraryEditDialog(null);
- }
- });
-
- btnEdit = new Button(btnComp, SWT.NONE);
- btnEdit.setText(Messages.JSFLibrariesPreferencePage_Edit);
- btnEdit.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
- btnEdit.setEnabled(false);
- btnEdit.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- TreeItem[] element = tv.getTree().getSelection();
- if (element != null){
- openJSFLibraryEditDialog(element[0]);
- }
-
- }
- });
-
- btnDelete = new Button(btnComp, SWT.NONE);
- btnDelete.setText(Messages.JSFLibrariesPreferencePage_Remove);
- btnDelete.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_BEGINNING));
- btnDelete.setEnabled(false);
- btnDelete.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- boolean modified = false;
- if (tv.getSelection() instanceof StructuredSelection){
- StructuredSelection objs = (StructuredSelection)tv.getSelection();
- if (objs != null){
- Iterator it = objs.iterator();
- while (it.hasNext()){
- JSFLibrary lib = (JSFLibrary)it.next();
- if (lib instanceof PluginProvidedJSFLibrary)
- MessageDialog.openInformation(
- getShell(),
- Messages.JSFLibrariesPreferencePage_CannotRemovePluginProvidedTitle,
- Messages.JSFLibrariesPreferencePage_CannotRemovePluginProvidedMessage);
-
- else {
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().removeJSFLibrary(lib);
- modified = true;
- }
- }
- if (modified){
- JSFLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
- tv.refresh();
- }
- }
- }
- }
- });
-
- btnMakeDefaultImpl = new Button(btnComp, SWT.NONE);
- btnMakeDefaultImpl.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_END));
- btnMakeDefaultImpl.setText(Messages.JSFLibrariesPreferencePage_MakeDefault);
- btnMakeDefaultImpl.setVisible(false);
- btnMakeDefaultImpl.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (tv.getSelection() instanceof StructuredSelection){
- StructuredSelection objs = (StructuredSelection)tv.getSelection();
- if (objs != null){
- if (objs.getFirstElement() instanceof JSFLibrary){
- JSFLibrary lib = (JSFLibrary)objs.getFirstElement();
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().setDefaultImplementation(lib);
- }
- JSFLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
- tv.refresh();
- }
- }
- }
- });
-
- }
- private Object getJSFLibraries() {
- return JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getAllJSFLibraries();
- }
-
- public void init(IWorkbench workbench) {
- wb = workbench;
- setDescription(Messages.JSFLibrariesPreferencePage_Description);
- noDefaultAndApplyButton();
- }
-
- /**
- * Getter created only for JUnit tests. Should not be used otherwise.
- * @return the TreeViewer of JSF Libraries
- */
- public Viewer getLibraryViewer(){
- return tv;
- }
-
- private class TreeViewerAdapter extends ViewerComparator implements ITreeContentProvider, ISelectionChangedListener, IDoubleClickListener {
- private final Object[] NO_ELEMENTS= new Object[0];
-
- // ------- ITreeContentProvider Interface ------------
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // will never happen
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object obj) {
- return ((List)getJSFLibraries()).toArray();
- }
-
- public Object[] getChildren(Object element) {
- if (element instanceof JSFLibrary) {
- return ((JSFLibrary)element).getArchiveFiles().toArray();
- }
- return NO_ELEMENTS;
- }
-
- public Object getParent(Object element) {
-// if (elements instanceof JSFLibrary) {
-// return tvAdapter.getParent(tv.getTree().class, element);
-// }
- return null;//fParentElement;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof JSFLibrary) {
- return true;
- }
- return false;
- }
-
- // ------- ISelectionChangedListener Interface ------------
-
- public void selectionChanged(SelectionChangedEvent event) {
- doListSelected(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- doDoubleClick(event);
- }
-
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (e1 instanceof JSFLibrary && e2 instanceof JSFLibrary){
- JSFLibrary lib1 = (JSFLibrary)e1;
- JSFLibrary lib2 = (JSFLibrary)e2;
-
- return getComparator().compare(lib1.getLabel(), lib2.getLabel());
- }
- return super.compare(viewer, e1, e2);
- }
-
-
- }
-
- /**
- * Respond to a list selection event
- *
- * @param event
- */
- protected void doListSelected(SelectionChangedEvent event) {
- updateButtonState();
- }
-
- /**
- * Respond to a double click event by opening the edit dialog
- * @param event
- */
- protected void doDoubleClick(DoubleClickEvent event) {
- openJSFLibraryEditDialog(tv.getTree().getSelection()[0]);
- }
-
- private void updateButtonState() {
- btnEdit.setEnabled(tv.getTree().getSelectionCount() == 1);
- if (tv.getTree().getSelectionCount() == 1 && tv.getTree().getSelection()[0].getData() instanceof JSFLibrary){
- btnDelete.setEnabled(true);
- btnMakeDefaultImpl.setVisible(false);
- JSFLibrary lib = (JSFLibrary)tv.getTree().getSelection()[0].getData();
- btnMakeDefaultImpl.setVisible(lib.isImplementation());
- } else {
- btnDelete.setEnabled(false);
- btnMakeDefaultImpl.setVisible(false);
- }
- }
-
- private void openJSFLibraryEditDialog(Object element) {
- if (isPluginProvidedJSFLibrary(element)){
- MessageDialog.openInformation(
- getShell(),
- Messages.JSFLibrariesPreferencePage_CannotModifyPluginProvidedTitle,
- Messages.JSFLibrariesPreferencePage_CannotModifyPluginProvidedMessage);
- return;
- }
- IWorkbenchWizard wizard = new JSFLibraryWizard();
- wizard.init(wb, getStructuredElement(element));
- WizardDialog dialog = new WizardDialog(wb.getActiveWorkbenchWindow().getShell(), wizard);
- int ret = dialog.open();
- if (ret == Window.OK){
- tv.refresh();
- }
- }
-
- private IStructuredSelection getStructuredElement(Object element) {
- if (element instanceof TreeItem){
- Object item = ((TreeItem)element).getData();
- if (item instanceof ArchiveFile){
- JSFLibrary parent = ((ArchiveFile)item).getJSFLibrary();
- return new StructuredSelection(parent);
- } else if (item instanceof JSFLibrary) {
- return new StructuredSelection(item);
- }
- }
- return null;
- }
-
- private boolean isPluginProvidedJSFLibrary(Object treeElement){
- if (treeElement instanceof TreeItem){
- Object item = ((TreeItem)treeElement).getData();
- if (item instanceof PluginProvidedJSFLibrary){
- return true;
- } else if (item instanceof ArchiveFile) {
- return (((ArchiveFile)item).getJSFLibrary() instanceof PluginProvidedJSFLibrary);
- }
- }
- return false;
- }
-
- private static class TreeLabelProvider implements ILabelProvider {
- private final Image libImg;
- private final Image jarImg;
-
- TreeLabelProvider(){
- ImageDescriptor jarImgDesc = JSFUiPlugin.getImageDescriptor("obj16/jar_obj.gif"); //$NON-NLS-1$
- jarImg = jarImgDesc.createImage();
- ImageDescriptor libImgDesc = JSFUiPlugin.getImageDescriptor("obj16/library_obj.gif"); //$NON-NLS-1$
- libImg = libImgDesc.createImage();
- }
-
- public Image getImage(Object element) {
- if (element instanceof JSFLibrary)
- {
- return libImg;
- }
- return jarImg;
- }
-
- public String getText(Object element) {
- StringBuffer labelBuf = new StringBuffer();
- if (element instanceof JSFLibrary) {
- JSFLibrary lib = (JSFLibrary)element;
- labelBuf.append(lib.getLabel());
- if (lib.isImplementation()) {
- if (lib == JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getDefaultImplementation()) {
- labelBuf.append(Messages.JSFLibrariesPreferencePage_DEFAULT_IMPL_DESC);
- } else {
- labelBuf.append(Messages.JSFLibrariesPreferencePage_IMPL_DESC);
- }
- }
- }
- if (element instanceof ArchiveFile) {
- ArchiveFile jar = (ArchiveFile)element;
- labelBuf.append(jar.getName());
- if (!jar.exists())
- labelBuf.append(Messages.JSFLibrariesPreferencePage_MISSING_DESC);
- labelBuf.append(" - ").append(((ArchiveFile)element).getSourceLocation()); //$NON-NLS-1$
- }
- return labelBuf.toString();
- }
-
- public void addListener(ILabelProviderListener listener) {
- // no listeners supported
- }
-
- public void dispose() {
- if (libImg != null){
- libImg.dispose();
- }
- if (jarImg != null){
- jarImg.dispose();
- }
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // no listeners supported
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryContainerWizardPage.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryContainerWizardPage.java
deleted file mode 100644
index 950a4056b..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryContainerWizardPage.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 2007 Oracle Corporation.
- * 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
-import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension;
-import org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension2;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.PluginProvidedJSFLibrary;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.core.jsflibraryconfiguration.JSFLibraryConfigurationHelper;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-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.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWizard;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Provides a classpath container wizard page for JSF Libraries.
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFLibraryContainerWizardPage extends WizardPage implements
- IClasspathContainerPage, IClasspathContainerPageExtension, IClasspathContainerPageExtension2{
-
- private CheckboxTableViewer lv;
- private JSFLibrariesTableViewerAdapter lvAdapter;
- private JSFLibrariesListLabelProvider lvLabelProvider;
-
- private boolean isJSFProject = false;
- private IClasspathEntry containerEntry;
- private IClasspathEntry[] currentEntries;
- private Map _currentLibs;
- private JSFLibrary currentLib;
-
- private boolean _projectHaveV1JSFLibraries; // = false;
- private IProject _iproject;
-
- /**
- * Zero arg constructor
- */
- public JSFLibraryContainerWizardPage(){
- super(Messages.JSFLibraryContainerWizardPage_PageName);
- setTitle(Messages.JSFLibraryContainerWizardPage_Title);
- setDescription(Messages.JSFLibraryContainerWizardPage_Description);
- // TODO: Replace with a custom image.
- setImageDescriptor( JSFUiPlugin.getImageDescriptor("full/wizban/addlibrary_wiz.gif")); //$NON-NLS-1$
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension#initialize(org.eclipse.jdt.core.IJavaProject, org.eclipse.jdt.core.IClasspathEntry[])
- */
- public void initialize(IJavaProject project, IClasspathEntry[] currentEntries_) {
- this.currentEntries = currentEntries_;
-
- _iproject = project.getProject();
- this.isJSFProject = JSFAppConfigUtils.isValidJSFProject(_iproject);
- if (this.isJSFProject)
- {
- _projectHaveV1JSFLibraries =
- JSFLibraryRegistryUtil.doesProjectHaveV1JSFLibraries(_iproject);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.IClasspathContainerPage#finish()
- */
- public boolean finish() {
- boolean finish = true;
- if (_projectHaveV1JSFLibraries)
- {
- // if the user doesn't want to confirm, back off on the change
- // and let them decide if they want to hit cancel
- finish = WarningMessageDialog.
- openConfirm(getShell()
- , Messages.JSFLibraryContainerWizardPage_V1Registry_Warning_DialogTitle
- , Messages.JSFLibraryContainerWizardPage_V1Registry_Warning_DialogText);
-
- if (finish)
- {
- JSFLibraryRegistryUtil.removeV1JSFLibraryProperty(Collections.singletonList(_iproject));
- }
- }
- return finish;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.IClasspathContainerPageExtension2#getNewContainers()
- */
- public IClasspathEntry[] getNewContainers() {
- IPath cp = new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID);
- List res = new ArrayList();
- Object[] items = lv.getCheckedElements();
- for (int i=0;i<items.length;i++){
- JSFLibrary jsfLib = (JSFLibrary)items[i];
- if (getSelectedJSFLibariesForProject().get(jsfLib.getID()) == null){
- IPath path = cp.append(new Path(jsfLib.getID()));
- IClasspathEntry entry = JavaCore.newContainerEntry(path);
- // need to update wtp dependency in j2ee mod dependency ui
- res.add(entry);
- }
- }
- return (IClasspathEntry[])res.toArray(new IClasspathEntry[]{});
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
- */
- public boolean isPageComplete() {
- if (!isJSFProject) {
- return false;
- }
- if (isEditReference() && ! selectionHasChanged())
- return false;
-
- return isValid();
- }
-
- private boolean isValid() {
- return isCheckedItems() && getErrorMessage() == null;
- }
-
- //to be used to know whether the selected library has changed when in "edit" mode
- private boolean selectionHasChanged() {
- JSFLibrary lib = getCurrentLibrarySelection();
- if (lib == null)
- return false;
-
- return (getJSFLibraryForEdit(containerEntry) != lib) ;
-
- }
-
- private JSFLibrary getCurrentLibrarySelection() {
- JSFLibrary lib = null;
- StructuredSelection ssel = (StructuredSelection)lv.getSelection();
- if (ssel != null && !ssel.isEmpty()){
- lib = (JSFLibrary)ssel.getFirstElement();
- }
- return lib;
- }
-
- private boolean isCheckedItems() {
- return lv.getCheckedElements().length > 0;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.IClasspathContainerPage#getSelection()
- */
- public IClasspathEntry getSelection() {
- IClasspathEntry entry = null;
- if (isEditReference()){
- if (lv.getCheckedElements().length == 0)
- return containerEntry;
-
- JSFLibrary lib = (JSFLibrary)lv.getCheckedElements()[0];
- if (lib != null){
- if (lib == getJSFLibraryForEdit(containerEntry))
- {
- return containerEntry;
- }
- IPath path = new Path(JSFLibraryConfigurationHelper.JSF_LIBRARY_CP_CONTAINER_ID).append(new Path(lib.getID()));
- entry = JavaCore.newContainerEntry(path, containerEntry.getAccessRules(), containerEntry.getExtraAttributes(),containerEntry.isExported());
- }
- }
- return entry;
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.IClasspathContainerPage#setSelection(org.eclipse.jdt.core.IClasspathEntry)
- */
- public void setSelection(IClasspathEntry containerEntry) {
- //this is signalling that this is an "edit"
- this.containerEntry = containerEntry;
- }
-
- public void createControl(Composite parent) {
- //Build UI to display JSF Lib components from registry
- Composite c = new Composite(parent, SWT.NONE);
- c.setLayout(new GridLayout(2, false));
- c.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- //disable wizard if this is not a valid JSF project
- if (!isJSFProject){
- Label warning = new Label(c , SWT.NONE);
- warning.setText(Messages.JSFLibraryContainerWizardPage_WarningNoJSFFacet);
- setControl(c);
- return;
- }
-
- Label lblViewer = new Label(c, SWT.NONE);
- lblViewer.setText(Messages.JSFLibraryContainerWizardPage_JSFLibraries);
- GridData gd1 = new GridData(GridData.BEGINNING);
- gd1.horizontalSpan = 2;
- lblViewer.setLayoutData(gd1);
-
- lv = createTableViewer(c);
- lv.getControl().setLayoutData(new GridData(GridData.FILL_BOTH));
-
- lvAdapter = new JSFLibrariesTableViewerAdapter();
- lvLabelProvider = new JSFLibrariesListLabelProvider();
- lv.setContentProvider(lvAdapter);
- lv.setLabelProvider(lvLabelProvider);
- lv.addSelectionChangedListener(lvAdapter);
- lv.addDoubleClickListener(lvAdapter);
- lv.setComparator(lvAdapter);
-
- Composite buttons = new Composite(c, SWT.NONE);
- buttons.setLayout(new GridLayout(1, false));
- buttons.setLayoutData(new GridData(GridData.FILL_VERTICAL));
-
- final Button addButton = new Button(buttons, SWT.NONE);
- addButton.setText(Messages.JSFLibraryContainerWizardPage_Add);
- addButton.setLayoutData(new GridData(GridData.END | GridData.VERTICAL_ALIGN_BEGINNING));
- addButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e){
- openJSFLibraryWizard(null);
- }
- });
-
- final Button editButton = new Button(buttons, SWT.NONE);
- editButton.setText(Messages.JSFLibraryContainerWizardPage_Edit);
- editButton.setLayoutData(new GridData(GridData.END | GridData.VERTICAL_ALIGN_BEGINNING));
- editButton.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e){
- StructuredSelection sel = (StructuredSelection)lv.getSelection();
- if ((sel == null || sel.isEmpty()) && containerEntry != null){
- JSFLibrary jsfLib = getJSFLibraryForEdit(containerEntry);
- sel = new StructuredSelection(jsfLib);
- }
- openJSFLibraryWizard(sel);
- }
-
- });
- editButton.setVisible(false);
- lv.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- setEditButton(event.getSelection());
- }
-
- private void setEditButton(final ISelection selection) {
- IStructuredSelection sel = (IStructuredSelection)selection;
- editButton.setVisible(sel.size()==1);
- if (sel.size() == 1){
- JSFLibrary lib = (JSFLibrary)sel.getFirstElement();
- boolean pp = lib instanceof PluginProvidedJSFLibrary;
- editButton.setEnabled(! pp);
- if (isEditReference()){
- lv.setAllChecked(false);
- lv.setChecked(lib, true);
- }
- }
-
- }
- });
- setControl(c);
-
- if (isEditReference()){
- JSFLibrary lib = getJSFLibraryForEdit(containerEntry);
- lv.setInput(getAllUnselectedJSFLibrariesExceptReferencedLib(lib));
- selectAndCheckCurrentLib(lib);
- setDescription(Messages.JSFLibraryContainerWizardPage_EditLibrary_DescriptionText);
- }
- else {
- lv.setInput(getAllJSFLibraries());
- lv.setCheckedElements(getSelectedJSFLibariesForProject().values().toArray(new Object[0]));
- }
- }
-
- private void selectAndCheckCurrentLib(final JSFLibrary lib) {
- if (lib != null){
- StructuredSelection ssel = new StructuredSelection(lib);
- lv.setSelection(ssel);
- lv.setChecked(lib, true);
- }
- }
-
- private Object getAllUnselectedJSFLibrariesExceptReferencedLib(JSFLibrary referenceLib) {
- List allLibs = getAllJSFLibraries();
- Collection selLibs = getSelectedJSFLibariesForProject().values();
- for (Iterator it=selLibs.iterator();it.hasNext();){
- JSFLibrary aLib = (JSFLibrary)it.next();
- int i= allLibs.indexOf(aLib);
- //remove from allLibs unless it is the selected reference
- if (i >= 0 && ((referenceLib == null) || (aLib != null && ! aLib.getID().equals(referenceLib.getID())))){
- allLibs.remove(i);
- }
- }
- return allLibs;
- }
-
- private List getJSFLibraryEntries(IClasspathEntry[] entries) {
- List jsfLibs = new ArrayList();
- for (int i=0;i<entries.length;i++){
- IClasspathEntry entry = entries[i];
- if (JSFLibraryConfigurationHelper.isJSFLibraryContainer(entry)){
- JSFLibrary lib = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry(). getJSFLibraryByID(getLibraryId(entry));
- if (lib != null){
- jsfLibs.add(lib);
- }
- }
- }
-
- return jsfLibs;
- }
-
- private String getLibraryId(IClasspathEntry entry) {
- return entry.getPath().segment(1);
- }
-
- private void openJSFLibraryWizard(IStructuredSelection element){
- IWorkbenchWizard wizard = new JSFLibraryWizard();
- IWorkbench wb = PlatformUI.getWorkbench();
- wizard.init(wb, element);
- WizardDialog dialog = new WizardDialog(wb.getActiveWorkbenchWindow().getShell(), wizard);
- int ret = dialog.open();
- if (ret == Window.OK){
- //FIXME: select returned object
- if (containerEntry == null){
- lv.setInput(getAllJSFLibraries());
- }
- else {
- lv.setInput(getAllUnselectedJSFLibrariesExceptReferencedLib(getJSFLibraryForEdit(containerEntry)));
- lv.refresh(true);
- }
- lv.refresh();
- }
- }
-
- private CheckboxTableViewer createTableViewer(Composite parent) {
- Table table= new Table(parent, SWT.CHECK | SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- table.setFont(parent.getFont());
- CheckboxTableViewer tableViewer= new CheckboxTableViewer(table);
- tableViewer.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent e) {
- if (! isEditReference()){
- //ensure that existing CP entries cannot be unchecked
- if (getSelectedJSFLibariesForProject().get(((JSFLibrary)e.getElement()).getID()) != null){
- if (containerEntry == null)
- e.getCheckable().setChecked(e.getElement(), true);
- else
- lv.setAllChecked(true);
- }
- }
- else {
- //select only one
- lv.setAllChecked(false);
- lv.setChecked(e.getElement(), true);
- if (isEditReference())
- lv.setSelection(new StructuredSelection(e.getElement()));
- }
- validate();
- }
- });
- return tableViewer;
- }
-
- private Map getSelectedJSFLibariesForProject(){
- if (_currentLibs == null){
- List allLibs = getAllJSFLibraries();
- List curLibs = getJSFLibraryEntries(currentEntries);
- _currentLibs = new HashMap(curLibs.size());
- for (Iterator it=curLibs.iterator();it.hasNext();){
- JSFLibrary lib = (JSFLibrary)it.next();
- int index = getIndex(allLibs, lib);
- if (index >=0)
- _currentLibs.put(lib.getID(), allLibs.get(index));
- }
-
- }
- return _currentLibs;
- }
-
- private List getAllJSFLibraries() {
- List allLibs = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getAllJSFLibraries();
-
- return allLibs;
- }
-
-
- private JSFLibrary getJSFLibraryForEdit(
- IClasspathEntry containerEntry_) {
- if (currentLib == null){
- String id = getLibraryId(containerEntry_);
- currentLib = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getJSFLibraryByID(id);
- }
- return currentLib;
-
- }
-
- private int getIndex(List libs, JSFLibrary lib) {
- for (int i=0;i<libs.size();i++){
- if (lib.getID().equals(((JSFLibrary)libs.get(i)).getID()))
- return i;
- }
- return -1;
- }
-
- private class JSFLibrariesTableViewerAdapter extends ViewerComparator implements IStructuredContentProvider, ISelectionChangedListener, IDoubleClickListener {
-
- private Object input;
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- input = newInput;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IContentProvider#dispose()
- */
- public void dispose() {
- // do nothing
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IStructuredContentProvider#getElements(java.lang.Object)
- */
- public Object[] getElements(Object inputElement) {
- return ((List)input).toArray();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
- */
- public void selectionChanged(SelectionChangedEvent event) {
- if (isEditReference()){
- setPageComplete(isPageComplete());
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.viewers.IDoubleClickListener#doubleClick(org.eclipse.jface.viewers.DoubleClickEvent)
- */
- public void doubleClick(DoubleClickEvent event) {
- doDoubleClick(event);
- }
-
- public int compare(Viewer viewer, Object e1, Object e2) {
- JSFLibrary lib1 = (JSFLibrary)e1;
- JSFLibrary lib2 = (JSFLibrary)e2;
-
- //sort first by in selection already and then by name
- boolean lib1Sel = getSelectedJSFLibariesForProject().get(lib1.getID())!=null;
- boolean lib2Sel = getSelectedJSFLibariesForProject().get(lib2.getID())!= null;
-
- if ((lib1Sel && lib2Sel) || (!lib1Sel && !lib2Sel) ){
- return getComparator().compare(lib1.getLabel(), lib2.getLabel());
- }
- else if (lib1Sel)
- return -1;
- else
- return 1;
- }
- }
-
- private static class JSFLibrariesListLabelProvider implements ILabelProvider{
- Image libImg;
- public Image getImage(Object element) {
- if (libImg == null){
- ImageDescriptor libImgDesc = JSFUiPlugin.getImageDescriptor("obj16/library_obj.gif"); //$NON-NLS-1$
- libImg = libImgDesc.createImage();
- }
- return libImg;
- }
-
- public String getText(Object element) {
- if (element instanceof JSFLibrary) {
- JSFLibrary lib = (JSFLibrary)element;
- if (lib.isImplementation()) {
- return lib.getLabel() + " " + Messages.JSFLibrariesPreferencePage_IMPL_DESC; //$NON-NLS-1$
- }
- return lib.getLabel();
- }
- return null;
- }
-
- public void dispose() {
- if (libImg != null)
- libImg.dispose();
- }
-
- public void addListener(ILabelProviderListener listener) {
- // no listener support
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // no listener support
- }
- }
-
- private void validate() {
- setErrorMessage(null);
- int implChosenCount = implSelectedCount();
- if (implChosenCount>1){
- setErrorMessage(Messages.JSFLibraryContainerWizardPage_ImplAlreadyPresent);
- }
- setPageComplete(isPageComplete());
- }
-
-
- private boolean isEditReference() {
- return (containerEntry != null);
- }
-
- private int implSelectedCount() {
- int count = 0;
- for (int i=0;i<lv.getCheckedElements().length;i++){
- JSFLibrary lib = (JSFLibrary)lv.getCheckedElements()[i];
- if (lib.isImplementation())
- count++;
- }
- return count;
- }
-
- private void doDoubleClick(DoubleClickEvent event) {
- StructuredSelection ssel = (StructuredSelection)event.getSelection();
- if (ssel != null &&
- (! ((JSFLibrary)ssel.getFirstElement() instanceof PluginProvidedJSFLibrary)))
- openJSFLibraryWizard((IStructuredSelection)event.getSelection());
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryEditControl.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryEditControl.java
deleted file mode 100644
index c781571a8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryEditControl.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.CCombo;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-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.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Common control for adding JSF library instances
- */
-public class JSFLibraryEditControl extends Composite implements ModifyListener, SelectionListener
-{
- private Text txtName;
- private Label lblName;
- private CCombo cboVersions;
- private Label lblVersions;
- private Button chkDeploy;
- private Button chkImpl;
- private Composite btnBar;
- private Button btnAdd;
- private Button btnRemove;
- private TableViewer jars;
-
- private boolean initing = false;
-
- private JSFLibrary workingCopyLibrary;
-
- private String validationMsg;
- private Set _listeners;
- private int _isNew = -1;//use isNew() method.. not this variable directly
-
- /**
- * @param workingCopyLibrary working copy of the JSF library
- * @param parent parent SWT control
- */
- public JSFLibraryEditControl(JSFLibrary workingCopyLibrary, Composite parent){
- super(parent, SWT.NONE);
- this.workingCopyLibrary = workingCopyLibrary;
- _listeners = new HashSet(1);
- createControl(parent);
- }
-
- /**
- * @param listener
- */
- public void addValidationListener(JSFLibraryValidationListener listener){
- removeValidationListener(listener);
- _listeners.add(listener);
- }
-
- /**
- * @param listener
- */
- public void removeValidationListener(JSFLibraryValidationListener listener){
- _listeners.remove(listener);
- }
-
- /**
- * @param parent
- */
- public void createControl(Composite parent) {
- initing = true;
-
-// this = new Composite(parent, SWT.NONE);
- this.setLayout(new GridLayout(2, false));
- this.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- lblName = new Label(this, SWT.NONE);
- lblName.setText(Messages.JSFLibraryWizard_LibraryName);
- lblName.setLayoutData(new GridData(GridData.BEGINNING));
-
- txtName = new Text(this, SWT.BORDER);
- txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- txtName.addModifyListener(this);
-
- lblVersions = new Label(this, SWT.NONE);
- lblVersions.setText(Messages.JSFLibraryWizard_VersionSupported);
-
- cboVersions = new CCombo(this, SWT.SINGLE | SWT.READ_ONLY | SWT.BORDER);
- cboVersions.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- cboVersions.addModifyListener(this);
-
- Group jarsComp = new Group(this, SWT.NONE);
- jarsComp.setText(Messages.JSFLibraryWizard_LibraryJars);
- GridLayout gl1 = new GridLayout(2, false);
- jarsComp.setLayout(gl1);
- GridData gd2 = new GridData(GridData.FILL_HORIZONTAL
- | GridData.FILL_VERTICAL);
- gd2.horizontalSpan = 2;
- jarsComp.setLayoutData(gd2);
-
- createJarsViewer(jarsComp);
-
- createButtons(jarsComp);
-
- chkImpl = new Button(this, SWT.CHECK);
- chkImpl.setText(Messages.JSFLibraryWizard_IsJSFImplementation);
- GridData gd3 = new GridData();
- gd3.horizontalSpan = 2;
- chkImpl.setLayoutData(gd3);
- chkImpl.addSelectionListener(this);
-
- chkDeploy = new Button(this, SWT.CHECK);
- chkDeploy.setText(Messages.JSFLibraryWizard_DeployJars);
- GridData gd4 = new GridData();
- gd4.horizontalSpan = 2;
- chkDeploy.setLayoutData(gd4);
-// chkDeploy.addSelectionListener(this);
- chkDeploy.setVisible(false);
-
- loadVersions();
-
- if (!isNew()) {
- txtName.setText(workingCopyLibrary.getName());
- if (workingCopyLibrary.getJSFVersion().getName().equals(JSFVersion.UNKNOWN_LITERAL.getName())) {
- cboVersions.setText(Messages.JSFLibraryEditControl_ImplVersion_UNKNOWN);
- } else {
- cboVersions.setText(workingCopyLibrary.getJSFVersion().getName());
- }
- chkDeploy.setSelection(workingCopyLibrary.isDeployed());
- chkImpl.setSelection(workingCopyLibrary.isImplementation());
- }
- jars.setInput(workingCopyLibrary);
-
- initing = false;
-
- txtName.setFocus();
- }
-
- private void createJarsViewer(Group jarsComp) {
- jars = new TableViewer(jarsComp, SWT.BORDER | SWT.MULTI);
- jars.setContentProvider(new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- if (inputElement instanceof JSFLibrary)
- return ((JSFLibrary) inputElement).getArchiveFiles()
- .toArray();
- return new Object[0];
- }
-
- public void dispose() {
- // do nothing
- }
-
- public void inputChanged(Viewer viewer, Object oldInput,
- Object newInput) {
- // won't happen
- }
- });
- jars.setLabelProvider(new ILabelProvider() {
- private Image jarImg = null;
- public Image getImage(Object element) {
- if (jarImg == null){
- ImageDescriptor desc = JSFUiPlugin.getImageDescriptor("obj16/jar_obj.gif"); //$NON-NLS-1$
- jarImg = desc.createImage();
- }
- return jarImg;
- }
-
- public String getText(Object element) {
- StringBuffer labelBuf = new StringBuffer();
- if (element instanceof ArchiveFile) {
- ArchiveFile archive = (ArchiveFile) element;
- labelBuf.append(archive.getName());
- if (!archive.exists())
- labelBuf.append(Messages.JSFLibrariesPreferencePage_MISSING_DESC);
- labelBuf.append(" - ").append(archive.getPath()); //$NON-NLS-1$
- }
- return labelBuf.toString();
- }
-
- public void addListener(ILabelProviderListener listener) {
- // no listeners supported
- }
-
- public void dispose() {
- if (jarImg != null)
- jarImg.dispose();
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // no listeners supported
- }
- });
-
- jars.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event){
- updateButtons();
- }
- });
-
- GridData gd = new GridData(GridData.FILL_BOTH);
-// gd.widthHint = convertWidthInCharsToPixels(30);
-// gd.heightHint = convertHeightInCharsToPixels(10);
- jars.getControl().setLayoutData(gd);
- }
-
- private void updateButtons() {
- btnRemove.setEnabled(!((StructuredSelection)jars.getSelection()).isEmpty());
- // getButton(IDialogConstants.OK_ID).setEnabled(modified);
- }
-
- private void createButtons(Composite c) {
- btnBar = new Composite(c, SWT.NONE);
- GridLayout gl = new GridLayout(1, false);
- gl.marginHeight = 0;
- gl.marginTop = 0;
- gl.marginWidth = 0;
- btnBar.setLayout(gl);
- btnBar.setLayoutData(new GridData(GridData.END));
-
- btnAdd = new Button(btnBar, SWT.NONE);
- btnAdd.setText(Messages.JSFLibraryWizard_Add);
- btnAdd.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_BEGINNING));
- btnAdd.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- String cur = null;
- String[] chosenJars = openExtJarFileDialog(cur);
- if (chosenJars != null) {
- for (int i = 0; i < chosenJars.length; i++) {
- String jar = chosenJars[i];
- if (!workingCopyLibrary.containsArchiveFile(jar)) {
- ArchiveFile archive = JSFLibraryRegistryFactory.eINSTANCE
- .createArchiveFile();
- archive.setSourceLocation(jar);
- archive.setRelativeDestLocation("WEB-INF/lib"); //$NON-NLS-1$
- workingCopyLibrary.getArchiveFiles().add(archive);
- }
- }
- jars.refresh();
- validate();
- }
- }
- });
-
- btnRemove = new Button(btnBar, SWT.NONE);
- btnRemove.setEnabled(false);
- btnRemove.setText(Messages.JSFLibraryWizard_Remove);
- btnRemove.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL
- | GridData.VERTICAL_ALIGN_BEGINNING));
- btnRemove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (jars.getSelection() instanceof StructuredSelection){
- StructuredSelection objs = (StructuredSelection)jars.getSelection();
- if (objs != null){
- Iterator it = objs.iterator();
- while (it.hasNext()){
- Object obj = it.next();
- ArchiveFile jar = (ArchiveFile)obj;
- workingCopyLibrary.getArchiveFiles().remove(jar);
- }
- }
- jars.refresh();
- validate();
- }
- }
- });
- }
-
- private void loadVersions() {
- cboVersions.removeAll();
- Iterator it = JSFVersion.VALUES.iterator();
- while (it.hasNext()) {
- JSFVersion ver = (JSFVersion) it.next();
- if (ver.getName().equals(JSFVersion.UNKNOWN_LITERAL.getName())) {
- cboVersions.add(Messages.JSFLibraryEditControl_ImplVersion_UNKNOWN);
- } else {
- cboVersions.add(ver.getName());
- }
- }
- }
-
- private String[] openExtJarFileDialog(String existing) {
- String title = Messages.JSFLibraryWizard_ExtJarFileDialogTitle;
-
- FileDialog dialog = new FileDialog(getShell(),
- existing == null ? SWT.MULTI : SWT.SINGLE);
- dialog.setText(title);
- dialog.setFilterExtensions(new String[] { "*.jar;*.zip" }); //$NON-NLS-1$
- // FIXME: remember and use last path chosen??
- String filterPath = ResourcesPlugin.getWorkspace().getRoot()
- .getFullPath().toString();
- dialog.setFilterPath(filterPath);
- // if (existing != null) {
- // dialog.setFileName(existing.getPath().lastSegment());
- // }
-
- String res = dialog.open();
- if (res == null) {
- return null;
- }
- String[] fileNames = dialog.getFileNames();
- String[] elems = new String[fileNames.length];
- IPath file = new Path(res);
- IPath apath = file.removeLastSegments(1);
- for (int i = 0; i < fileNames.length; i++) {
- elems[i] = apath.append(fileNames[i]).toString();
- }
- return elems;
- }
-
- public void modifyText(ModifyEvent e) {
- validate();
- updateButtons();
- }
-
- private void fireValidateEvent(final JSFLibraryValidationEvent jSFLibraryValidationEvent) {
- new Runnable(){
- public void run() {
- for (Iterator it=_listeners.iterator();it.hasNext();){
- JSFLibraryValidationListener listener = (JSFLibraryValidationListener)it.next();
- listener.notifyValidation(jSFLibraryValidationEvent);
- }
- }
- }.run();
- }
-
-
- public void widgetSelected(SelectionEvent e) {
- validate();
- updateButtons();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // no handling for default selection
- }
-
- private void validate() {
- if (initing)
- return;
- validationMsg = null;
-// setPageComplete(true);
- if (!validateName() || !validateJars() || !validateVersion()) {
-// setPageComplete(false);
- }
- fireValidateEvent(new JSFLibraryValidationEvent(validationMsg));
- }
-
- private boolean validateJars() {
- if (workingCopyLibrary.getArchiveFiles().isEmpty()) {
- validationMsg = Messages.JSFLibraryWizard_ValidateNoJars;
- return false;
- }
- return true;
- }
-
- private boolean validateVersion() {
- //FIXME: why isn't selection indesx correct???
- // if (cboVersions.getSelectionIndex() < 0) {
- // setErrorMessage("Choose the maximum JSF version supported if known.");
- // return false;
- // }
- return true;
- }
-
- private boolean validateName() {
- if (txtName.getText() == null
- || txtName.getText().trim().equals("")) { //$NON-NLS-1$
- validationMsg = Messages.JSFLibraryWizard_ValidateNoLibraryName;
- return false;
- }
- String aName = txtName.getText().trim();
- if (isNew() || (!isNew() && !getCurrentLibraryName().equals(aName))) {
- if (isNameInRegistry(JSFLibraryRegistryUtil.getInstance()
- .getJSFLibraryRegistry().getAllJSFLibraries(), aName)) {
- validationMsg = Messages.JSFLibraryWizard_ValidateExistingLibraryName;
- return false;
- }
- }
- return true;
- }
-
- private boolean isNew() {
- if (_isNew == -1){
- _isNew = workingCopyLibrary.getName() == null ? 1 : 0;
- }
- return _isNew == 1;
- }
-
- private String getCurrentLibraryName() {
- return workingCopyLibrary.getName();
- }
-
- private boolean isNameInRegistry(Collection c, String name) {
- Iterator it = c.iterator();
- while (it.hasNext()) {
- JSFLibrary lib = (JSFLibrary) it.next();
- if (lib.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * @return the trimmed name of the user input for jsf library name
- */
- public String getJSFLibraryName() {
- return txtName.getText().trim();
- }
-
-
- /**
- * @return the value of the user input for the isDeployed checkbox
- */
- public boolean getIsDeployed() {
- return chkDeploy.getSelection();
- }
-
-
- /**
- * @return the value of the user input for the isJSFImplementation checkbox
- */
- public boolean getIsImplementation() {
- return chkImpl.getSelection();
- }
-
- /**
- * @return the jsf version selected in the version dropping
- */
- public JSFVersion getJSFVersion() {
- if (cboVersions.getSelectionIndex() >= 0) {
- JSFVersion ver = (JSFVersion) JSFVersion.VALUES.get(cboVersions
- .getSelectionIndex());
- return ver;
- }
- return JSFVersion.UNKNOWN_LITERAL;
- }
-
- /**
- * @param implsOnly
- */
- public void setImplOnly(boolean implsOnly) {
- if (implsOnly){
- chkImpl.setSelection(true);
- chkImpl.setEnabled(false);
- }
- }
-
- /**
- * @param nonImplsOnly
- */
- public void setNonImplOnly(boolean nonImplsOnly) {
- if (nonImplsOnly){
- chkImpl.setSelection(false);
- chkImpl.setEnabled(false);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationEvent.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationEvent.java
deleted file mode 100644
index a869d0a01..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationEvent.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import org.eclipse.core.runtime.IStatus;
-
-/**
- * Validation event used by JSFLibraryControl to notify containers of updates
- *
- */
-public class JSFLibraryValidationEvent {
- private String msg;
- private int severity;
-
- /**
- * Constructor
- * @param msg
- * @param severity - IStatus int value
- */
- public JSFLibraryValidationEvent(String msg, int severity) {
- this.msg = msg;
- this.severity = severity;
- }
-
- /**
- * Constructs event with severity of IStatus.ERROR
- * @param msg
- */
- public JSFLibraryValidationEvent(String msg) {
- this(msg, IStatus.ERROR);
- }
-
- /**
- * @return validation message
- */
- public String getMessage(){
- return msg;
- }
-
- /**
- * @return IStatus int value
- */
- public int getSeverity(){
- return severity;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationListener.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationListener.java
deleted file mode 100644
index dbd6b0182..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryValidationListener.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-/**
- * Listeners of {@link JSFLibraryValidationEvent}s should implement
- *
- */
-public interface JSFLibraryValidationListener {
- /**
- * Callback
- * @param e
- */
- public void notifyValidation(JSFLibraryValidationEvent e);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryWizard.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryWizard.java
deleted file mode 100644
index bf771b16e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/JSFLibraryWizard.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import java.text.MessageFormat;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistryFactory;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFVersion;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * Dialog for creating or editing a JSF Library or Implementation.
- * <br>
- * If the selection passed in init is not null then the item will be edit mode.
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFLibraryWizard extends Wizard implements INewWizard {
-
- /**
- * Implementation libaries to be included
- */
- public final static int IMPLS = 1;
- /**
- * Non-Implementation libaries to be included
- */
- public final static int NONIMPLS = 2;
-
- private JSFLibraryEditControl jsfLibraryEditControl;
-
- private boolean isNew = false;
- private boolean modified = false;
-
- private JSFLibrary curLibrary;
- private JSFLibrary workingCopyLibrary;
-
- private JSFLibraryWizardPage page;
-
- private boolean _impls;
- private boolean _nonimpls;
-
- private List<IProject> _projectsWithV1JSFLibraries = new ArrayList<IProject>();
-
- /**
- * Constructor
- * see IMPLS
- * see NONIMPLS
- * @param libTypes
- */
- public JSFLibraryWizard(int libTypes) {
- super();
- if ((libTypes & IMPLS) == IMPLS)
- _impls = true;
-
- if ((libTypes & NONIMPLS) == NONIMPLS)
- _nonimpls = true;
- }
-
-
- /**
- * Constructor. List will include all JSF Libraries.
- */
- public JSFLibraryWizard() {
- super();
- _impls = true;
- _nonimpls = true;
- }
-
- private boolean isImplsOnly(){
- if (_impls && ! _nonimpls)
- return true;
- return false;
- }
-
- private boolean isNonImplsOnly(){
- if (_nonimpls && ! _impls)
- return true;
- return false;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench, org.eclipse.jface.viewers.IStructuredSelection)
- */
- public void init(IWorkbench workbench, IStructuredSelection selection)
- {
- initV1LibrariesList();
-
- if (selection != null
- && selection.getFirstElement() instanceof JSFLibrary) {
- curLibrary = (JSFLibrary) selection.getFirstElement();
- workingCopyLibrary = curLibrary.getWorkingCopy();
- } else {
- isNew = true;
- workingCopyLibrary = JSFLibraryRegistryFactory.eINSTANCE.createJSFLibrary();
- }
- if (isImplsOnly()) {
- setWindowTitle(Messages.JSFLibraryWizard_CreateImplementation);
- } else {
- setWindowTitle(isNew ? Messages.JSFLibraryWizard_CreateJSFLibrary : Messages.JSFLibraryWizard_EditJSFLibrary);
- }
- }
-
- private void initV1LibrariesList()
- {
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
-
- // loop through the workspace and look for projects that are still using the V1 way
- // of doing JSF libraries
- for (int i = 0; i < projects.length; i++)
- {
- final IProject project = projects[i];
- if (JSFLibraryRegistryUtil.doesProjectHaveV1JSFLibraries(project))
- {
- _projectsWithV1JSFLibraries.add(project);
- }
- }
- }
-
- /**
- * Updates the JSF Library instance with the values from the working copy and
- * persists the registry.
- *
- * If editing a library reference, referencing java models will be updated.
- *
- * @see org.eclipse.jface.wizard.Wizard#performFinish()
- */
- public boolean performFinish()
- {
- // on init, if we detected any projects with old library
- // refs, we need to warn the user
- if (!isNew && // can ignore new libraries, since old projects can't possibly have dependencies on them
- _projectsWithV1JSFLibraries.size() > 0)
- {
- String projectNames = ""; //$NON-NLS-1$
- for (Iterator<IProject> it = _projectsWithV1JSFLibraries.iterator(); it.hasNext();)
- {
- IProject project = it.next();
- projectNames += project.getName() + ","; //$NON-NLS-1$
- }
- // trim trailing comma
- if (projectNames.length() > 0)
- {
- projectNames = projectNames.substring(0, projectNames.length()-1);
- }
-
- final String messageText = MessageFormat.format(Messages.JSFLibraryWizard_V1JSFLibrary_DialogMessage,
- new Object[] {projectNames});
- MessageDialogWithToggle dialog =
- WarningMessageDialogWithToggle.openOkCancelConfirm
- (getShell(), Messages.JSFLibraryWizard_V1JSFLibrary_DialogTitle, messageText, Messages.JSFLibraryWizard_JSFLibraryWizard_DontShowThisAgain_CheckBoxLabel, false, null, null);
- if (dialog.getReturnCode() != IDialogConstants.OK_ID)
- {
- // abort if the user doesn't really want to commit this change
- return false;
- }
-
- // if user accepted and asked not be warned again, clear the
- // the project properties.
- if (dialog.getToggleState())
- {
- JSFLibraryRegistryUtil.removeV1JSFLibraryProperty(_projectsWithV1JSFLibraries);
- }
- }
-
- final String name = jsfLibraryEditControl.getJSFLibraryName();
- final boolean isDeployed = jsfLibraryEditControl.getIsDeployed();
- final boolean isImplementation = jsfLibraryEditControl.getIsImplementation();
- final JSFVersion version = jsfLibraryEditControl.getJSFVersion();
-
- workingCopyLibrary.setName(name);
- workingCopyLibrary.setDeployed(isDeployed);
- workingCopyLibrary.setImplementation(isImplementation);
- workingCopyLibrary.setJSFVersion(version);
-
- final String originalID = curLibrary != null ? curLibrary.getID() :workingCopyLibrary.getID();
-
- if (isNew){
- JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().addJSFLibrary(workingCopyLibrary);
- }
- else {
- curLibrary.updateValues(workingCopyLibrary);
- try {
- JSFLibraryRegistryUtil.rebindClasspathContainerEntries(originalID, workingCopyLibrary.getID(), null);
- } catch (JavaModelException e) {
- JSFUiPlugin.log(IStatus.ERROR, "Exception while updating JSF Library containers", e); //$NON-NLS-1$
- }
- }
- JSFLibraryRegistryUtil.getInstance().saveJSFLibraryRegistry();
- return true;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#addPages()
- */
- public void addPages() {
- page = new JSFLibraryWizardPage(Messages.JSFLibraryWizard_JSFLibrary);
- super.addPage(page);
- page.setWizard(this);
- }
-
- /**
- * @return the JSFLibrary being modified by this wizard
- */
- public JSFLibrary getJSFLibrary() {
- return workingCopyLibrary;
- }
-
- private class JSFLibraryWizardPage extends WizardPage {
-
- /**
- * @param pageName
- */
- protected JSFLibraryWizardPage(String pageName) {
- super(pageName);
- setDescription(isImplsOnly()
- ? Messages.JSFLibraryWizard_IMPLS_ONLY_DESC
- : Messages.JSFLibraryWizard_DESCRIPTION);
- setTitle(Messages.JSFLibraryWizard_JSFLibrary);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.WizardPage#isPageComplete()
- */
- public boolean isPageComplete() {
- if (modified == false) {
- return false;
- }
- return super.isPageComplete();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- jsfLibraryEditControl = new JSFLibraryEditControl(workingCopyLibrary, parent);
- jsfLibraryEditControl.setImplOnly(isImplsOnly());
- jsfLibraryEditControl.setNonImplOnly(isNonImplsOnly());
- jsfLibraryEditControl.setLayout(new GridLayout(2, false));
- jsfLibraryEditControl.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- jsfLibraryEditControl.addValidationListener(new JSFLibraryValidationListener(){
- public void notifyValidation(JSFLibraryValidationEvent e) {
- setErrorMessage(e.getMessage());
- modified = true;
- setPageComplete(getErrorMessage()==null);
- }
- });
-
- setControl(jsfLibraryEditControl);
- setPageComplete(false);
- }
-
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialog.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialog.java
deleted file mode 100644
index ad3b13608..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialog.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Customized warning dialog for JSF Library Upgrade warnings.
- *
- * @author cbateman
- *
- */
-class WarningMessageDialog extends MessageDialog
-{
- private Text _messageLabel;
-
- /**
- * @param parent
- * @param title
- * @param message
- * @return true if the user hit OK
- *
- * Overriden to set the default button to CANCEL and use this dialog.
- */
- public static boolean openConfirm(Shell parent, String title, String message) {
- MessageDialog dialog = new WarningMessageDialog(parent, title, null, // accept
- // the
- // default
- // window
- // icon
- message, QUESTION, new String[] { IDialogConstants.OK_LABEL,
- IDialogConstants.CANCEL_LABEL }, 1); // CANCEL is the
- // default
- return dialog.open() == 0;
- }
-
- WarningMessageDialog(Shell parentShell, String dialogTitle,
- Image dialogTitleImage, String dialogMessage, int dialogImageType,
- String[] dialogButtonLabels, int defaultIndex) {
- super(parentShell, dialogTitle, dialogTitleImage, dialogMessage,
- dialogImageType, dialogButtonLabels, defaultIndex);
- }
-
- @Override
- protected Control createMessageArea(Composite composite)
- {
- // create composite
- // create image
- Image image = getImage();
- if (image != null) {
- imageLabel = new Label(composite, SWT.NULL);
- image.setBackground(imageLabel.getBackground());
- imageLabel.setImage(image);
- addAccessibleListeners(imageLabel, image);
- GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING)
- .applyTo(imageLabel);
- }
- // create message
- if (message != null) {
- _messageLabel = new Text(composite, getMessageLabelStyle()|SWT.READ_ONLY);
- _messageLabel.setText(message);
- GridDataFactory
- .fillDefaults()
- .align(SWT.FILL, SWT.BEGINNING)
- .grab(true, false)
- .hint(
- convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
- SWT.DEFAULT).applyTo(_messageLabel);
- }
- return composite;
- }
-
- /**
- * NOTE: copied from IconAndMessageDialog
- * Add an accessible listener to the label if it can be inferred from the
- * image.
- *
- * @param label
- * @param image
- */
- private void addAccessibleListeners(Label label, final Image image) {
- label.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent event) {
- final String accessibleMessage = getAccessibleMessageFor(image);
- if (accessibleMessage == null) {
- return;
- }
- event.result = accessibleMessage;
- }
- });
- }
-
- /**
- * NOTE: copied from IconAndMessageDialog
- * @param image
- * @return an accesible string
- */
- private String getAccessibleMessageFor(Image image) {
- if (image.equals(getErrorImage())) {
- return JFaceResources.getString("error");//$NON-NLS-1$
- }
-
- if (image.equals(getWarningImage())) {
- return JFaceResources.getString("warning");//$NON-NLS-1$
- }
-
- if (image.equals(getInfoImage())) {
- return JFaceResources.getString("info");//$NON-NLS-1$
- }
-
- if (image.equals(getQuestionImage())) {
- return JFaceResources.getString("question"); //$NON-NLS-1$
- }
-
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialogWithToggle.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialogWithToggle.java
deleted file mode 100644
index 834889d3e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/classpath/WarningMessageDialogWithToggle.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.classpath;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.accessibility.AccessibleAdapter;
-import org.eclipse.swt.accessibility.AccessibleEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Customized warning dialog for JSF Library Upgrade warnings.
- *
- * @author cbateman
- *
- */
-class WarningMessageDialogWithToggle extends MessageDialogWithToggle
-{
- private Text _messageLabel;
-
- /**
- * @param parent
- * @param title
- * @param message
- * @param toggleMessage
- * @param toggleState
- * @param store
- * @param key
- * @return the dialog.
- *
- * Overriden to make default button CANCEL and use this dialog
- */
- public static MessageDialogWithToggle openOkCancelConfirm(Shell parent,
- String title, String message, String toggleMessage,
- boolean toggleState, IPreferenceStore store, String key) {
- MessageDialogWithToggle dialog = new WarningMessageDialogWithToggle(parent,
- title, null, // accept the default window icon
- message, QUESTION, new String[] { IDialogConstants.OK_LABEL,
- IDialogConstants.CANCEL_LABEL }, 1, // CANCEL is the default
- toggleMessage, toggleState);
- dialog.open();
- return dialog;
- }
-
- WarningMessageDialogWithToggle(Shell parentShell, String dialogTitle,
- Image image, String message, int dialogImageType,
- String[] dialogButtonLabels, int defaultIndex,
- String toggleMessage, boolean toggleState) {
- super(parentShell, dialogTitle, image, message, dialogImageType,
- dialogButtonLabels, defaultIndex, toggleMessage, toggleState);
- }
-
- @Override
- protected Control createMessageArea(Composite composite)
- {
- // create composite
- // create image
- Image image = getImage();
- if (image != null) {
- imageLabel = new Label(composite, SWT.NULL);
- image.setBackground(imageLabel.getBackground());
- imageLabel.setImage(image);
- addAccessibleListeners(imageLabel, image);
- GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.BEGINNING)
- .applyTo(imageLabel);
- }
- // create message
- if (message != null) {
- _messageLabel = new Text(composite, getMessageLabelStyle()|SWT.READ_ONLY);
- _messageLabel.setText(message);
- GridDataFactory
- .fillDefaults()
- .align(SWT.FILL, SWT.BEGINNING)
- .grab(true, false)
- .hint(
- convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH),
- SWT.DEFAULT).applyTo(_messageLabel);
- }
- return composite;
- }
-
- /**
- * NOTE: copied from IconAndMessageDialog
- * Add an accessible listener to the label if it can be inferred from the
- * image.
- *
- * @param label
- * @param image
- */
- private void addAccessibleListeners(Label label, final Image image) {
- label.getAccessible().addAccessibleListener(new AccessibleAdapter() {
- public void getName(AccessibleEvent event) {
- final String accessibleMessage = getAccessibleMessageFor(image);
- if (accessibleMessage == null) {
- return;
- }
- event.result = accessibleMessage;
- }
- });
- }
-
- /**
- * NOTE: copied from IconAndMessageDialog
- * @param image
- * @return an accesible string
- */
- private String getAccessibleMessageFor(Image image) {
- if (image.equals(getErrorImage())) {
- return JFaceResources.getString("error");//$NON-NLS-1$
- }
-
- if (image.equals(getWarningImage())) {
- return JFaceResources.getString("warning");//$NON-NLS-1$
- }
-
- if (image.equals(getInfoImage())) {
- return JFaceResources.getString("info");//$NON-NLS-1$
- }
-
- if (image.equals(getQuestionImage())) {
- return JFaceResources.getString("question"); //$NON-NLS-1$
- }
-
- return null;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentDetailTableProvider.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentDetailTableProvider.java
deleted file mode 100644
index 7b6db8814..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentDetailTableProvider.java
+++ /dev/null
@@ -1,130 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.component;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo.ComponentBeanProperty;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * A table content provider for component attributes.
- *
- * @author cbateman
- *
- */
-public class ComponentDetailTableProvider implements IStructuredContentProvider
-{
- private final static Object[] NO_ELEMENT = new Object[0];
-
- public void dispose()
- {
- // TODO Auto-generated method stub
-
- }
-
- public void inputChanged(final Viewer viewer, final Object oldInput,
- final Object newInput)
- {
- // TODO Auto-generated method stub
- }
-
- public Object[] getElements(final Object inputElement)
- {
- if (inputElement instanceof ComponentInfo)
- {
- final List<ComponentProperty> tableProperties = new ArrayList();
- final ComponentInfo comp = (ComponentInfo) inputElement;
-
- final Runnable r = new Runnable()
- {
- public void run()
- {
- synchronized (comp)
- {
- for (final Iterator it = comp.getAttributeNames()
- .iterator(); it.hasNext();)
- {
- final String name = (String) it.next();
- final ComponentBeanProperty beanProp = comp.getAttribute(name);
-
- tableProperties.add(new ComponentProperty(name, beanProp.getValue()));
- }
- }
- }
- };
-
- // if we are on the UI thread then set a timer that interrupts
- // the bean property updater after 10 seconds to prevent deadlock
- // on the comp synchronization monitor
- if (Thread.currentThread() == PlatformUI.getWorkbench()
- .getDisplay().getThread())
- {
- try
- {
- final Thread interruptMe = new Thread(r);
- interruptMe.start();
- interruptMe.join(10000);
- }
- catch (InterruptedException e)
- {
- JSFUiPlugin.log(IStatus.ERROR,
- "Interrupted during bean eval", e);
- }
- }
- // if not on the UI thread, then just run it.
- else
- {
- r.run();
- }
-
- return tableProperties.toArray();
- }
-
- // otherwise, no elements
- return NO_ELEMENT;
- }
-
- /**
- * A value object for a single component name/value pair
- *
- * @author cbateman
- *
- */
- public static class ComponentProperty
- {
- private final String _name;
- private final Object _value;
-
- /**
- * @param name
- * @param value
- */
- public ComponentProperty(final String name, final Object value)
- {
- _name = name;
- _value = value;
- }
-
- /**
- * @return the property name
- */
- public final String getName()
- {
- return _name;
- }
-
- /**
- * @return the property value
- */
- public final Object getValue()
- {
- return _value;
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeView.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeView.java
deleted file mode 100644
index c97304010..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeView.java
+++ /dev/null
@@ -1,390 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.component;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.jsf.common.runtime.internal.model.decorator.Decorator;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ResolverUtil;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.ui.internal.component.ComponentDetailTableProvider.ComponentProperty;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.MessagePage;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-/**
- * A basic page-based view, similar to outline, that shows the design-time
- * component tree for a JSF view definition.
- */
-
-public class ComponentTreeView extends PageBookView
-{
-
- /**
- * This is a callback that will allow us to create the viewer and initialize
- * it.
- */
- @Override
- public void createPartControl(final Composite parent)
- {
- super.createPartControl(parent);
-
- // Create the help context id for the viewer's control
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(),
- // "ComponentTreeViewerPrototype.viewer");
- // makeActions();
- // hookContextMenu();
- // hookDoubleClickAction();
- // contributeToActionBars();
- }
-
- // private void hookContextMenu() {
- // MenuManager menuMgr = new MenuManager("#PopupMenu");
- // menuMgr.setRemoveAllWhenShown(true);
- // menuMgr.addMenuListener(new IMenuListener() {
- // public void menuAboutToShow(IMenuManager manager) {
- // SampleView.this.fillContextMenu(manager);
- // }
- // });
- // Menu menu = menuMgr.createContextMenu(viewer.getControl());
- // viewer.getControl().setMenu(menu);
- // getSite().registerContextMenu(menuMgr, viewer);
- // }
-
- // private void contributeToActionBars() {
- // IActionBars bars = getViewSite().getActionBars();
- // fillLocalPullDown(bars.getMenuManager());
- // fillLocalToolBar(bars.getToolBarManager());
- // }
-
- // private void fillLocalPullDown(IMenuManager manager) {
- // manager.add(action1);
- // manager.add(new Separator());
- // manager.add(action2);
- //
-
- // private void fillContextMenu(IMenuManager manager) {
- // manager.add(action1);
- // manager.add(action2);
- // manager.add(new Separator());
- // drillDownAdapter.addNavigationActions(manager);
- // // Other plug-ins can contribute there actions here
- // manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- // }
- //
- // private void fillLocalToolBar(IToolBarManager manager) {
- // manager.add(action1);
- // manager.add(action2);
- // manager.add(new Separator());
- // drillDownAdapter.addNavigationActions(manager);
- // }
-
- // private void makeActions() {
- // action1 = new Action() {
- // public void run() {
- // showMessage("Action 1 executed");
- // }
- // };
- // action1.setText("Action 1");
- // action1.setToolTipText("Action 1 tooltip");
- // action1.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- // getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
- //
- // action2 = new Action() {
- // public void run() {
- // showMessage("Action 2 executed");
- // }
- // };
- // action2.setText("Action 2");
- // action2.setToolTipText("Action 2 tooltip");
- // action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages().
- // getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
- // doubleClickAction = new Action() {
- // public void run() {
- // ISelection selection = viewer.getSelection();
- // Object obj = ((IStructuredSelection)selection).getFirstElement();
- // showMessage("Double-click detected on "+obj.toString());
- // }
- // };
- // }
-
- // private void hookDoubleClickAction() {
- // viewer.addDoubleClickListener(new IDoubleClickListener() {
- // public void doubleClick(DoubleClickEvent event) {
- // doubleClickAction.run();
- // }
- // });
- // }
- // private void showMessage(String message) {
- // MessageDialog.openInformation(
- // viewer.getControl().getShell(),
- // "Sample View",
- // message);
- // }
- //
- // /**
- // * Passing the focus request to the viewer's control.
- // */
- // public void setFocus() {
- // viewer.getControl().setFocus();
- //
-
- @Override
- protected IPage createDefaultPage(final PageBook book)
- {
- final MessagePage page = new MessagePage();
- initPage(page);
- page.createControl(book);
- page.setMessage("Nothing to display");
- return page;
- }
-
- @Override
- protected PageRec doCreatePage(final IWorkbenchPart part)
- {
- final ComponentPage page = new ComponentPage(getDocumentFromPart(part));
- initPage(page);
- page.createControl(getPageBook());
- return new PageRec(part, page);
- }
-
- @Override
- protected void doDestroyPage(final IWorkbenchPart part,
- final PageRec pageRecord)
- {
- pageRecord.page.dispose();
- pageRecord.dispose();
- }
-
- private IDocument getDocumentFromPart(final IWorkbenchPart part)
- {
- return (IDocument) part.getAdapter(IDocument.class);
- }
-
- /**
- * The view shows the palette associated with the active editor.
- *
- * @see PageBookView#getBootstrapPart()
- */
- @Override
- protected IWorkbenchPart getBootstrapPart()
- {
- final IWorkbenchPage page = getSite().getPage();
- if (page != null)
- {
- return page.getActiveEditor();
- }
- return null;
- }
-
- @Override
- protected boolean isImportant(final IWorkbenchPart part)
- {
- final IDocument document = getDocumentFromPart(part);
-
- if (document != null)
- {
- IFile file = ResolverUtil.getFileForDocument(document);
-
- if (file != null)
- {
- DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(file.getProject());
-
- if (manager != null)
- {
- return manager.hasDTFacesContext(file);
- }
- }
- }
-
- // fall through, then no, not important.
- return false;
- }
-
- private static class ComponentPage extends Page
- {
- private TreeViewer _treeViewer;
- private final IDocument _document;
- private TableViewer _detailsViewer;
- private Composite _splitThePane;
-
- public ComponentPage(final IDocument document)
- {
- _document = document;
- }
-
- @Override
- public void createControl(final Composite parent)
- {
- final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true,
- true);
-
- _splitThePane = new Composite(parent, SWT.NONE);
- _splitThePane.setLayoutData(gridData);
- GridLayout layout = new GridLayout(2, true);
- _splitThePane.setLayout(layout);
-
- _treeViewer = new TreeViewer(_splitThePane, SWT.MULTI
- | SWT.H_SCROLL | SWT.V_SCROLL |SWT.BORDER);
- _treeViewer.getTree().setLayoutData(gridData);
- _treeViewer.setContentProvider(new ComponentTreeViewProvider());
- _treeViewer.setLabelProvider(new TreeViewLabelProvider());
- _treeViewer.setSorter(new ComponentTreeSorter());
-
- final DTJSFViewModel model = new DTJSFViewModel(
- (IStructuredDocument) _document);
- model.init(new Runnable()
- {
- public void run()
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(
- new Runnable()
- {
- public void run()
- {
- _treeViewer.setInput(model);
- }
- });
- }
-
- });
-
- _detailsViewer = new TableViewer(_splitThePane,SWT.MULTI
- | SWT.H_SCROLL | SWT.V_SCROLL |SWT.BORDER);
- _detailsViewer.getTable().setLayoutData(gridData);
- TableColumn column = new TableColumn(_detailsViewer.getTable(),
- SWT.NONE);
- column.setWidth(100);
- column = new TableColumn(_detailsViewer.getTable(), SWT.NONE);
- column.setWidth(100);
- _detailsViewer
- .setContentProvider(new ComponentDetailTableProvider());
- _detailsViewer.setLabelProvider(new ComponentDetailLabelProvider());
-
- // hook selection in the tree to setting the input on table
- _treeViewer
- .addSelectionChangedListener(new ISelectionChangedListener()
- {
- public void selectionChanged(SelectionChangedEvent event)
- {
- IStructuredSelection selection = (IStructuredSelection) event
- .getSelection();
-
- if (selection != null && selection.size()>0)
- _detailsViewer
- .setInput(selection.getFirstElement());
- }
-
- });
- }
-
- @Override
- public Control getControl()
- {
- return _splitThePane;
- }
-
- @Override
- public void setFocus()
- {
- // do nothing
- }
-
- static class TreeViewLabelProvider extends LabelProvider
- {
- @Override
- public String getText(final Object obj)
- {
- return obj.toString();
- }
-
- @Override
- public Image getImage(final Object obj)
- {
- final String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- return PlatformUI.getWorkbench().getSharedImages().getImage(
- imageKey);
- }
- }
-
- static class ComponentDetailLabelProvider extends LabelProvider
- implements ITableLabelProvider
- {
- public Image getColumnImage(final Object element,
- final int columnIndex)
- {
- // no image
- return null;
- }
-
- public String getColumnText(final Object element,
- final int columnIndex)
- {
- String columnText = getText(element);
-
- if (element instanceof ComponentProperty)
- {
- switch (columnIndex)
- {
- case 0:
- columnText = ((ComponentProperty) element)
- .getName();
- break;
-
- case 1:
- final Object val = ((ComponentProperty) element)
- .getValue();
-
- columnText = val != null ? val.toString() : "null";
- }
- }
- return columnText;
- }
-
- }
- }
-
- private static class ComponentTreeSorter extends ViewerSorter
- {
-
- @Override
- public int compare(Viewer viewer, Object e1, Object e2)
- {
- return 0;
- }
-
- @Override
- public int category(final Object element)
- {
- // sort decorators first into their own category
- if (element instanceof Decorator)
- {
- return 0;
- }
- return 1;
- }
-
- }
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeViewProvider.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeViewProvider.java
deleted file mode 100644
index ad5b51394..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/ComponentTreeViewProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.component;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.jsf.common.runtime.internal.model.component.ComponentInfo;
-
-/**
- * A tree view adapter for a design time component tree rooted at a design time
- * view root.
- *
- * @author cbateman
- *
- */
-public class ComponentTreeViewProvider implements IStructuredContentProvider,
- ITreeContentProvider
-{
- private final static Object[] NO_CHILDREN = new Object[0];
-
- public Object[] getElements(Object inputElement)
- {
- if (inputElement instanceof DTJSFViewModel)
- {
- return new Object[] {((DTJSFViewModel)inputElement).getRoot()};
- }
- return NO_CHILDREN;
- }
-
- public void dispose()
- {
- // nothing to dispose
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput)
- {
- // do nothing
- }
-
- public Object[] getChildren(Object parentElement)
- {
- if (parentElement instanceof ComponentInfo)
- {
- List<Object> children = new ArrayList<Object>();
- children.addAll(((ComponentInfo)parentElement).getChildren());
- children.addAll(((ComponentInfo)parentElement).getAllDecorators());
- return children.toArray();
- }
- return NO_CHILDREN;
- }
-
- public Object getParent(Object element)
- {
- // no parent
- return null;
- }
-
- public boolean hasChildren(Object element)
- {
- return getChildren(element).length > 0;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/DTJSFViewModel.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/DTJSFViewModel.java
deleted file mode 100644
index 8c9d15430..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/component/DTJSFViewModel.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.component;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IWorkspaceContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.designtime.DesignTimeApplicationManager;
-import org.eclipse.jst.jsf.designtime.context.DTFacesContext;
-import org.eclipse.jst.jsf.designtime.internal.view.DTUIViewRoot;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-
-
-/**
- * The top-level input model for a design time component tree
- *
- * @author cbateman
- *
- */
-public class DTJSFViewModel
-{
- private final IStructuredDocument _document;
- private final IProject _project;
- private final IFile _file;
- private DTUIViewRoot _treeRoot;
- private final IStructuredDocumentContext _context;
-
- /**
- * @param document
- * @throws IllegalArgumentException if document cannot be used to initialize a component tree.
- */
- public DTJSFViewModel(final IStructuredDocument document)
- {
- _document = document;
- _context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(_document, -1);
-
- final IWorkspaceContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE.getWorkspaceContextResolver(_context);
-
- if (resolver == null)
- {
- throw new IllegalArgumentException();
- }
-
- _project = resolver.getProject();
- _file = (IFile) resolver.getResource();
-
- if (_project == null || _file == null)
- {
- throw new IllegalArgumentException();
- }
- }
-
- /**
- * @return the structured document that this view model was created for.
- */
- public final IStructuredDocument getDocument() {
- return _document;
- }
-
- /**
- * Acquire and initialize the component tree root for the document
- * @param runnable
- */
- public void init(final Runnable runnable)
- {
- final DesignTimeApplicationManager manager =
- DesignTimeApplicationManager.getInstance(_project);
-
- if (manager != null)
- {
- final DTFacesContext facesContext = manager.getFacesContext(_file);
-
- if (facesContext != null)
- {
- _treeRoot = facesContext.getViewRoot();
- _treeRoot.refresh(runnable);
- }
- }
- }
-
- /**
- * @return the design time view root
- */
- public DTUIViewRoot getRoot()
- {
- return _treeRoot;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/JSFContentAssistProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/JSFContentAssistProcessor.java
deleted file mode 100644
index 6895ed21e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/JSFContentAssistProcessor.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Gerry Kessler/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.ui.internal.contentassist;
-
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IDOMContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.ITaglibContextResolver;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.metadataprocessors.MetaDataEnabledProcessingFactory;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValue;
-import org.eclipse.jst.jsf.metadataprocessors.features.IPossibleValues;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMAttributeDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMElementDeclaration;
-import org.eclipse.wst.xml.core.internal.contentmodel.CMNamedNodeMap;
-import org.eclipse.wst.xml.core.internal.contentmodel.modelquery.ModelQuery;
-import org.eclipse.wst.xml.core.internal.modelquery.ModelQueryUtil;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.eclipse.wst.xml.ui.internal.taginfo.MarkupTagInfoProvider;
-import org.osgi.framework.Bundle;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * The content assist processor for non-EL attribute values.
- *
- * @author Gerry Kessler - Oracle
- *
- */
-public class JSFContentAssistProcessor implements IContentAssistProcessor {
- private ITextRegionContextResolver resolver;
- private ITaglibContextResolver tlResolver;
- private String defaultAdditionalInfo;
-
- private String defaultIconPath = "/icons/attr_val.gif"; //$NON-NLS-1$
-
- private ImageDescriptor defaultAttrValImgDesc;
-
- private MarkupTagInfoProvider fInfoProvider;
-
- /**
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
- int documentPosition) {
- List proposals = new ArrayList();
- IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(viewer, documentPosition);
-
- if (context != null) {
- resolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(context);
-
- if (resolver != null) {
- final String regionType = resolver.getRegionType();
-
- if (regionType != null
- && regionType.equals(DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE)) {
-
- tlResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getTaglibContextResolver(context);
-
- if (tlResolver != null) {
-
- Attr attr = getAttribute(context);
- if (attr != null) {
- Node tagElement = attr.getOwnerElement();
- if (tagElement != null) {
- String uri = tlResolver.getTagURIForNodeName(tagElement);
- if (uri != null) {
- proposals = createProposals(context, uri, tagElement, attr);
- }
- }
- }
- }
- }
- }
- }
-
- return (ICompletionProposal[]) proposals
- .toArray(new ICompletionProposal[0]);
- }
-
- private String getDefaultAdditionalInfo(Node tagElement, Attr attr) {
- if (defaultAdditionalInfo == null){
- CMElementDeclaration elementNode = getCMElementDeclaration(tagElement);
- if (elementNode != null){
- CMAttributeDeclaration attrNode = getCMAttributeDeclaration(elementNode, attr);
- if (attrNode != null)
- defaultAdditionalInfo = getInfoProvider().getInfo(attrNode);
- }
- }
- return defaultAdditionalInfo;
- }
-
- private CMElementDeclaration getCMElementDeclaration(Node node) {
- CMElementDeclaration result = null;
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- ModelQuery modelQuery = ModelQueryUtil.getModelQuery(node.getOwnerDocument());
- if (modelQuery != null)
- result = modelQuery.getCMElementDeclaration((Element) node);
- }
- return result;
- }
-
- private CMAttributeDeclaration getCMAttributeDeclaration(CMElementDeclaration tagElement, Attr attr) {
- CMNamedNodeMap attrs = tagElement.getAttributes();
- for (Iterator it = attrs.iterator();it.hasNext();){
- CMAttributeDeclaration CMAttr = (CMAttributeDeclaration)it.next();
- if (CMAttr.getAttrName().equals(attr.getName()))
- return CMAttr;
- }
- return null;
- }
-
- private MarkupTagInfoProvider getInfoProvider() {
- if (fInfoProvider == null) {
- fInfoProvider = new MarkupTagInfoProvider();
- }
- return fInfoProvider;
- }
-
- private List createProposals(IStructuredDocumentContext context, String uri, Node tagElement, Attr attr) {
- List ret = new ArrayList();
- List processors = MetaDataEnabledProcessingFactory.getInstance()
- .getAttributeValueRuntimeTypeFeatureProcessors(
- IPossibleValues.class, context, uri,
- tagElement.getLocalName(), attr.getLocalName());
-
- if (processors != null) {
- for (int i = 0; i < processors.size(); i++) {
- IPossibleValues p = (IPossibleValues) processors.get(i);
- ret.addAll(createProposals(p, tagElement, attr));
- }
- }
- return ret;
- }
-
- private List createProposals(IPossibleValues p, Node tagElement, Attr attr) {
- List ret = new ArrayList();
- defaultAdditionalInfo = null;
- Iterator it = p.getPossibleValues().iterator();
- while (it.hasNext()) {
- IPossibleValue val = (IPossibleValue) it.next();
- if (val != null){ //just in case...
- ICompletionProposal proposal = new CustomCompletionProposal(
- val.getValue(), //replacement text
- getReplacementOffset(), //replacementOffset
- getReplacementLength(), //replacementLength
- getCursorPosition(val), //cursor pos
- getImage(val), //image
- val.getDisplayValue(), //display value
- null, //IContextInformation
- getAdditionalInfo(val,tagElement,attr), //addditional info
- XMLRelevanceConstants.R_JSP_ATTRIBUTE_VALUE, //relevance
- true); //updateReplace
-
- ret.add(proposal);
- }
- }
- return ret;
- }
-
-
- private String getAdditionalInfo(IPossibleValue val, Node tagElement, Attr attr) {
- if (val.getAdditionalInformation() != null)
- return val.getAdditionalInformation();
-
- return getDefaultAdditionalInfo(tagElement, attr);
- }
-
- private int getReplacementLength() {
- return resolver.getRegionText().length() - 2;
- }
-
- private int getCursorPosition(IPossibleValue val) {
- //Something changed in 1.5RC2 CustomCompletionProposal
- //it appears that the cursor position is now relative to where it is currently
- //rather than relative to document
-
- //return getReplacementOffset() + val.getValue().length();
- return val.getValue().length();
- }
-
- private int getReplacementOffset() {
- return resolver.getStartOffset() + 1;
- }
-
- private Image getImage(IPossibleValue val) {
- ImageDescriptor icon = val.getIcon();
- if (icon == null || icon.equals("")){ //$NON-NLS-1$
- return getDefaultAttributeValueImage();
- }
-
- return getOrCreateImage(icon);
- }
-
- private Image getOrCreateImage(ImageDescriptor icon) {
- if (icon == null)
- return null;
-
- Image img = JSFUiPlugin.getDefault().getImageRegistry().get(icon.toString());
- if (img == null){
- try {
- img = icon.createImage();
- JSFUiPlugin.getDefault().getImageRegistry().put(icon.toString(), img);
- } catch (RuntimeException e) {
- // empty block; C.B: handle exception?
- }
- }
- return img;
- }
-
- private Image getDefaultAttributeValueImage() {
- if (defaultAttrValImgDesc == null){
- Bundle bundle = Platform.getBundle(JSFUiPlugin.PLUGIN_ID);
- URL url= FileLocator.find(bundle,new Path(defaultIconPath ), null);
- defaultAttrValImgDesc = ImageDescriptor.createFromURL(url);
- }
- return getOrCreateImage(defaultAttrValImgDesc);
- }
-
- private Attr getAttribute(IStructuredDocumentContext context) {
- final IDOMContextResolver domResolver = IStructuredDocumentContextResolverFactory.INSTANCE
- .getDOMContextResolver(context);
-
- if (domResolver != null) {
- final Node curNode = domResolver.getNode();
-
- if (curNode instanceof Attr) {
- return (Attr) curNode;
- }
- }
- return null;
-
- }
-
- public IContextInformation[] computeContextInformation(ITextViewer viewer,
- int offset) {
- // no context info
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters() {
- // auto activate when user hits a '.'
- return new char[] { '.' };
- }
-
- public char[] getContextInformationAutoActivationCharacters() {
- // no auto-activation for context info
- return null;
- }
-
- public String getErrorMessage() {
- // don't flag errors
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator() {
- // don't validate context information
- return null;
- }
-
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/el/JSFELContentAssistProcessor.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/el/JSFELContentAssistProcessor.java
deleted file mode 100644
index a2579e045..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/contentassist/el/JSFELContentAssistProcessor.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.ui.internal.contentassist.el;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistParser;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistStrategy;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter.DTELExpression;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.wst.xml.ui.internal.contentassist.ProposalComparator;
-
-/**
- * The content assist processor for JSF EL partitions on attribute values.
- *
- * @author cbateman
- *
- */
-public class JSFELContentAssistProcessor implements IContentAssistProcessor
-{
- /**
- * @see org.eclipse.jface.text.contentassist.IContentAssistProcessor#computeCompletionProposals(org.eclipse.jface.text.ITextViewer,
- * int)
- */
- public ICompletionProposal[] computeCompletionProposals(
- final ITextViewer viewer, final int documentPosition)
- {
- final List<ICompletionProposal> proposals =
- new ArrayList<ICompletionProposal>();
- final IStructuredDocumentContext context =
- IStructuredDocumentContextFactory.INSTANCE.getContext(viewer,
- documentPosition);
- if (context != null)
- {
- final XMLViewDefnAdapter viewAdapter =
- DTAppManagerUtil.getXMLViewDefnAdapter(context);
-
- if (viewAdapter != null)
- {
- try
- {
- final DTELExpression elExpression =
- viewAdapter.getELExpression(context);
-
- if (elExpression != null)
- {
- final ContentAssistStrategy strategy =
- ContentAssistParser.getPrefix(documentPosition
- - elExpression.getDocumentContext()
- .getDocumentPosition() + 1,
- elExpression.getText());
-
- if (strategy != null)
- {
- proposals.addAll(strategy.getProposals(context));
- }
- Collections.sort(proposals, new ProposalComparator());
- }
- }
- catch (ViewHandlerException e)
- {
- JSFUiPlugin.log(IStatus.ERROR, "During el resolution", e);
- }
- }
- }
-
- return proposals.toArray(new ICompletionProposal[0]);
- }
-
- public IContextInformation[] computeContextInformation(
- final ITextViewer viewer, final int offset)
- {
- // no context info
- return null;
- }
-
- public char[] getCompletionProposalAutoActivationCharacters()
- {
- // auto activate when user hits a '.'
- return new char[]
- { '.' };
- }
-
- public char[] getContextInformationAutoActivationCharacters()
- {
- // no auto-activation for context info
- return null;
- }
-
- public String getErrorMessage()
- {
- // don't flag errors
- return null;
- }
-
- public IContextInformationValidator getContextInformationValidator()
- {
- // don't validate context information
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/IJSFImplLibraryCreationListener.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/IJSFImplLibraryCreationListener.java
deleted file mode 100644
index 85fc288f5..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/IJSFImplLibraryCreationListener.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Justin Chen - development check in
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.jsflibraryconfig;
-
-/**
- * Listener interface when a new JSF implementation library is created.
- *
- * @author Justin Chen - Oracle
- *
- */
-public interface IJSFImplLibraryCreationListener extends java.util.EventListener {
- /**
- * Ok button is pressed in JSF Library dialog.
- *
- * @param event
- */
- public void okClicked(JSFImplLibraryCreationEvent event);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFImplLibraryCreationEvent.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFImplLibraryCreationEvent.java
deleted file mode 100644
index df3b0f1e3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFImplLibraryCreationEvent.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Justin Chen - development check in
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.jsflibraryconfig;
-
-import java.util.EventObject;
-
-/**
- * JSF Implementation library creation event.
- *
- * @author Justin Chen - Oracle
- *
- */
-public class JSFImplLibraryCreationEvent extends EventObject {
-
- private static final long serialVersionUID = 6390319185522362453L;
- private boolean isLibCreated;
-
- /**
- * @param source
- * @param okClicked
- */
- public JSFImplLibraryCreationEvent(Object source, boolean okClicked) {
- super(source);
- this.isLibCreated = okClicked;
- }
-
- /**
- * Ok button pressed.
- *
- * @return boolean
- */
- public boolean isLibraryCreated() {
- return isLibCreated;
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControl.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControl.java
deleted file mode 100644
index 2bae57ca0..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControl.java
+++ /dev/null
@@ -1,997 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2007 Oracle Corporation.
- * 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:
- * Justin Chen
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.jsflibraryconfig;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.EventObject;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Set;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.ISafeRunnable;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.util.SafeRunnable;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryConfigModel;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryConfiglModelSource;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryRegistryUtil;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.ArchiveFile;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibrary;
-import org.eclipse.jst.jsf.core.internal.jsflibraryregistry.JSFLibraryRegistry;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.jst.jsf.ui.internal.classpath.JSFLibraryWizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
-
-/**
- * A custom control used in wizard and property pages.
- *
- * @author Justin Chen
- */
-public class JSFLibraryConfigControl extends Composite {
-
- final static private int COLUMN_DEPLOY = 0;
- final static private int COLUMN_LIB_NAME = 1;
-
- private JSFLibraryConfigModel workingCopyModel = null;
-
- private Button btnServerSupplied;
- private Button btnUserSupplied;
- private ComboViewer cvImplLib;
- private CheckboxTableViewer ctvSelCompLib;
- private Button btnDeployJars;
- private TreeViewer tvCompLib;
- private TreeViewerAdapter tvAdapter;
- private TreeLabelProvider tvLabelProvider;
- private Combo comboImplLib;
- private Button btnAddAll;
- private Button btnRemoveAll;
-
- private Vector newJSFLibCreatedListeners = new Vector();
- private Set _changeListeners;
- private boolean _initing;
- private IDataModel model;
-
- /**
- * @param listener
- */
- public void addOkClickedListener(IJSFImplLibraryCreationListener listener) {
- newJSFLibCreatedListeners.addElement(listener);
- }
- /**
- * @param listener
- */
- public void removeOkClickedListener(IJSFImplLibraryCreationListener listener) {
- newJSFLibCreatedListeners.removeElement(listener);
- }
-
- /**
- * @param listener
- */
- public void addChangeListener(JSFLibraryConfigControlChangeListener listener){
- getChangeListeners().add(listener);
- }
-
- /**
- * @param listener
- */
- public void removeChangeListener(JSFLibraryConfigControlChangeListener listener){
- if (getChangeListeners().contains(listener))
- getChangeListeners().remove(listener);
- }
-
- private Set getChangeListeners() {
- if (_changeListeners == null){
- _changeListeners = new HashSet();
- }
- return _changeListeners;
- }
-
- private void fireChangedEvent(final EventObject e){
- if (_initing) return;
- SafeRunnable.run(new ISafeRunnable(){
- public void handleException(Throwable exception) {
- // TODO: should we perhaps do something here?
- JSFUiPlugin.log(IStatus.ERROR, exception.getLocalizedMessage());
- }
- public void run() throws Exception {
- for (Iterator it=getChangeListeners().iterator();it.hasNext();){
- ((JSFLibraryConfigControlChangeListener)it.next()).changed(new JSFLibraryConfigControlChangeEvent(e));
- }
- }
- });
- }
-
- /**
- * Create the composite
- * @param parent
- * @param style
- */
- public JSFLibraryConfigControl(Composite parent, int style) {
- super(parent, style);
- _initing = true;
- createControls();
- }
-
- /**
- * set control values from provided model.
- *
- * @param source
- */
- public void loadControlValuesFromModel(JSFLibraryConfiglModelSource source) {
- if (source != null) {
- // never read persistentModel = source;
- workingCopyModel = JSFLibraryConfigModel.JSFLibraryConfigModelFactory.createInstance(source);
- initializeControlValues();
- _initing = false;
- } else {
- JSFUiPlugin.log(IStatus.ERROR, Messages.JSFLibraryConfigControl_NullProject);
- }
-
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.swt.widgets.Widget#dispose()
- */
- public void dispose() {
- super.dispose();
- }
-
- /**
- * Return current selected JSF Implementation Library.
- * Otherwise, return null.
- *
- * @return JSFLibraryInternalReference
- */
- public JSFLibraryInternalReference getSelectedJSFLibImplementation() {
- return workingCopyModel.getCurrentJSFImplementationLibrarySelection();
- }
-
- /**
- * Return a list of selected JSF Component Libraries.
- * Otherwise, return an empty list.
- *
- * @return a list of selected JSF Component Libraries
- */
- public List getSelectedJSFLibComponents() {
- return workingCopyModel.getCurrentJSFComponentLibrarySelection();
- }
-
- /**
- *
- * @return JSFLibraryConfigModelAdapter
- */
- public JSFLibraryConfigModel getWorkingModel() {
- return workingCopyModel;
- }
-
- private void initializeControlValues() {
- loadJSFImplList();
-
- btnDeployJars.setSelection(false);
- JSFLibraryInternalReference savedImplLib = workingCopyModel.getSavedJSFImplementationLibrary();
- if ( savedImplLib != null ) {
- /*
- * Get the input for the control to set selection.
- */
- JSFLibraryInternalReference selected = JSFLibraryRegistryUtil.getInstance().getJSFLibraryReferencebyID(savedImplLib.getID());
- if (selected != null) {
- btnDeployJars.setSelection(selected.isCheckedToBeDeployed());
- cvImplLib.setSelection(new StructuredSelection(selected), true);
- }
- } else {
- JSFLibraryInternalReference dftJSFImplLib = JSFLibraryRegistryUtil.getInstance().getDefaultJSFImplementationLibrary();
- if (dftJSFImplLib != null) {
- btnDeployJars.setSelection(dftJSFImplLib.isCheckedToBeDeployed());
- cvImplLib.setSelection(new StructuredSelection(dftJSFImplLib), true);
- }
- else
- btnDeployJars.setEnabled(false);
- }
-
- loadJSFCompList();
-
- JSFLibraryInternalReference savedCompLib = null;
- JSFLibraryInternalReference selected = null;
- //Iterator it = persistentModel.getJSFComponentLibraries().iterator();
- Iterator it = workingCopyModel.getJSFComponentLibraries().iterator();
- while (it.hasNext()) {
- savedCompLib = (JSFLibraryInternalReference) it.next();
- selected = JSFLibraryRegistryUtil.getInstance().getJSFLibraryReferencebyID(savedCompLib.getID());
- if (selected != null) {
- ctvSelCompLib.setChecked(selected, selected.isCheckedToBeDeployed());
- }
- }
-
- setCompListModelProperty();
-
- initializeImplementationType();
-
- redraw();
- }
-
- private void initializeImplementationType() {
- IMPLEMENTATION_TYPE implType = workingCopyModel.getImplementationType();
- if (implType == IMPLEMENTATION_TYPE.SERVER_SUPPLIED) {
- btnServerSupplied.setSelection(true);
- btnUserSupplied.setSelection(false);
- enableUserSupplied(false);
- } else if (implType == IMPLEMENTATION_TYPE.USER_SPECIFIED) {
- btnServerSupplied.setSelection(false);
- btnUserSupplied.setSelection(true);
- enableUserSupplied(true);
- } else {
- enableUserSupplied(false);
- }
- model.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE_PROPERTY_NAME, implType);
- }
- private void loadJSFImplList() {
- cvImplLib.setInput(workingCopyModel.getJSFImplementationLibraries());
- }
-
- private void loadJSFCompList() {
- tvCompLib.setInput(workingCopyModel.getJSFComponentLibraries());
- ctvSelCompLib.setInput(workingCopyModel.getJSFComponentLibraries());
- }
-
- private JSFLibraryInternalReference getCurrentSelectedJSFImplLib() {
- JSFLibraryInternalReference selJSFImpl = null;
- StructuredSelection objs = (StructuredSelection)cvImplLib.getSelection();
- if (objs != null){
- if (objs.getFirstElement() instanceof JSFLibraryInternalReference){
- selJSFImpl = (JSFLibraryInternalReference)objs.getFirstElement();
- }
- }
- return selJSFImpl;
- }
-
- private void createImplLibControls(Composite parent) {
- final Composite cmpImpls = new Composite(parent, SWT.NONE);
- final GridLayout gridLayoutImpls = new GridLayout();
- gridLayoutImpls.numColumns = 4;
- gridLayoutImpls.marginLeft = 0;
- gridLayoutImpls.marginTop = 0;
- gridLayoutImpls.marginBottom = 0;
-
- cmpImpls.setLayout(gridLayoutImpls);
- GridData gdCmpImpls = new GridData();
- gdCmpImpls.horizontalAlignment = SWT.FILL;
- gdCmpImpls.grabExcessHorizontalSpace = true;
- cmpImpls.setLayoutData(gdCmpImpls);
-
- btnServerSupplied = new Button(cmpImpls, SWT.RADIO);
- btnServerSupplied.setToolTipText(Messages.JSFLibraryConfigControl_ServerSuppliedButtonTooltip);
- GridData gdSS = new GridData();
- gdSS.horizontalAlignment = SWT.BEGINNING;
- btnServerSupplied.setLayoutData(gdSS);
-
- btnServerSupplied.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- setServerSuppliedLibrarySelection(e);
- }
- });
-
- Label lblServerSupplied = new Label(cmpImpls, SWT.NONE);
- lblServerSupplied.setText(Messages.JSFLibraryConfigControl_ServerSuppliedButtonLabel);
- GridData lblSS = new GridData();
- lblSS.grabExcessHorizontalSpace = true;
- lblServerSupplied.setLayoutData(lblSS);
- lblServerSupplied.addMouseListener(new MouseAdapter(){
- public void mouseUp(MouseEvent e) {
- btnServerSupplied.setSelection(true);
- setServerSuppliedLibrarySelection(e);
- }
- });
-
-
- Label lblSpacer1 = new Label(cmpImpls, SWT.NONE);
- GridData gdSpc1 = new GridData();
- gdSpc1.horizontalAlignment = SWT.END;
- gdSpc1.horizontalSpan = 2;
- lblSpacer1.setLayoutData(gdSpc1);
-
- btnUserSupplied = new Button(cmpImpls, SWT.RADIO);
- btnUserSupplied.setLayoutData(new GridData());
- btnUserSupplied.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- setUserSuppliedLibrarySelection(e);
- }
- });
-
- this.addOkClickedListener(new IJSFImplLibraryCreationListener() {
- public void okClicked(JSFImplLibraryCreationEvent event) {
- if (! btnUserSupplied.getSelection() && event.isLibraryCreated()) {
- btnServerSupplied.setSelection(false);
- setUserSuppliedLibrarySelection(event);
- }
- }
- });
-
- cvImplLib = new ComboViewer(cmpImpls, SWT.READ_ONLY);
- cvImplLib.setLabelProvider(new ImplLibCVListLabelProvider());
- cvImplLib.setContentProvider(new ImplLibCVContentProvider());
- comboImplLib = cvImplLib.getCombo();
- GridData gd_cvImplLib = new GridData();
- gd_cvImplLib.horizontalAlignment = SWT.FILL;
- gd_cvImplLib.grabExcessHorizontalSpace = true;
- comboImplLib.setLayoutData(gd_cvImplLib);
- cvImplLib.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- StructuredSelection ss = (StructuredSelection) event.getSelection();
- JSFLibraryInternalReference crtSelImplLib = (JSFLibraryInternalReference) ss.getFirstElement();
- if (crtSelImplLib != null)
- {
- btnDeployJars.setEnabled(true);
- crtSelImplLib.setToBeDeployed(btnDeployJars.getSelection());
- }
- workingCopyModel.setCurrentJSFImplementationLibrarySelection(crtSelImplLib);
- model.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION, crtSelImplLib);
- fireChangedEvent(event);
- }
- }
- );
-
- btnDeployJars = new Button(cmpImpls, SWT.CHECK);
- GridData gdDeploy = new GridData();
- btnDeployJars.setLayoutData(gdDeploy);
- btnDeployJars.setText(Messages.JSFLibraryConfigControl_DeployButtonLabel);
- btnDeployJars.setToolTipText(Messages.JSFLibraryConfigControl_DeployJAR);
- btnDeployJars.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- if (! _initing){
- JSFLibraryInternalReference jsflib = getCurrentSelectedJSFImplLib();
- if (jsflib != null)
- jsflib.setToBeDeployed(btnDeployJars.getSelection());
- workingCopyModel.setCurrentJSFImplementationLibrarySelection(jsflib);//why r we doing this here???
- // model.setProperty(IJSFFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION, btnDeployJars.getSelection());
- fireChangedEvent(e);
- }
- }
- }
- );
-
- final Button btnNewImpl = new Button(cmpImpls, SWT.NONE); //compTest,
- GridData gdNew = new GridData();
- gdNew.horizontalAlignment = SWT.END;
- btnNewImpl.setLayoutData(gdNew);
- btnNewImpl.setText(Messages.JSFLibraryConfigControl_NewImplementationLibrary);
- btnNewImpl.setToolTipText(Messages.JSFLibraryConfigControl_NewImplButtonTooltip);
- btnNewImpl.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- JSFLibraryWizard wizard = new JSFLibraryWizard(JSFLibraryWizard.IMPLS);
- IWorkbench wb = PlatformUI.getWorkbench();
- wizard.init(wb, null);
- WizardDialog dialog = new WizardDialog(wb
- .getActiveWorkbenchWindow().getShell(), wizard);
- int ret = dialog.open();
- if (ret == Window.OK) {
- JSFLibraryInternalReference lib = new JSFLibraryInternalReference(wizard.getJSFLibrary(), true, true);
- JSFLibraryRegistryUtil.getInstance().addJSFLibrary(lib);
- workingCopyModel.getJSFImplementationLibraries().add(lib);
- workingCopyModel.setCurrentJSFImplementationLibrarySelection(lib);
-
- loadJSFImplList();
- btnDeployJars.setSelection(true);
- cvImplLib.setSelection(new StructuredSelection(lib), true);
-
- }
- // notify listeners that a JSF implementation is created.
- JSFImplLibraryCreationEvent event = new JSFImplLibraryCreationEvent(this, (ret == Window.OK));
- int size = newJSFLibCreatedListeners.size();
- for (int i = 0; i < size; i++) {
- IJSFImplLibraryCreationListener listener =
- (IJSFImplLibraryCreationListener) newJSFLibCreatedListeners.elementAt(i);
- listener.okClicked(event);
- }
- }
- });
- }
-
- private void setServerSuppliedLibrarySelection(final EventObject e) {
- btnUserSupplied.setSelection(false);
- model.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE_PROPERTY_NAME, IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE.SERVER_SUPPLIED);
- enableUserSupplied(false);
- fireChangedEvent(e);
-
- }
-
- private void setUserSuppliedLibrarySelection(final EventObject e) {
- btnUserSupplied.setSelection(true);
- model.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE_PROPERTY_NAME, IJSFFacetInstallDataModelProperties.IMPLEMENTATION_TYPE.USER_SPECIFIED);
- enableUserSupplied(true);
- fireChangedEvent(e);
- }
-
- private void enableUserSupplied(boolean enabled) {
- cvImplLib.getCombo().setEnabled(enabled);
- btnDeployJars.setEnabled(enabled);
- }
-
- private void createCompLibControls(Composite parent) {
- final Composite cmpCompLibs = new Composite(parent, SWT.NONE);
- final GridLayout gridLayoutCompLibs = new GridLayout();
- gridLayoutCompLibs.numColumns = 4;
- gridLayoutCompLibs.marginLeft = 0;
- gridLayoutCompLibs.marginRight = 0;
- gridLayoutCompLibs.marginWidth = 0;
- cmpCompLibs.setLayout(gridLayoutCompLibs);
- GridData gdComp = new GridData();
- gdComp.horizontalAlignment = SWT.FILL;
- gdComp.grabExcessHorizontalSpace = true;
- cmpCompLibs.setLayoutData(gdComp);
-
-
- final Label lblCompLib = new Label(cmpCompLibs, SWT.NONE);
- final GridData gd_lbl_complib = new GridData(GridData.FILL, GridData.CENTER, false, false, 4, 1);
- lblCompLib.setLayoutData(gd_lbl_complib);
- lblCompLib.setText(Messages.JSFLibraryConfigControl_ComponentLibrary);
-
- tvCompLib = new TreeViewer(cmpCompLibs, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
- tvAdapter = new TreeViewerAdapter();
- tvLabelProvider = new TreeLabelProvider();
- tvCompLib.setContentProvider(tvAdapter);
- tvCompLib.setLabelProvider(tvLabelProvider);
- tvCompLib.addDoubleClickListener(new IDoubleClickListener(){
- public void doubleClick(DoubleClickEvent event) {
- resetComponentLibSelection((StructuredSelection)event.getSelection(),
- tvCompLib,
- ctvSelCompLib,
- true);
- fireChangedEvent(event);
- }
- });
- tvCompLib.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
- tvCompLib.addFilter(new TreeViewerFilter());
-
- final Composite composite_buttons = new Composite(cmpCompLibs, SWT.NONE);
- composite_buttons.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
- composite_buttons.setLayout(new GridLayout());
-
- final Composite composite_Single = new Composite(composite_buttons, SWT.None);
- composite_Single.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- final GridLayout gl_Single = new GridLayout();
- gl_Single.marginHeight = 4;
- composite_Single.setLayout(gl_Single);
-
- final Button btnAdd = new Button(composite_Single, SWT.NONE);
- btnAdd.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- btnAdd.setText(Messages.JSFLibraryConfigControl_Add);
- btnAdd.setEnabled(false);
-
- final Button btnRemove = new Button(composite_Single, SWT.NONE);
- btnRemove.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- btnRemove.setText(Messages.JSFLibraryConfigControl_Remove);
- btnRemove.setEnabled(false);
-
- final Composite composite_All = new Composite(composite_buttons, SWT.None);
- composite_All.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- final GridLayout gl_All = new GridLayout();
- gl_Single.marginHeight = 4;
- composite_All.setLayout(gl_All);
-
- btnAddAll = new Button(composite_All, SWT.NONE);
- btnAddAll.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- btnAddAll.setText(Messages.JSFLibraryConfigControl_AddAll);
-
- btnRemoveAll = new Button(composite_All, SWT.NONE);
- btnRemoveAll.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, true, false));
- btnRemoveAll.setText(Messages.JSFLibraryConfigControl_RemoveAll);
-
- final Composite composite_New = new Composite(composite_buttons, SWT.None);
- composite_New.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- final GridLayout gl_New = new GridLayout();
- gl_Single.marginHeight = 4;
- composite_New.setLayout(gl_New);
-
- final Button btnNewCompLib = new Button(composite_New, SWT.NONE);
- btnNewCompLib.setLayoutData(new GridData(GridData.FILL, GridData.CENTER, false, false));
- btnNewCompLib.setText(Messages.JSFLibraryConfigControl_NewComponentLibrary);
- btnNewCompLib.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- JSFLibraryWizard wizard = new JSFLibraryWizard(JSFLibraryWizard.NONIMPLS);
- IWorkbench wb = PlatformUI.getWorkbench();
- wizard.init(wb, null);
- WizardDialog dialog = new WizardDialog(wb
- .getActiveWorkbenchWindow().getShell(), wizard);
- int ret = dialog.open();
- if (ret == Window.OK) {
- JSFLibraryInternalReference lib = new JSFLibraryInternalReference(
- wizard.getJSFLibrary(),
- true,
- true);
- JSFLibraryRegistryUtil.getInstance().addJSFLibrary(lib);
- workingCopyModel.getJSFComponentLibraries().add(lib);
-
- loadJSFCompList();
- setCompListModelProperty();
- ctvSelCompLib.setChecked(lib, true);
- }
- }
- });
-
- ctvSelCompLib = CheckboxTableViewer.newCheckList(cmpCompLibs, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
- ctvSelCompLib.addFilter(new CheckedTableViewerFilter());
- final Table table = ctvSelCompLib.getTable();
- table.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- table.setHeaderVisible(true);
- final TableColumn tcDeploy = new TableColumn(table, SWT.LEFT);
- tcDeploy.setWidth(50);
- tcDeploy.setText(Messages.JSFLibraryConfigControl_TH_Deploy);
- tcDeploy.setToolTipText(Messages.JSFLibraryConfigControl_DeployJAR);
- final TableColumn tcLibName = new TableColumn(table, SWT.LEFT);
- tcLibName.setWidth(150);
- tcLibName.setText(Messages.JSFLibraryConfigControl_TH_LibraryName);
-
- //ctvSelCompLib.setCellModifier(new CellModifierCTVSelCompLib());
- ctvSelCompLib.setSorter(new SelectedCompLibCTVSorter());
- ctvSelCompLib.setLabelProvider(new SelectedCompLibCTVLabelProvider());
- ctvSelCompLib.setContentProvider(new CompLibCTVContentProvider());
- ctvSelCompLib.addDoubleClickListener(new IDoubleClickListener(){
- public void doubleClick(DoubleClickEvent event) {
- resetComponentLibSelection((StructuredSelection)event.getSelection(),
- tvCompLib,
- ctvSelCompLib,
- false);
- fireChangedEvent(event);
- }
- });
- ctvSelCompLib.addCheckStateListener(new ICheckStateListener() {
- public void checkStateChanged(CheckStateChangedEvent event) {
- JSFLibraryInternalReference changedItem = (JSFLibraryInternalReference) event.getElement();
- boolean isChecked4Deploy = event.getChecked();
-
- List list = workingCopyModel.getJSFComponentLibraries();
- Iterator it = list.iterator();
- JSFLibraryInternalReference crtjsflib = null;
- while (it.hasNext()) {
- crtjsflib = (JSFLibraryInternalReference) it.next();
- if (crtjsflib.getID().equals(changedItem.getID())) {
- crtjsflib.setToBeDeployed(isChecked4Deploy);
- fireChangedEvent(event);
- break;
- }
- }
- }
- });
-
- btnAdd.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- resetComponentLibSelection((StructuredSelection)tvCompLib.getSelection(),
- tvCompLib,
- ctvSelCompLib,
- true);
- fireChangedEvent(e);
- }
- });
-
- btnAddAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- resetCompontLibSelectionAll(tvCompLib, ctvSelCompLib, true);
- fireChangedEvent(e);
- }
- });
- btnRemove.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- resetComponentLibSelection((StructuredSelection)ctvSelCompLib.getSelection(),
- tvCompLib,
- ctvSelCompLib,
- false);
- fireChangedEvent(e);
- }
- });
-
- btnRemoveAll.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- resetCompontLibSelectionAll(tvCompLib, ctvSelCompLib, false);
- fireChangedEvent(e);
- }
- });
-
- tvCompLib.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- StructuredSelection sel= (StructuredSelection)event.getSelection();
- btnAdd.setEnabled(!sel.isEmpty() && sel.getFirstElement() instanceof JSFLibraryInternalReference);
- btnAddAll.setEnabled(tvCompLib.getTree().getItemCount() > 0);
- }
- });
-
- ctvSelCompLib.addSelectionChangedListener(new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- StructuredSelection sel= (StructuredSelection)event.getSelection();
- btnRemove.setEnabled(!sel.isEmpty());
- btnRemoveAll.setEnabled(ctvSelCompLib.getTable().getItemCount() > 0);
- }
- });
-
- }
- private void createControls() {
- setRedraw(true);
- final GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- gridLayout.marginLeft = 0;
- gridLayout.marginRight = 0;
- gridLayout.marginWidth = 0;
- gridLayout.marginTop = 0;
- this.setLayout(gridLayout);
-
- createImplLibControls(this);
- createSeparator(this);
- createCompLibControls(this);
-
-
-
-
- }
-
- private void createSeparator(Composite parent) {
- final Label lblSeparator = new Label(parent, SWT.SEPARATOR | SWT.HORIZONTAL );
- GridData gd_lbl_spacer = new GridData();
- gd_lbl_spacer.horizontalAlignment = SWT.FILL;
- lblSeparator.setLayoutData(gd_lbl_spacer);
- lblSeparator.setAlignment(SWT.CENTER);
- }
-
- /*
- * Event handling helper methods
- */
-
- // Set selected item to the given state on model and update viewers.
- private void resetComponentLibSelection(StructuredSelection item,
- TreeViewer srcViewer,
- CheckboxTableViewer destViewer,
- boolean state) {
- if (item != null && !item.isEmpty()) {
- List selected = new ArrayList(item.size());
- for (Iterator sel=item.iterator();sel.hasNext();){
- JSFLibraryInternalReference jsfLibDctr = (JSFLibraryInternalReference)sel.next();
- selected.add(jsfLibDctr);
- List list = workingCopyModel.getJSFComponentLibraries();
- Iterator it = list.iterator();
- JSFLibraryInternalReference crtjsfLibDctr = null;
- while(it.hasNext()) {
- crtjsfLibDctr = (JSFLibraryInternalReference)it.next();
- if (crtjsfLibDctr.getID().equals(jsfLibDctr.getID())) {
- crtjsfLibDctr.setToBeDeployed(state);
- crtjsfLibDctr.setSelected(state);
- }
- }
- }
-
- loadJSFCompList();
-
- srcViewer.refresh();
- destViewer.refresh();
- for (Iterator it=selected.iterator();it.hasNext();){
- destViewer.setChecked(it.next(), state);
- }
-
- setCompListModelProperty();
- }
- }
-
- // Reset all component library from given state to model and update viewers.
- private void resetCompontLibSelectionAll(TreeViewer srcViewer,
- CheckboxTableViewer destViewer,
- boolean state) {
-
- List list = workingCopyModel.getJSFComponentLibraries();
- Iterator it = list.iterator();
- JSFLibraryInternalReference jsfLibDctr;
- while(it.hasNext()) {
- jsfLibDctr = (JSFLibraryInternalReference)it.next();
- jsfLibDctr.setSelected(state);
- jsfLibDctr.setToBeDeployed(state);
- }
-
- loadJSFCompList();
-
- srcViewer.refresh();
- destViewer.refresh();
- destViewer.setAllChecked(state);
-
- btnAddAll.setEnabled(! state);
- btnRemoveAll.setEnabled(state);
-
- setCompListModelProperty();
- }
-
- //synchHelper is not able to track changes to data elements in tableviewer... manual set of property
- private void setCompListModelProperty() {
- TableItem[] tableItems = ctvSelCompLib.getTable().getItems();
- List compLibs = new ArrayList(tableItems.length);
- for (int i=0;i<tableItems.length;i++){
- compLibs.add(tableItems[i].getData());
- }
- JSFLibraryInternalReference[] libs = (JSFLibraryInternalReference[])compLibs.toArray(new JSFLibraryInternalReference[0]);
- model.setProperty(IJSFFacetInstallDataModelProperties.COMPONENT_LIBRARIES, libs);
- }
-
-
- /**
- * Configure the JSFLibraryConfigControl elements to used the containers synchHelper
- * @param synchHelper
- */
- public void setSynchHelper(DataModelSynchHelper synchHelper) {
- model = synchHelper.getDataModel();
- synchHelper.synchCombo(cvImplLib.getCombo(), IJSFFacetInstallDataModelProperties.IMPLEMENTATION_LIBRARIES, null);
- synchHelper.synchCheckbox(btnDeployJars, IJSFFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION, null);
- //not using synch helper for IMPLEMENTATION_TYPE
-// synchHelper.synchCheckBoxTableViewer(ctvSelCompLib, IJSFFacetInstallDataModelProperties.COMPONENT_LIBRARIES, new Control[]{hiddenList});
- }
-
- /**
- * Inner Classes for filtering.
- *
- */
- private static class CheckedTableViewerFilter extends ViewerFilter {
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof JSFLibraryInternalReference) {
- return ((JSFLibraryInternalReference)element).isSelected();
- }
- return false;
- }
- }
- private static class TreeViewerFilter extends ViewerFilter {
-
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof JSFLibraryInternalReference) {
- return !((JSFLibraryInternalReference)element).isSelected();
- }
- return true;
- }
- }
-
- private static class CompLibCTVContentProvider implements IStructuredContentProvider {
- private List jsfComplLibs = new ArrayList(0);
-
- public Object[] getElements(Object inputElement) {
- return jsfComplLibs.toArray();
- }
- public void dispose() {
- // do nothing
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput == null) {
- jsfComplLibs = Collections.EMPTY_LIST;
- } else {
- jsfComplLibs = (List)newInput;
- }
- }
- }
- private static class ImplLibCVContentProvider implements IStructuredContentProvider {
- private List jsfImplLibs = new ArrayList(0);
-
- public Object[] getElements(Object inputElement) {
- return jsfImplLibs.toArray();
- }
- public void dispose() {
- // do nothing
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if (newInput == null) {
- jsfImplLibs = Collections.EMPTY_LIST;
- } else {
- jsfImplLibs = (List)newInput;
- }
- }
- }
-
- // Label Provider
- private static class SelectedCompLibCTVLabelProvider extends LabelProvider implements ITableLabelProvider {
- public String getColumnText(Object element, int columnIndex) {
- if (element instanceof JSFLibraryInternalReference){
-
- switch(columnIndex) {
- case COLUMN_DEPLOY:
- return " "; //$NON-NLS-1$
- case COLUMN_LIB_NAME:
- return ((JSFLibraryInternalReference)element).getLabel();
- }
- }
- return ""; //$NON-NLS-1$
-
- }
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
- }
- private static class ImplLibCVListLabelProvider extends LabelProvider {
- private JSFLibrary defaultImpl = null;
-
- public String getText(Object element) {
- if (element instanceof JSFLibraryInternalReference){
- StringBuffer labelBuf = new StringBuffer(((JSFLibraryInternalReference)element).getLabel());
- JSFLibrary lib = ((JSFLibraryInternalReference)element).getLibrary();
- if (getDefaultImpl()!= null && lib != null && lib.getID().equals(getDefaultImpl().getID()))
- labelBuf.append(" ").append(JSFLibraryRegistry.DEFAULT_IMPL_LABEL); //$NON-NLS-1$
- return labelBuf.toString() ;
- }
- return null;
- }
- private JSFLibrary getDefaultImpl() {
- if (defaultImpl == null){
- JSFLibraryRegistry jsflibreg = JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry();
- defaultImpl = jsflibreg.getDefaultImplementation();
- }
- return defaultImpl;
- }
- public Image getImage(Object element) {
- return null;
- }
- }
-
- // Sorter
- private static class SelectedCompLibCTVSorter extends ViewerSorter {
- public int compare(Viewer viewer, Object e1, Object e2) {
- if (e1 instanceof JSFLibraryInternalReference &&
- e2 instanceof JSFLibraryInternalReference) {
- JSFLibraryInternalReference item1 = (JSFLibraryInternalReference)e1;
- JSFLibraryInternalReference item2 = (JSFLibraryInternalReference)e2;
- return item1.getLabel().compareToIgnoreCase(item2.getLabel());
- }
- return 0;
- }
- }
-
- /*
- * Content provider Adapter for TreeViewer
- */
- private class TreeViewerAdapter implements ITreeContentProvider {
- private final Object[] NO_ELEMENTS= new Object[0];
-
- // ------- ITreeContentProvider Interface ------------
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- // will never happen
- }
-
- public void dispose() {
- // do nothing
- }
-
- public Object[] getElements(Object obj) {
- return workingCopyModel.getJSFComponentLibraries().toArray();
- }
-
- public Object[] getChildren(Object element) {
- if (element instanceof JSFLibraryInternalReference) {
- return ((JSFLibraryInternalReference)element).getArchiveFiles().toArray();
- }
- return NO_ELEMENTS;
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if (element instanceof JSFLibraryInternalReference) {
- return true;
- }
- return false;
- }
-
- }
-
- private static class TreeLabelProvider implements ILabelProvider {
- private final Image libImg;
- private final Image jarImg;
-
- TreeLabelProvider()
- {
- ImageDescriptor jarImgDesc = JSFUiPlugin.getImageDescriptor("obj16/jar_obj.gif"); //$NON-NLS-1$
- jarImg = jarImgDesc.createImage();
- ImageDescriptor libImgDesc = JSFUiPlugin.getImageDescriptor("obj16/library_obj.gif"); //$NON-NLS-1$
- libImg = libImgDesc.createImage();
- }
-
- public Image getImage(Object element) {
- if (element instanceof JSFLibraryInternalReference)
- {
- return libImg;
- }
- return jarImg;
- }
-
- public String getText(Object element) {
- StringBuffer labelBuf = new StringBuffer();
- if (element instanceof JSFLibraryInternalReference) {
- JSFLibraryInternalReference libWrapper = (JSFLibraryInternalReference)element;
- JSFLibrary lib = libWrapper.getLibrary();
- labelBuf.append(lib.getLabel());
- if (lib.isImplementation()) {
- labelBuf.append(" "); //$NON-NLS-1$
- if (lib == JSFLibraryRegistryUtil.getInstance().getJSFLibraryRegistry().getDefaultImplementation()) {
- labelBuf.append(Messages.JSFLibrariesPreferencePage_DEFAULT_IMPL_DESC);
- } else {
- labelBuf.append(Messages.JSFLibrariesPreferencePage_IMPL_DESC);
- }
- }
- }
- if (element instanceof ArchiveFile) {
- ArchiveFile jar = (ArchiveFile)element;
- labelBuf.append(jar.getName());
- if (!jar.exists())
- labelBuf.append(Messages.JSFLibrariesPreferencePage_MISSING_DESC);
- labelBuf.append(" - ").append(((ArchiveFile)element).getSourceLocation()); //$NON-NLS-1$
- }
- return labelBuf.toString();
- }
-
- public void addListener(ILabelProviderListener listener) {
- // not handling listeners
- }
-
- public void dispose() {
- if (libImg != null){
- libImg.dispose();
- }
- if (jarImg != null){
- jarImg.dispose();
- }
- }
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {
- // not handling listeners
- }
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeEvent.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeEvent.java
deleted file mode 100644
index 16112186e..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeEvent.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.jsflibraryconfig;
-
-import java.util.EventObject;
-
-/**
- * Event that something has changed in the JSFLibraryConfigControl
- *
- */
-public class JSFLibraryConfigControlChangeEvent {
- private EventObject event;
-
- /**
- * Constructor
- * @param ev
- */
- public JSFLibraryConfigControlChangeEvent(EventObject ev){
- this.event = ev;
- }
-
- /**
- * @return java.util.EventObject
- */
- public EventObject getEvent(){
- return event;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeListener.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeListener.java
deleted file mode 100644
index 945f9ef91..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jsflibraryconfig/JSFLibraryConfigControlChangeListener.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2001, 2007 Oracle Corporation 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:
- * Oracle Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.jsflibraryconfig;
-
-
-/**
- * Interface to be implemented to listen to changes in the JSFLibraryConfigControl object
- *
- */
-public interface JSFLibraryConfigControlChangeListener {
- /**
- * Callback method
- * @param e
- */
- public void changed(JSFLibraryConfigControlChangeEvent e);
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java
deleted file mode 100644
index 300af131d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/BeanSuffixHyperlink.java
+++ /dev/null
@@ -1,107 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.jspeditor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsf.common.util.JDTBeanProperty;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.context.symbol.internal.impl.JavaUtil;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Hyperlink for IBeanPropertySymbol and IBeanMethodSymbol el symbols. This Class only exists
- * in order to defer determining the (access) method to link to until user actually clicks
- * on the link, since determining takes too long.
- */
-class BeanSuffixHyperlink implements IHyperlink,ITestHyperlink {
- private final IRegion _fRegion;
- private final ISymbol _symbol;
-
- /**
- * Creates a BeanSuffixHyperlink for a symbol
- * @param region - the region of the hyperlink
- * @param symbol
- */
- public BeanSuffixHyperlink(final IRegion region, final ISymbol symbol) {
- _fRegion = region;
- _symbol = symbol;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return _fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- final IJavaElement element = determineJavaElement();
- if (element != null) {
- try {
- final IEditorPart editor = JavaUI.openInEditor(element);
- if (editor != null) {
- JavaUI.revealInEditor(editor, element);
- }
- }
- catch (final Exception e) {
- JSFUiPlugin.log(IStatus.WARNING, e.getMessage(), e);
- }
- }
- }
-
- public IJavaElement determineJavaElement() {
- if (_symbol instanceof IBeanPropertySymbol) {
- return determinePropertyElement((IBeanPropertySymbol) _symbol);
- }
- if (_symbol instanceof IBeanMethodSymbol) {
- return JavaUtil.findCorrespondingMethod((IBeanMethodSymbol) _symbol);
- }
- return null;
- }
-
- private IMethod determinePropertyElement(final IBeanPropertySymbol propertySymbol) {
- final JDTBeanProperty property = JavaUtil.findCorrespondingJDTProperty(propertySymbol);
- if (property != null) {
- if (property.getGetter() != null) {
- return property.getGetter();
- }
- if (property.getSetter() != null) {
- return property.getSetter();
- }
- }
- return null;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ELHyperlinkDetector.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ELHyperlinkDetector.java
deleted file mode 100644
index 1dad1a109..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ELHyperlinkDetector.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.jspeditor;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.IBeanInstanceSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanMethodSymbol;
-import org.eclipse.jst.jsf.context.symbol.IBeanPropertySymbol;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.SymbolInfo;
-
-/**
- * This HyperlinkDetector creates hyperlinks for symbols in JSF EL expressions
- * inside jsp files.
- */
-public class ELHyperlinkDetector extends AbstractHyperlinkDetector {
-
- public final IHyperlink[] detectHyperlinks(final ITextViewer textViewer,
- final IRegion region, final boolean canShowMultipleHyperlinks) {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE
- .getContext(textViewer, region.getOffset());
- return detectHyperlinks(context, region);
- }
-
- /**
- * Broken out for testing.
- * @param context
- * @param region
- * @return the hyperlinks
- */
- protected IHyperlink[] detectHyperlinks(
- final IStructuredDocumentContext context, final IRegion region) {
- final Region elRegion = JSPSourceUtil.findELRegion(context);
- if (elRegion != null) {
- final SymbolInfo symbolInfo = JSPSourceUtil.determineSymbolInfo(
- context, elRegion, region.getOffset());
- if (symbolInfo != null) {
- IHyperlink link = null;
- final Region linkRegion = new Region(symbolInfo
- .getRelativeRegion().getOffset()
- + elRegion.getOffset(), symbolInfo.getRelativeRegion()
- .getLength());
- final ISymbol symbol = symbolInfo.getSymbol();
- if (symbol instanceof IBeanInstanceSymbol) {
- link = createBeanInstanceLink(linkRegion,
- (IBeanInstanceSymbol) symbol);
- } else if (symbol instanceof IBeanPropertySymbol) {
- link = createBeanPropertyLink(linkRegion,
- (IBeanPropertySymbol) symbol);
- } else if (symbol instanceof IBeanMethodSymbol) {
- link = createMethodLink(linkRegion,
- (IBeanMethodSymbol) symbol);
- }
- if (link != null) {
- return new IHyperlink[] { link };
- }
- }
- }
- return null;
- }
-
- private IHyperlink createBeanInstanceLink(final Region region,
- final IBeanInstanceSymbol symbol) {
- if (symbol.isTypeResolved()) {
- final IType type = symbol.getJavaTypeDescriptor().getType();
- return new JavaElementHyperlink(region, type);
- }
- return null;
- }
-
- private IHyperlink createBeanPropertyLink(final Region region,
- final IBeanPropertySymbol symbol) {
- // defer calculation of access method until user click on link (takes
- // too long otherwise):
- return new BeanSuffixHyperlink(region, symbol);
- }
-
- private IHyperlink createMethodLink(final Region region,
- final IBeanMethodSymbol symbol) {
- // defer calculation of access method until user click on link (takes
- // too long otherwise):
- return new BeanSuffixHyperlink(region, symbol);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ITestHyperlink.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ITestHyperlink.java
deleted file mode 100644
index c4a062f6d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/ITestHyperlink.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.jspeditor;
-
-import org.eclipse.jdt.core.IJavaElement;
-
-/**
- * Test-only interface. Not for normal use.
- *
- * @author cbateman
- *
- */
-public interface ITestHyperlink {
- /**
- * @return the java element for symbol2 or null if none.
- */
- public IJavaElement determineJavaElement();
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSFELHover.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSFELHover.java
deleted file mode 100644
index ba634f9f8..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSFELHover.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.jspeditor;
-
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContextFactory;
-import org.eclipse.jst.jsf.context.symbol.IDescribedInDetail;
-import org.eclipse.jst.jsf.context.symbol.ISymbol;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.SymbolInfo;
-
-/** This class creates hovers for ISymbols in an el expression that have a detailedDescription.
- */
-public class JSFELHover implements ITextHover {
-
- private ISymbol hoveredSymbol = null;
-
- public final String getHoverInfo(final ITextViewer textViewer, final IRegion hoverRegion) {
- return getHoverInfo();
- }
-
- /**
- * For testing
- *
- * @return the hover info
- */
- protected String getHoverInfo()
- {
- // hoveredSymbol set by getHoverRegion, which is called first
- if (hoveredSymbol instanceof IDescribedInDetail) {
- return ((IDescribedInDetail) hoveredSymbol).getDetailedDescription();
- }
- return null;
- }
-
- public final IRegion getHoverRegion(final ITextViewer textViewer, final int documentPosition) {
- final IStructuredDocumentContext context = IStructuredDocumentContextFactory.INSTANCE.getContext(textViewer,
- documentPosition);
- return getHoverRegion(context, documentPosition);
- }
-
- /**
- * For testing
- *
- * @param context
- * @param documentPosition
- * @return the hover region
- */
- protected IRegion getHoverRegion(final IStructuredDocumentContext context, final int documentPosition)
- {
- hoveredSymbol = null;
- final Region elRegion = JSPSourceUtil.findELRegion(context);
- if (elRegion != null) {
- final SymbolInfo symbolInfo = JSPSourceUtil.determineSymbolInfo(context, elRegion, documentPosition);
- if (symbolInfo == null) {
- return null;
- }
- final Region relativeRegion = symbolInfo.getRelativeRegion();
- final Region symbolRegion = new Region(elRegion.getOffset()
- + relativeRegion.getOffset(), relativeRegion.getLength());
- hoveredSymbol = symbolInfo.getSymbol();
- return symbolRegion;
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSPSourceUtil.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSPSourceUtil.java
deleted file mode 100644
index 8dccd7100..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JSPSourceUtil.java
+++ /dev/null
@@ -1,119 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.jspeditor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.IStructuredDocumentContextResolverFactory;
-import org.eclipse.jst.jsf.context.resolver.structureddocument.internal.ITextRegionContextResolver;
-import org.eclipse.jst.jsf.context.structureddocument.IStructuredDocumentContext;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.ContentAssistParser;
-import org.eclipse.jst.jsf.core.internal.contentassist.el.SymbolInfo;
-import org.eclipse.jst.jsf.designtime.DTAppManagerUtil;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter;
-import org.eclipse.jst.jsf.designtime.internal.view.IDTViewHandler.ViewHandlerException;
-import org.eclipse.jst.jsf.designtime.internal.view.XMLViewDefnAdapter.DTELExpression;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-
-/**
- * Utility class to access EL symbols in jsp file.
- */
-public final class JSPSourceUtil
-{
-
- private JSPSourceUtil()
- {
- // utility class, no instances.
- }
-
- /**
- * Find the Region
- *
- * @param context -
- * the IStructuredDocumentContext
- * @return region of el expression, null if context doesn't point to an el
- * expression
- */
- public static Region findELRegion(final IStructuredDocumentContext context)
- {
- if (context != null)
- {
- final XMLViewDefnAdapter adapter =
- DTAppManagerUtil.getXMLViewDefnAdapter(context);
- if (adapter != null)
- {
- DTELExpression expression;
- try
- {
- expression = adapter.getELExpression(context);
- }
- catch (ViewHandlerException e)
- {
- JSFUiPlugin.log(IStatus.ERROR, "", e);
- expression = null;
- }
-
- if (expression != null)
- {
- final ITextRegionContextResolver resolver =
- IStructuredDocumentContextResolverFactory.INSTANCE
- .getTextRegionResolver(expression
- .getDocumentContext());
-
- if (resolver != null)
- {
- final String regionType = resolver.getRegionType();
-
- if (regionType != null
- && resolver.matchesRelative(new String[]
- { DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE }))
- {
- return new Region(resolver.getStartOffset(),
- resolver.getLength());
- }
- }
- }
- }
- }
- return null;
- }
-
- /**
- * Determines symbol and symbol region at a given document position
- *
- * @param context -
- * the IStructuredDocumentContext
- * @param elRegion -
- * the region of the el expression to consider
- * @param documentPosition -
- * the document position to get the symbol for
- * @return SymbolInfo
- */
- public static SymbolInfo determineSymbolInfo(
- final IStructuredDocumentContext context, final Region elRegion,
- final int documentPosition)
- {
- if (context != null && elRegion != null)
- {
- try
- {
- String elText;
- elText =
- context.getStructuredDocument().get(
- elRegion.getOffset(), elRegion.getLength());
- final SymbolInfo symbolInfo =
- ContentAssistParser.getSymbolInfo(context,
- documentPosition - elRegion.getOffset() + 1,
- elText);
- return symbolInfo;
- }
- catch (final BadLocationException e)
- {
- // well, so we simply have no symbol, no reason to worry (or
- // log...)
- return null;
- }
- }
- return null;
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java
deleted file mode 100644
index bd90cfff1..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/jspeditor/JavaElementHyperlink.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.jspeditor;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * Hyperlink for a IJavaElement to the corresponding java source
- */
-class JavaElementHyperlink implements IHyperlink, ITestHyperlink {
- private final IRegion fRegion;
- private final IJavaElement fElement;
-
- /**Creates a new hyperlink for a given IJavaElement
- * @param region - region of the hyperlink
- * @param element - hyperlink links to the source of <code>element</code>
- */
- public JavaElementHyperlink(final IRegion region, final IJavaElement element) {
- fRegion = region;
- fElement = element;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkRegion()
- */
- public IRegion getHyperlinkRegion() {
- return fRegion;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getTypeLabel()
- */
- public String getTypeLabel() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#getHyperlinkText()
- */
- public String getHyperlinkText() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jface.text.hyperlink.IHyperlink#open()
- */
- public void open() {
- try {
- final IEditorPart editor = JavaUI.openInEditor(fElement);
- if (editor != null) {
- JavaUI.revealInEditor(editor, fElement);
- }
- }
- catch (final Exception e) {
- JSFUiPlugin.log(IStatus.WARNING, e.getMessage(), e);
- }
- }
-
- public IJavaElement determineJavaElement() {
- return fElement;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties
deleted file mode 100644
index e43aca18c..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/messages.properties
+++ /dev/null
@@ -1,109 +0,0 @@
-###############################################################################
-# Copyright (c) 2005 Oracle Corporation.
-# 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:
-# Gerry Kessler - initial API and implementation
-# Ian Trimble - change key names for use with org.eclipse.osgi.util.NLS
-###############################################################################
-JSFFacetInstallPage_title=JSF Capabilities
-JSFFacetInstallPage_description=Add JSF capabilities to this Web Project
-JSFFacetInstallPage_JSFImplLabel=JSF &Implementation:
-JSFFacetInstallPage_Add1=A&dd...
-JSFFacetInstallPage_Add2=&Add...
-JSFFacetInstallPage_DeployJarsLabel=&Deploy jars to WEB-INF/lib
-JSFFacetInstallPage_JSFConfigLabel=JSF &Configuration File:
-JSFFacetInstallPage_JSFServletNameLabel=JSF &Servlet Name:
-JSFFacetInstallPage_JSFServletClassNameLabel=JSF Servlet C&lassname:
-JSFFacetInstallPage_JSFURLMappingLabel=&URL Mapping Patterns:
-JSFFacetInstallPage_JSFLibraryLabel0=JSF Libraries:
-JSFFacetInstallPage_PatternDialogTitle=Specify URL Pattern
-JSFFacetInstallPage_PatternDialogDesc=URL Pattern
-JSFFacetInstallPage_Remove=&Remove
-JSFFacetInstallPage_PatternEmptyMsg=Pattern must not be empty
-JSFFacetInstallPage_PatternSpecifiedMsg=Pattern is already specified
-JSFFacetInstallPage_ErrorNoWebAppDataModel=Unable to locate WebApp datamodel
-
-JSFLibrariesPreferencePage_DefinedJSFLibraries=Defined JSF Libraries:
-JSFLibrariesPreferencePage_DEFAULT_IMPL_DESC=[implementation - default]
-JSFLibrariesPreferencePage_New=New...
-JSFLibrariesPreferencePage_Edit=Edit...
-JSFLibrariesPreferencePage_Remove=Remove
-JSFLibrariesPreferencePage_CannotRemovePluginProvidedTitle=Cannot Remove
-JSFLibrariesPreferencePage_CannotRemovePluginProvidedMessage=Plugin provided libraries cannot be removed from the registry
-JSFLibrariesPreferencePage_MakeDefault=Make Default
-JSFLibrariesPreferencePage_MISSING_DESC=[missing]
-JSFLibrariesPreferencePage_Description=JSF Libraries contain jars with JSF components and tag libraries. Some JSF Libraries can be specially marked as implementations so that the WebApp can be executed.
-JSFLibrariesPreferencePage_IMPL_DESC=[implementation]
-JSFLibrariesPreferencePage_CannotModifyPluginProvidedTitle=Cannot Modify
-JSFLibraryPropertyPage_No_JSF_Implementation_Lib_Selected=No JSF implementation library selected.
-JSFLibrariesPreferencePage_CannotModifyPluginProvidedMessage=Plugin provided libraries cannot be edited
-
-JSFLibraryContainerWizardPage_PageName=Add JSF Library
-JSFLibraryContainerWizardPage_Title=JSF Library
-JSFLibraryContainerWizardPage_Description=Select JavaServer Face Libraries to add to the classpath
-JSFLibraryContainerWizardPage_WarningNoJSFFacet=JavaServer Face Libraries can only be configured for Dynamic Web projects with the JSF facet installed.
-JSFLibraryContainerWizardPage_JSFLibraries=JSF Libraries:
-JSFLibraryContainerWizardPage_Add=Add...
-JSFLibraryContainerWizardPage_V1Registry_Warning_DialogTitle=Backward compatibility issue
-JSFLibraryWizard_JSFLibraryWizard_DontShowThisAgain_CheckBoxLabel=Do not show this message again (affects all listed projects)
-JSFLibraryContainerWizardPage_V1Registry_Warning_DialogText=This project is currently configured for use with an obsolete version of JSF libraries. \
-Changing JSF library settings on this project may break backward compatibility with older versions of JSF tools.\
-\n\nSee http://wiki.eclipse.org/index.php/JSF_Library_Migration for more information.
-JSFLibraryContainerWizardPage_EditLibrary_DescriptionText=Select JSF Library for this reference to use. Choose 'Edit...' to modify contents of the selected library.
-JSFLibraryContainerWizardPage_Edit=Edit...
-JSFLibraryContainerWizardPage_ImplAlreadyPresent=An implementation has already been chosen. Please remove before adding different one
-JSFLibraryContainerWizardPage_ErrorInitializing=Error during initialization
-JSFLibraryContainerWizardPage_SelectOneImpl=Choose only one implementation
-
-JSFLibraryWizard_DESCRIPTION=Create a library of jars that make up a JSF component library.
-JSFLibraryWizard_IMPLS_ONLY_DESC=Create a library of jars that make up a JSF implementation library.
-JSFLibraryWizard_CreateImplementation=Create JSF Implementation Library
-JSFLibraryWizard_CreateJSFLibrary=Create JSF Library
-JSFLibraryWizard_EditJSFLibrary=Edit JSF Library
-JSFLibraryWizard_JSFLibrary=JSF Library
-JSFLibraryWizard_LibraryName=Library &Name:
-JSFLibraryWizard_VersionSupported=&Version Supported:
-JSFLibraryWizard_LibraryJars=Library &Jars
-JSFLibraryWizard_IsJSFImplementation=Is JSF &Implementation
-JSFLibraryWizard_DeployJars=&Deploy Jars
-JSFLibraryWizard_Add=&Add...
-JSFLibraryWizard_Remove=&Remove
-JSFLibraryWizard_ExtJarFileDialogTitle=Browse for Jars/Zips
-JSFLibraryWizard_ValidateNoJars=The library must contain at least one jar.
-JSFLibraryWizard_ValidateNoLibraryName=A library name must be supplied.
-JSFLibraryWizard_ValidateExistingLibraryName=A library or implementation by this name already exists.
-JSFLibraryWizard_V1JSFLibrary_DialogMessage=The projects listed below contain JSF library references that are\
-obsolete and may not be automatically updated by this change. To fix this issue, you need to update these\
-these projects.\
-\n\nSee http://wiki.eclipse.org/index.php/JSF_Library_Migration for more information. \n\nProjects: {0}
-JSFLibraryWizard_V1JSFLibrary_DialogTitle=Backward compatibility issue
-
-JSFLibraryConfigControl_ImplementationLibrary=Implementation Library
-JSFLibraryPropertyPage_No_JSF_Facet_Installed=JSF Facet not installed.
-JSFLibraryConfigControl_NewImplementationLibrary=New...
-JSFLibraryConfigControl_ServerSuppliedButtonTooltip=Chosen server adapter must supply the JSF Implementation jars.
-JSFLibraryConfigControl_ServerSuppliedButtonLabel=Server Supplied JSF Implementation
-JSFLibraryConfigControl_NewImplButtonTooltip=Create new user supplied implementation library
-JSFLibraryConfigControl_DeployJAR=Deploy jars to WEB-INF/lib
-JSFLibraryConfigControl_ComponentLibrary=Component Libraries
-JSFLibraryConfigControl_DeployButtonLabel=Deploy
-JSFLibraryConfigControl_Add=\ \ >
-JSFLibraryConfigControl_Remove=\ \ <
-JSFLibraryConfigControl_AddAll=\ \ >>
-JSFLibraryConfigControl_RemoveAll=\ \ <<
-JSFLibraryConfigControl_NewComponentLibrary=New...
-JSFLibraryConfigControl_TH_Deploy=Deploy
-JSFLibraryConfigControl_NullProject=No project specified.
-JSFLibraryConfigControl_TH_LibraryName=Library Name
-
-JSFValidationPreferencePage_ELPrefPanel_Title=Expression Language (EL) Validation
-JSFValidationPreferencePage_ELPrefPanel_BuildValidationCheckBoxTitle=Validate EL on &Build/Run Validation
-JSFValidationPreferencePage_ELPrefPanel_IncrementalValidationCheckBoxTitle= Validate EL as &you type (may be slow on some pages)
-
-JSFLibraryEditControl_ImplVersion_UNKNOWN=UNKNOWN
-
-JSFPreferences_RootPage_Description=Expand the tree to edit preferences for a specific feature. \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/preferences/EmptyRootPreferencePage.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/preferences/EmptyRootPreferencePage.java
deleted file mode 100644
index d269dd275..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/preferences/EmptyRootPreferencePage.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Jens Lukowski/Innoopract - initial renaming/restructuring
- * Oracle - adapted for JSF tooling
- *
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.preferences;
-
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.ScrolledComposite;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * The empty pref page used as the root of all other JSF feature preference pages
- * under the Web&XML top-level pref page
- *
- * @author cbateman
- *
- */
-public class EmptyRootPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
-
- private Composite createComposite(Composite parent, int numColumns) {
- noDefaultAndApplyButton();
-
- Composite composite = new Composite(parent, SWT.NULL);
-
- // GridLayout
- GridLayout layout = new GridLayout();
- layout.numColumns = numColumns;
- composite.setLayout(layout);
-
- // GridData
- GridData data = new GridData(GridData.FILL);
- data.horizontalIndent = 0;
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
-
- return composite;
- }
-
- protected Control createContents(Composite parent) {
- Composite composite = createScrolledComposite(parent);
-
- String description = Messages.JSFPreferences_RootPage_Description;
- Text text = new Text(composite, SWT.READ_ONLY);
- // some themes on GTK have different background colors for Text and Labels
- text.setBackground(composite.getBackground());
- text.setText(description);
-
- setSize(composite);
- return composite;
- }
-
- private Composite createScrolledComposite(Composite parent) {
- // create scrollbars for this parent when needed
- final ScrolledComposite sc1 = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
- sc1.setLayoutData(new GridData(GridData.FILL_BOTH));
- Composite composite = createComposite(sc1, 1);
- sc1.setContent(composite);
-
- // not calling setSize for composite will result in a blank composite,
- // so calling it here initially
- // setSize actually needs to be called after all controls are created,
- // so scrolledComposite
- // has correct minSize
- setSize(composite);
- return composite;
- }
-
- public void init(IWorkbench workbench) {
- // do nothing
- }
-
- private void setSize(Composite composite) {
- if (composite != null) {
- // Note: The font is set here in anticipation that the class inheriting
- // this base class may add widgets to the dialog. setSize
- // is assumed to be called just before we go live.
- applyDialogFont(composite);
- Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- composite.setSize(minSize);
- // set scrollbar composite's min size so page is expandable but
- // has scrollbars when needed
- if (composite.getParent() instanceof ScrolledComposite) {
- ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
- sc1.setMinSize(minSize);
- sc1.setExpandHorizontal(true);
- sc1.setExpandVertical(true);
- }
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/project/facet/JSFFacetInstallPage.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/project/facet/JSFFacetInstallPage.java
deleted file mode 100644
index 4874def3a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/project/facet/JSFFacetInstallPage.java
+++ /dev/null
@@ -1,610 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005 Oracle Corporation.
- * 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:
- * Gerry Kessler - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.project.facet;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.DialogSettings;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryConfigDialogSettingData;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryConfiglModelSource;
-import org.eclipse.jst.jsf.core.internal.jsflibraryconfig.JSFLibraryInternalReference;
-import org.eclipse.jst.jsf.core.internal.project.facet.IJSFFacetInstallDataModelProperties;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.jst.jsf.ui.internal.jsflibraryconfig.IJSFImplLibraryCreationListener;
-import org.eclipse.jst.jsf.ui.internal.jsflibraryconfig.JSFImplLibraryCreationEvent;
-import org.eclipse.jst.jsf.ui.internal.jsflibraryconfig.JSFLibraryConfigControl;
-import org.eclipse.jst.jsf.ui.internal.jsflibraryconfig.JSFLibraryConfigControlChangeEvent;
-import org.eclipse.jst.jsf.ui.internal.jsflibraryconfig.JSFLibraryConfigControlChangeListener;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-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.Label;
-import org.eclipse.swt.widgets.List;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
-import org.eclipse.wst.common.project.facet.ui.IWizardContext;
-
-/**
- * JSF Facet installation wizard page.
- *
- * @author Gerry Kessler - Oracle
- */
-public class JSFFacetInstallPage extends DataModelWizardPage implements
- IJSFFacetInstallDataModelProperties, IFacetWizardPage {
- // UI
- private Label lblJSFImpl;
- private Label lblJSFConfig;
- private Text txtJSFConfig;
- private Label lblJSFServletName;
- private Text txtJSFServletName;
- private Label lblJSFServletClassName;
- private Text txtJSFServletClassName;
- private Label lblJSFServletURLPatterns;
- private List lstJSFServletURLPatterns;
- private Button btnAddPattern;
- private Button btnRemovePattern;
-
- private IDialogSettings dialogSettings;
- private IDataModel webAppDataModel;
- private static final String SETTINGS_ROOT = JSFUiPlugin.PLUGIN_ID
- + ".jsfFacetInstall"; //$NON-NLS-1$
- private static final String SETTINGS_CONFIG = "configPath"; //$NON-NLS-1$
- private static final String SETTINGS_SERVLET = "servletName"; //$NON-NLS-1$
- private static final String SETTINGS_SERVLET_CLASSNAME = "servletClassname"; //$NON-NLS-1$
- private static final String SETTINGS_URL_MAPPINGS = "urlMappings"; //$NON-NLS-1$
- private static final String SETTINGS_URL_PATTERN = "pattern"; //$NON-NLS-1$
- private static final String SETTINGS_DEPLOY_IMPL = "deployImplementation"; //$NON-NLS-1$
- private static final String SETTINGS_IMPL_TYPE = "deployImplType";//$NON-NLS-1$
- private static final String SETTINGS_COMPLIB = "selectedComponent"; //$NON-NLS-1$
- private static final String SETTINGS_COMPLIB_SELECT_DEPLOY = "selectdeploycomplib"; //$NON-NLS-1$
-
- private static final String SEPARATOR = ":"; //$NON-NLS-1$
-
- //Part of temporary fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=190304
- private static final String DEFAULT_TO_CLIENT = "initialDefaultToClientSupplied";
- private static final String DEFAULT_TO_SERVER = "initialDefaultToServerSupplied";
-
-
- private JSFLibraryConfigControl jsfLibCfgComp = null;
- // private String projectName = null;
- private Composite composite = null;
-
- /**
- * Zero argument constructor
- */
- public JSFFacetInstallPage() {
- // FIXME: following WebFacetInstallPage pattern which will be fixed at somepoint
- super(DataModelFactory.createDataModel(new AbstractDataModelProvider() {/*
- * do
- * nothing
- */
- }), "jsf.facet.install.page"); //$NON-NLS-1$
- setTitle(Messages.JSFFacetInstallPage_title);
- setDescription(Messages.JSFFacetInstallPage_description);
- dialogSettings = JSFUiPlugin.getDefault().getDialogSettings();
-
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#createTopLevelComposite(org.eclipse.swt.widgets.Composite)
- */
- protected Composite createTopLevelComposite(final Composite parent) {
- initializeDialogUnits(parent);
- composite = new Composite(parent, SWT.NONE);
- final GridLayout jsfCompositeLayout = new GridLayout(3, false);
- jsfCompositeLayout.marginTop = 0;
- jsfCompositeLayout.marginBottom = 0;
- jsfCompositeLayout.marginRight = 0;
- jsfCompositeLayout.marginLeft = 0;
- composite.setLayout(jsfCompositeLayout);
-
- lblJSFImpl = new Label(composite, SWT.None);
- GridData gdLbl = new GridData();
- gdLbl.verticalIndent = 5;
- gdLbl.verticalAlignment = SWT.BEGINNING;
- lblJSFImpl.setLayoutData(gdLbl);
- lblJSFImpl.setText(Messages.JSFFacetInstallPage_JSFLibraryLabel0);
-
- jsfLibCfgComp = new JSFLibraryConfigControl(composite, SWT.NONE);
- jsfLibCfgComp
- .addOkClickedListener(new IJSFImplLibraryCreationListener() {
- public void okClicked(JSFImplLibraryCreationEvent event) {
- if (event.isLibraryCreated()) {
- validatePage();
- }
- }
- });
-
- jsfLibCfgComp.addChangeListener( new JSFLibraryConfigControlChangeListener(){
-
- public void changed(JSFLibraryConfigControlChangeEvent e) {
- validatePage();
- }
-
- });
- GridData gd_comp = new GridData();
- gd_comp.horizontalSpan = 2;
- gd_comp.grabExcessHorizontalSpace = true;
- gd_comp.grabExcessVerticalSpace = true;
- gd_comp.horizontalAlignment = SWT.FILL;
- jsfLibCfgComp.setLayoutData(gd_comp);
-
- lblJSFConfig = new Label(composite, SWT.NONE);
- lblJSFConfig.setText(Messages.JSFFacetInstallPage_JSFConfigLabel);
- lblJSFConfig.setLayoutData(new GridData(GridData.BEGINNING));
-
- txtJSFConfig = new Text(composite, SWT.BORDER);
- GridData gd1 = new GridData(GridData.FILL_HORIZONTAL);
- gd1.horizontalSpan = 2;
- txtJSFConfig.setLayoutData(gd1);
-
- lblJSFServletName = new Label(composite, SWT.NONE);
- lblJSFServletName
- .setText(Messages.JSFFacetInstallPage_JSFServletNameLabel);
- lblJSFServletName.setLayoutData(new GridData(GridData.BEGINNING));
-
- txtJSFServletName = new Text(composite, SWT.BORDER);
- GridData gd2 = new GridData(GridData.FILL_HORIZONTAL);
- gd2.horizontalSpan = 2;
- txtJSFServletName.setLayoutData(gd2);
-
- lblJSFServletClassName = new Label(composite, SWT.NONE);
- lblJSFServletClassName
- .setText(Messages.JSFFacetInstallPage_JSFServletClassNameLabel);
- lblJSFServletClassName.setLayoutData(new GridData(GridData.BEGINNING));
-
- txtJSFServletClassName = new Text(composite, SWT.BORDER);
- GridData gd2c = new GridData(GridData.FILL_HORIZONTAL);
- gd2c.horizontalSpan = 2;
- txtJSFServletClassName.setLayoutData(gd2c);
-
- lblJSFServletURLPatterns = new Label(composite, SWT.NULL);
- lblJSFServletURLPatterns
- .setText(Messages.JSFFacetInstallPage_JSFURLMappingLabel);
- lblJSFServletURLPatterns.setLayoutData(new GridData(GridData.BEGINNING
- | GridData.VERTICAL_ALIGN_BEGINNING));
- lstJSFServletURLPatterns = new List(composite, SWT.BORDER);
- GridData gd3 = new GridData(GridData.FILL_HORIZONTAL);
- gd3.heightHint = convertHeightInCharsToPixels(5);
- lstJSFServletURLPatterns.setLayoutData(gd3);
- lstJSFServletURLPatterns.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- btnRemovePattern.setEnabled(lstJSFServletURLPatterns
- .getSelectionCount() > 0);
- }
- });
-
- Composite btnComposite = new Composite(composite, SWT.NONE);
- GridLayout gl = new GridLayout(1, false);
- // gl.marginBottom = 0;
- // gl.marginTop = 0;
- // gl.marginRight = 0;
- gl.marginLeft = 0;
- btnComposite.setLayout(gl);
- btnComposite.setLayoutData(new GridData(GridData.END
- | GridData.VERTICAL_ALIGN_FILL));
-
- btnAddPattern = new Button(btnComposite, SWT.NONE);
- btnAddPattern.setText(Messages.JSFFacetInstallPage_Add2);
- btnAddPattern.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
- | GridData.VERTICAL_ALIGN_BEGINNING));
- btnAddPattern.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- InputDialog dialog = new InputDialog(getShell(),
- Messages.JSFFacetInstallPage_PatternDialogTitle,
- Messages.JSFFacetInstallPage_PatternDialogDesc, null,
- new IInputValidator() {
-
- public String isValid(String newText) {
- return isValidPattern(newText);
- }
-
- });
- dialog.open();
- if (dialog.getReturnCode() == Window.OK) {
- addItemToList(dialog.getValue(), true);
- }
- }
- });
-
- btnRemovePattern = new Button(btnComposite, SWT.NONE);
- btnRemovePattern.setText(Messages.JSFFacetInstallPage_Remove);
- btnRemovePattern.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
- | GridData.VERTICAL_ALIGN_BEGINNING));
- btnRemovePattern.setEnabled(false);
- btnRemovePattern.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent e) {
- removeItemFromList(lstJSFServletURLPatterns.getSelection());
- btnRemovePattern.setEnabled(false);
- }
- });
-
- addModificationListeners();
-
- this.getContainer().getShell().pack();
-
- return composite;
- }
-
- private void initializeValues() {
- IDialogSettings root = dialogSettings.getSection(SETTINGS_ROOT);
-
- initJSFCfgCtrlValues(root);
-
- String conf = null;
- if (root != null)
- conf = root.get(SETTINGS_CONFIG);
- if (conf == null || conf.equals("")) { //$NON-NLS-1$
- conf = (String) model
- .getDefaultProperty(IJSFFacetInstallDataModelProperties.CONFIG_PATH);
- }
- txtJSFConfig.setText(conf);
-
- String servletName = null;
- if (root != null)
- servletName = root.get(SETTINGS_SERVLET);
- if (servletName == null || servletName.equals("")) { //$NON-NLS-1$
- servletName = (String) model
- .getDefaultProperty(IJSFFacetInstallDataModelProperties.SERVLET_NAME);
- }
- txtJSFServletName.setText(servletName);
-
- String servletClassname = null;
- if (root != null)
- servletClassname = root.get(SETTINGS_SERVLET_CLASSNAME);
- if (servletClassname == null || servletClassname.equals("")) { //$NON-NLS-1$
- servletClassname = (String) model
- .getDefaultProperty(IJSFFacetInstallDataModelProperties.SERVLET_CLASSNAME);
- }
- txtJSFServletClassName.setText(servletClassname);
-
- loadURLMappingPatterns(root);
- }
-
- private void initJSFCfgCtrlValues(IDialogSettings root) {
- IMPLEMENTATION_TYPE implType = IMPLEMENTATION_TYPE.UNKNOWN;
- String deployImpl = null;
-
- if (root != null) {
- implType = IMPLEMENTATION_TYPE.getValue(root.get(SETTINGS_IMPL_TYPE));
- deployImpl = root.get(SETTINGS_DEPLOY_IMPL);
-
- }
-
- //Part of temporary fix for https://bugs.eclipse.org/bugs/show_bug.cgi?id=190304
- if (implType == IMPLEMENTATION_TYPE.UNKNOWN) {
- // if the impl type is still unknown, check if the product provided a default
- IPreferenceStore prefs = JSFUiPlugin.getDefault().getPreferenceStore();
- if(prefs.getBoolean(DEFAULT_TO_CLIENT)) {
- implType = IMPLEMENTATION_TYPE.USER_SPECIFIED;
- }
- else if(prefs.getBoolean(DEFAULT_TO_SERVER)) {
- implType = IMPLEMENTATION_TYPE.SERVER_SUPPLIED;
- }
- }
-
- if (deployImpl == null || deployImpl.equals("")) { //$NON-NLS-1$
- deployImpl = ((Boolean) model
- .getDefaultProperty(IJSFFacetInstallDataModelProperties.DEPLOY_IMPLEMENTATION))
- .toString();
- }
-
- IDialogSettings complibs = null;
- if (root != null) {
- complibs = root.getSection(SETTINGS_COMPLIB);
- }
-
- String[] selection = null;
- if (complibs != null) {
- selection = complibs.getArray(SETTINGS_COMPLIB_SELECT_DEPLOY);
- }
-
- JSFLibraryConfiglModelSource source = new JSFLibraryConfigDialogSettingData(implType,
- Boolean.valueOf(deployImpl).booleanValue(), selection);
- jsfLibCfgComp.loadControlValuesFromModel(source);
- }
-
-
- private void saveSettings() {
- DialogSettings root = new DialogSettings(SETTINGS_ROOT);
- dialogSettings.addSection(root);
-
- root.put(SETTINGS_IMPL_TYPE, getJSFImplType());
- root.put(SETTINGS_DEPLOY_IMPL, String.valueOf(getDeployJSFImpl()));
- root.put(SETTINGS_CONFIG, getJSFConfig());
- root.put(SETTINGS_SERVLET, getJSFServletName());
- root.put(SETTINGS_SERVLET_CLASSNAME, getJSFServletClassname());
- DialogSettings mappings = new DialogSettings(SETTINGS_URL_MAPPINGS);
- root.addSection(mappings);
- mappings.put(SETTINGS_URL_PATTERN, getJSFPatterns());
-
- DialogSettings complibs = new DialogSettings(SETTINGS_COMPLIB);
- root.addSection(complibs);
- complibs.put(SETTINGS_COMPLIB_SELECT_DEPLOY, getCompLibSelections());
- }
-
- private String getJSFImplType() {
- return IMPLEMENTATION_TYPE.getStringValue((IMPLEMENTATION_TYPE)model.getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME));
- }
-
- private boolean getDeployJSFImpl() {
- if (jsfLibCfgComp.getSelectedJSFLibImplementation() == null) {
- return false;
- }
- return jsfLibCfgComp.getSelectedJSFLibImplementation()
- .isCheckedToBeDeployed();
- }
-
- private String getJSFConfig() {
- return txtJSFConfig.getText().trim();
- }
-
- private String getJSFServletName() {
- return txtJSFServletName.getText().trim();
- }
-
- private String getJSFServletClassname() {
- return txtJSFServletClassName.getText().trim();
- }
-
- private String[] getJSFPatterns() {
- return lstJSFServletURLPatterns.getItems();
- }
-
- private String[] getCompLibSelections() {
- /*
- * Iterate thru the selected component libraries and return selected
- * component libraries and their deployment flags in a string array.
- */
- JSFLibraryInternalReference complib = null;
- String str = null;
- ArrayList al = new ArrayList();
-
- java.util.List list = jsfLibCfgComp.getSelectedJSFLibComponents();
- Iterator it = list.iterator();
- while (it.hasNext()) {
- complib = (JSFLibraryInternalReference) it.next();
- str = complib.getID() + SEPARATOR + complib.isCheckedToBeDeployed();
- al.add(str);
- }
-
- return (String[]) al.toArray(new String[al.size()]);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.project.facet.ui.IFacetWizardPage#setConfig(java.lang.Object)
- */
- public void setConfig(Object config) {
- model.removeListener(this);
- synchHelper.dispose();
-
- model = (IDataModel) config;
- model.addListener(this);
- synchHelper = initializeSynchHelper(model);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.common.project.facet.ui.IFacetWizardPage#transferStateToConfig()
- */
- public void transferStateToConfig() {
- saveSettings(); // convenient place for this. don't want to save if user
- // cancelled.
- // do nothing else now. being handled by synchHelper
- // config.setProperty(IJSFFacetInstallDataModelProperties.IMPLEMENTATION,
- // getJSFImpl());
-// model
-// .setStringProperty(
-// IJSFFacetInstallDataModelProperties.CONFIG_PATH,
-// getJSFConfig());
-// model.setStringProperty(
-// IJSFFacetInstallDataModelProperties.SERVLET_NAME,
-// getJSFServletName());
- // config.setProperty(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- // getJSFPatterns());
-
-// java.util.List implLibs = new ArrayList();
-// implLibs.add(jsfLibCfgComp.getSelectedJSFLibImplementation());
-// java.util.List compLibs = jsfLibCfgComp.getSelectedJSFLibComponents();
-// model.setProperty(
-// IJSFFacetInstallDataModelProperties.IMPLEMENTATION_LIBRARIES,
-// implLibs);
-// model.setProperty(
-// IJSFFacetInstallDataModelProperties.COMPONENT_LIBRARIES,
-// compLibs);
- }
-
- private void addModificationListeners() {
- jsfLibCfgComp.setSynchHelper(synchHelper);
- synchHelper.synchText(txtJSFConfig, CONFIG_PATH, null);
- synchHelper.synchText(txtJSFServletName, SERVLET_NAME, null);
- synchHelper.synchText(txtJSFServletClassName, SERVLET_CLASSNAME, null);
- synchHelper.synchList(lstJSFServletURLPatterns, SERVLET_URL_PATTERNS, null);
-
- // synchHelper.synchCheckbox(chkDeployImpl, DEPLOY_IMPLEMENTATION,
- // null);
- }
-
- private String isValidPattern(String value) {
- if (value == null || value.trim().equals("")) //$NON-NLS-1$
- return Messages.JSFFacetInstallPage_PatternEmptyMsg;
- if (lstJSFServletURLPatterns.indexOf(value) >= 0)
- return Messages.JSFFacetInstallPage_PatternSpecifiedMsg;
-
- return null;
- }
-
- private void loadURLMappingPatterns(IDialogSettings root) {
- lstJSFServletURLPatterns.removeAll();
- IDialogSettings mappings = null;
- if (root != null)
- mappings = root.getSection(SETTINGS_URL_MAPPINGS);
- String[] patterns = null;
- if (mappings != null)
- patterns = mappings.getArray(SETTINGS_URL_PATTERN);
-
- if (patterns == null || patterns.length == 0) {
- patterns = (String[]) model
- .getDefaultProperty(IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS);
- }
- for (int i = 0; i < patterns.length; i++) {
- addItemToList(patterns[i], false);
- }
- }
-
- private void addItemToList(String pattern, boolean selectMe) {
- lstJSFServletURLPatterns.add(pattern == null ? "" : pattern); //$NON-NLS-1$
- if (pattern == null && selectMe)
- lstJSFServletURLPatterns.setSelection(lstJSFServletURLPatterns
- .getItemCount() - 1);
- // When 119321 is fixed - remove code below
- updateModelForURLPattern();
- }
-
- private void removeItemFromList(String[] selection) {
- for (int i = 0; i < selection.length; i++) {
- String sel = selection[i];
- lstJSFServletURLPatterns.remove(sel);
- }
- // When 119321 is fixed - remove code below
- updateModelForURLPattern();
- }
-
- private void updateModelForURLPattern() {
- model.setProperty(
- IJSFFacetInstallDataModelProperties.SERVLET_URL_PATTERNS,
- lstJSFServletURLPatterns.getItems());
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#getValidationPropertyNames()
- */
- protected String[] getValidationPropertyNames() {
- return new String[] { IMPLEMENTATION_TYPE_PROPERTY_NAME, IMPLEMENTATION, DEPLOY_IMPLEMENTATION,
- CONFIG_PATH, SERVLET_NAME, SERVLET_CLASSNAME, COMPONENT_LIBRARIES };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.project.facet.ui.IFacetWizardPage#setWizardContext(org.eclipse.wst.common.project.facet.ui.IWizardContext)
- */
- public void setWizardContext(IWizardContext context) {
- // hook into web datamodel if new project wizard.
- Iterator it = context.getSelectedProjectFacets().iterator();
- IProjectFacetVersion webFacetVersion = null;
- while (it.hasNext()) {
- // find Web facet
- IProjectFacetVersion pfv = (IProjectFacetVersion) it.next();
- if (pfv.getProjectFacet().getId().equals("jst.web")) { //$NON-NLS-1$
- webFacetVersion = pfv;
- break;
- }
- }
- if (webFacetVersion != null) {
- try {
- webAppDataModel = (IDataModel) context.getConfig(
- webFacetVersion, IFacetedProject.Action.Type.INSTALL,
- context.getProjectName());
- if (webAppDataModel != null) {
- webAppDataModel.addListener(this);
- }
- } catch (CoreException e) {
- JSFUiPlugin.log(IStatus.ERROR,
- Messages.JSFFacetInstallPage_ErrorNoWebAppDataModel, e);
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#propertyChanged(org.eclipse.wst.common.frameworks.datamodel.DataModelEvent)
- */
- public void propertyChanged(DataModelEvent event) {
- if (webAppDataModel != null) {
- String propertyName = event.getPropertyName();
- if (propertyName
- .equals(IJ2EEModuleFacetInstallDataModelProperties.CONFIG_FOLDER)) {
- model.setStringProperty(WEBCONTENT_DIR, event.getProperty()
- .toString());
- }
- }
- super.propertyChanged(event);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#dispose()
- */
- public void dispose() {
- if (webAppDataModel != null)
- webAppDataModel.removeListener(this);
-
- jsfLibCfgComp.dispose();
- super.dispose();
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#restoreDefaultSettings()
- */
- protected void restoreDefaultSettings() {
- initializeValues();
-
- checkToCompletePage(jsfLibCfgComp);
- }
-
- /*
- * To force a JSF facet install page configuration to be performed
- * when the JSF facet is selected but no JSF implementation library exists.
- */
- private void checkToCompletePage(Composite control) {
- boolean enableFinish = false;
- IMPLEMENTATION_TYPE implType = (IMPLEMENTATION_TYPE)model.getProperty(IMPLEMENTATION_TYPE_PROPERTY_NAME);
- if (implType == IMPLEMENTATION_TYPE.SERVER_SUPPLIED)
- enableFinish = true;
- else if (implType == IMPLEMENTATION_TYPE.USER_SPECIFIED &&
- control != null && control instanceof JSFLibraryConfigControl) {
- enableFinish = (((JSFLibraryConfigControl)control).getSelectedJSFLibImplementation() != null);
- } //else must be unknown type and requires user interaction
- setPageComplete(enableFinish);
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#showValidationErrorsOnEnter()
- */
- protected boolean showValidationErrorsOnEnter() {
- return true;
- }
-
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TagRegistryView.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TagRegistryView.java
deleted file mode 100644
index 3ea5568ca..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TagRegistryView.java
+++ /dev/null
@@ -1,369 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.tagregistry;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.ITagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.core.jsfappconfig.JSFAppConfigUtils;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.TLDTagRegistry;
-import org.eclipse.jst.jsf.ui.internal.tagregistry.TaglibContentProvider.TreePlaceholder;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.DrillDownAdapter;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * This sample class demonstrates how to plug-in a new workbench view. The view
- * shows data obtained from the model. The sample creates a dummy model on the
- * fly, but a real implementation would connect to the model available either in
- * this or another plug-in (e.g. the workspace). The view is connected to the
- * model using a content provider.
- * <p>
- * The view uses a label provider to define how model objects should be
- * presented in the view. Each view can present the same model objects using
- * different labels and icons, if needed. Alternatively, a single label provider
- * can be shared between views in order to ensure that objects of the same type
- * are presented in the same way everywhere.
- * <p>
- */
-
-public class TagRegistryView extends ViewPart
-{
- private TreeViewer _viewer;
- private DrillDownAdapter drillDownAdapter;
- private Action _selectProjectAction;
- private Action action2;
- private Action doubleClickAction;
-
- class ViewLabelProvider extends LabelProvider
- {
-
- @Override
- public String getText(final Object obj)
- {
- if (obj instanceof Namespace)
- {
- if (((Namespace) obj).getDisplayName() != null)
- {
- return ((Namespace) obj).getDisplayName();
- }
- return ((Namespace) obj).getNSUri();
- }
- else if (obj instanceof ITagElement)
- {
- return ((ITagElement) obj).getName();
- }
- else if (obj instanceof TreePlaceholder)
- {
- return ((TreePlaceholder)obj).getText();
- }
- return obj.toString();
- }
-
- @Override
- public Image getImage(final Object obj)
- {
- final String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
- return PlatformUI.getWorkbench().getSharedImages().getImage(
- imageKey);
- }
- }
-
- class NameSorter extends ViewerSorter
- {
- // do nothing
- }
-
- /**
- * The constructor.
- */
- public TagRegistryView()
- {
- // do nothing
- }
-
- /**
- * This is a callback that will allow us to create the viewer and initialize
- * it.
- */
- @Override
- public void createPartControl(final Composite parent)
- {
- _viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL
- | SWT.V_SCROLL);
- drillDownAdapter = new DrillDownAdapter(_viewer);
- _viewer.setContentProvider(new TaglibContentProvider());
- _viewer.setLabelProvider(new ViewLabelProvider());
- _viewer.setSorter(new NameSorter());
-
- final IProject[] projects = ResourcesPlugin.getWorkspace().getRoot()
- .getProjects();
-
- for (final IProject project : projects)
- {
- if (project.isAccessible())
- {
- new SetInputRunnable(project, _viewer).run();
- break;
- }
- }
-
- // Create the help context id for the viewer's control
- PlatformUI.getWorkbench().getHelpSystem().setHelp(_viewer.getControl(),
- "ViewHandlerPrototype.viewer");
- makeActions();
- hookContextMenu();
- hookDoubleClickAction();
- contributeToActionBars();
- }
-
- private void hookContextMenu()
- {
- final MenuManager menuMgr = new MenuManager("#PopupMenu");
- menuMgr.setRemoveAllWhenShown(true);
- menuMgr.addMenuListener(new IMenuListener()
- {
- public void menuAboutToShow(final IMenuManager manager)
- {
- TagRegistryView.this.fillContextMenu(manager);
- }
- });
- final Menu menu = menuMgr.createContextMenu(_viewer.getControl());
- _viewer.getControl().setMenu(menu);
- getSite().registerContextMenu(menuMgr, _viewer);
- }
-
- private void contributeToActionBars()
- {
- final IActionBars bars = getViewSite().getActionBars();
- fillLocalPullDown(bars.getMenuManager());
- fillLocalToolBar(bars.getToolBarManager());
- }
-
- private void fillLocalPullDown(final IMenuManager manager)
- {
- manager.add(_selectProjectAction);
- manager.add(new Separator());
- manager.add(action2);
- }
-
- private void fillContextMenu(final IMenuManager manager)
- {
- manager.add(_selectProjectAction);
- manager.add(action2);
- manager.add(new Separator());
- drillDownAdapter.addNavigationActions(manager);
- // Other plug-ins can contribute there actions here
- manager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- private void fillLocalToolBar(final IToolBarManager manager)
- {
- manager.add(_selectProjectAction);
- manager.add(action2);
- manager.add(new Separator());
- drillDownAdapter.addNavigationActions(manager);
- }
-
- private void makeActions()
- {
- final IMenuCreator selectProjectCreator = new IMenuCreator()
- {
- private MenuManager createMenuMgr()
- {
- // TODO: this is inefficient but means we don't
- // have to do the laborious process of filtering
- // workspace changes.
- final MenuManager dropDownMenuMgr = new MenuManager();
-
- final IProject projects[] = ResourcesPlugin.getWorkspace()
- .getRoot().getProjects();
-
- for (final IProject project : projects)
- {
- if (JSFAppConfigUtils.isValidJSFProject(project))
- {
- dropDownMenuMgr.add(new Action(project.getName())
- {
- @Override
- public void run()
- {
- _viewer.setInput(project);
- }
- });
- }
- }
-
- return dropDownMenuMgr;
- }
-
- public void dispose()
- {
- // do nothing
- }
-
- public Menu getMenu(Control parent)
- {
- MenuManager manager = createMenuMgr();
- return manager.createContextMenu(parent);
- }
-
- public Menu getMenu(Menu parent)
- {
- final MenuManager manager = createMenuMgr();
- final Menu menu = new Menu(parent);
- final IContributionItem[] items = manager.getItems();
- for (final IContributionItem item : items)
- {
- IContributionItem newItem = item;
- if (item instanceof ActionContributionItem)
- {
- newItem = new ActionContributionItem(
- ((ActionContributionItem) item).getAction());
- }
- newItem.fill(menu, -1);
- }
- return menu;
- }
-
- };
-
- _selectProjectAction = new Action("Set project")
- {/* do nothing */};
- _selectProjectAction.setToolTipText("Action 1 tooltip");
- _selectProjectAction.setImageDescriptor(PlatformUI.getWorkbench()
- .getSharedImages().getImageDescriptor(
- ISharedImages.IMG_OBJS_INFO_TSK));
- _selectProjectAction.setMenuCreator(selectProjectCreator);
-
- action2 = new Action()
- {
- @Override
- public void run()
- {
- final Object input = _viewer.getInput();
-
- if (input instanceof IProject)
- {
- // FaceletTagRegistry.getRegistry((IProject)
- // input).refresh();
- TLDTagRegistry.getRegistry((IProject) input).refresh(
- new RefreshRunnable(_viewer));
- }
- }
- };
- action2.setText("Refresh Registry");
- action2.setToolTipText("Refresh Registry");
- action2.setImageDescriptor(PlatformUI.getWorkbench().getSharedImages()
- .getImageDescriptor(ISharedImages.IMG_OBJS_INFO_TSK));
- doubleClickAction = new Action()
- {
- @Override
- public void run()
- {
- final ISelection selection = _viewer.getSelection();
- final Object obj = ((IStructuredSelection) selection)
- .getFirstElement();
- showMessage("Double-click detected on " + obj.toString());
- }
- };
- }
-
- private void hookDoubleClickAction()
- {
- _viewer.addDoubleClickListener(new IDoubleClickListener()
- {
- public void doubleClick(final DoubleClickEvent event)
- {
- doubleClickAction.run();
- }
- });
- }
-
- private void showMessage(final String message)
- {
- MessageDialog.openInformation(_viewer.getControl().getShell(),
- "Sample View", message);
- }
-
- /**
- * Passing the focus request to the viewer's control.
- */
- @Override
- public void setFocus()
- {
- _viewer.getControl().setFocus();
- }
-
- private static class RefreshRunnable implements Runnable
- {
- private final Viewer _viewer;
-
- public RefreshRunnable(Viewer viewer)
- {
- super();
- _viewer = viewer;
- }
-
- public void run()
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- _viewer.refresh();
- }
- });
- }
-
- }
-
- private static class SetInputRunnable implements Runnable
- {
- private final Viewer _viewer;
- private final IProject _project;
-
- public SetInputRunnable(IProject project, Viewer viewer)
- {
- super();
- _project = project;
- _viewer = viewer;
- }
-
- public void run()
- {
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- _viewer.setInput(_project);
- }
- });
- }
- }
-} \ No newline at end of file
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TaglibContentProvider.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TaglibContentProvider.java
deleted file mode 100644
index 152f5e839..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/tagregistry/TaglibContentProvider.java
+++ /dev/null
@@ -1,341 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.tagregistry;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.concurrent.atomic.AtomicLong;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.IJSFTagElement;
-import org.eclipse.jst.jsf.common.runtime.internal.view.model.common.Namespace;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry.TagRegistryChangeEvent;
-import org.eclipse.jst.jsf.designtime.internal.view.model.ITagRegistry.TagRegistryChangeEvent.EventType;
-import org.eclipse.jst.jsf.designtime.internal.view.model.jsp.registry.TLDTagRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * Structured content provider for tag libraries.
- *
- * @author cbateman
- *
- */
-public class TaglibContentProvider implements IStructuredContentProvider,
- ITreeContentProvider, ITagRegistry.ITagRegistryListener
-{
- private final static Object[] NO_CHILDREN = new Object[0];
- private IProject _curInput;
- private ITagRegistry _curTagRegistry;
- private Viewer _curViewer;
- private final AtomicLong _changeStamp = new AtomicLong(0);
- private Map<String, Object> _rootNamespaces;
-
- public Object[] getElements(final Object inputElement)
- {
- if (inputElement instanceof IProject)
- {
- return _rootNamespaces.values().toArray();
- }
-
- return NO_CHILDREN;
- }
-
- public void dispose()
- {
- // nothing to do
- }
-
- public void inputChanged(final Viewer viewer, final Object oldInput,
- final Object newInput)
- {
- // update our change stamp to invalid outstanding update tasks
- _changeStamp.incrementAndGet();
- _curViewer = viewer;
-
- if (oldInput instanceof IProject)
- {
- if (_curTagRegistry != null)
- {
- _curTagRegistry.removeListener(this);
- }
- }
-
- if (newInput instanceof IProject)
- {
- _curTagRegistry = TLDTagRegistry.getRegistry((IProject) newInput);
- _curTagRegistry.addListener(this);
- _curInput = (IProject) newInput;
-
- _rootNamespaces = Collections
- .synchronizedMap(new HashMap<String, Object>());
- _rootNamespaces.put("not a uri", new TreePlaceholder("Calculating...", null));
-
- new UpdateNamespacesListJob(_curInput, _changeStamp.get())
- .schedule();
- }
- else
- {
- _curInput = null;
- _rootNamespaces = Collections.EMPTY_MAP;
- }
- }
-
- public Object[] getChildren(final Object parentElement)
- {
- if (parentElement instanceof IProject)
- {
- return _rootNamespaces.values().toArray();
- }
- else if (parentElement instanceof Namespace)
- {
- final Namespace ns = (Namespace) parentElement;
-
- // this could be very expensive if not initialized
- if (ns.isInitialized())
- {
- return ((Namespace) parentElement).getViewElements().toArray();
- }
-
- // fire up a job that ensures the namespace is initialized
- // and then fires refresh again on this element
- final Job updateNamespaceJob = new Job("Updating namespace")
- {
- @Override
- protected IStatus run(final IProgressMonitor monitor)
- {
- ns.getViewElements();
- PlatformUI.getWorkbench().getDisplay().asyncExec(
- new Runnable()
- {
- public void run()
- {
- // avoid infinite recursion
- if (ns.isInitialized())
- {
- TaglibContentProvider.this
- .viewerRefresh(ns);
- }
- else
- {
- MessageDialog
- .openError(
- Display
- .getCurrent()
- .getActiveShell(),
- "Error updating namespace",
- "There was a problem initializing the namespace");
- }
- }
- });
- return Status.OK_STATUS;
- }
- };
-
- updateNamespaceJob.schedule();
-
- return new Object[]
- { new TreePlaceholder("Calculating tags, please wait...", null) };
- }
- else if (parentElement instanceof IJSFTagElement)
- {
- return new Object[]
- { ((IJSFTagElement) parentElement).toString() };
- }
-
- return NO_CHILDREN;
- }
-
- public Object getParent(final Object element)
- {
- // no support for parent traversal right now
- return null;
- }
-
- public boolean hasChildren(final Object element)
- {
- // finding all children of a namespace can be expensive
- if (element instanceof Namespace)
- {
- return ((Namespace) element).hasViewElements();
- }
- return getChildren(element).length > 0;
- }
-
- public void registryChanged(final TagRegistryChangeEvent changeEvent)
- {
- if (_curViewer != null)
- {
- _curViewer.getControl().getDisplay().asyncExec(
- new RegistryChangeTask(changeEvent.getType(), changeEvent
- .getAffectedObjects(), _changeStamp.get()));
- }
- }
-
- private final class RegistryChangeTask implements Runnable
- {
- private final EventType _eventType;
- private final long _timestamp;
- private final List<? extends Namespace> _affectedObjects;
-
- RegistryChangeTask(final TagRegistryChangeEvent.EventType eventType,
- final List<? extends Namespace> affectedObjects,
- final long timestamp)
- {
- _eventType = eventType;
- _timestamp = timestamp;
- _affectedObjects = affectedObjects;
- }
-
- public void run()
- {
- // if changes have been made since this task was queued, then abort
- // since we don't know if our data is still valid
- if (_timestamp != TaglibContentProvider.this._changeStamp.get())
- {
- return;
- }
-
- switch (_eventType)
- {
- case ADDED_NAMESPACE:
- case CHANGED_NAMESPACE:
- {
- for (final Namespace ns : _affectedObjects)
- {
- _rootNamespaces.put(ns.getNSUri(), ns);
- }
-
- viewerRefresh(_curInput);
- }
- break;
-
- case REMOVED_NAMESPACE:
- {
- for (final Namespace ns : _affectedObjects)
- {
- _rootNamespaces.remove(ns.getNSUri());
- }
- viewerRefresh(_curInput);
- }
- break;
-
- case REGISTRY_DISPOSED:
- {
- _curTagRegistry.removeListener(TaglibContentProvider.this);
- // nullify the input since the current project is no longer
- // valid
- _curViewer.setInput(null);
- }
- }
- }
- }
-
- private void viewerRefresh(final Object parentElement)
- {
- if (_curViewer instanceof StructuredViewer)
- {
- final StructuredViewer viewer = (StructuredViewer) _curViewer;
- viewer.refresh(parentElement);
- }
- else
- {
- _curViewer.refresh();
- }
- }
-
- private class UpdateNamespacesListJob extends Job
- {
-
- private final long _timestamp;
- private final IProject _project;
-
- public UpdateNamespacesListJob(final IProject project,
- final long timestamp)
- {
- super("Updating available namespaces for project "
- + project.getName());
- _project = project;
- _timestamp = timestamp;
- }
-
- @Override
- protected IStatus run(final IProgressMonitor monitor)
- {
- if (!_project.isAccessible())
- {
- return new Status(IStatus.CANCEL, "", "");
- }
-
- final Collection<? extends Namespace> libs = TLDTagRegistry
- .getRegistry(_project).getAllTagLibraries();
- _rootNamespaces.clear();
-
- for (Namespace ns : libs)
- {
- _rootNamespaces.put(ns.getNSUri(), ns);
- }
-
- PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable()
- {
- public void run()
- {
- // only bother if the provider hasn't changed asynchronously
- if (_timestamp == TaglibContentProvider.this._changeStamp
- .get())
- {
- viewerRefresh(_curInput);
- }
- }
- });
-
- return Status.OK_STATUS;
- }
- }
-
- /**
- * Takes the place of a real tree model object while the real object is
- * being retrieved.
- *
- */
- public static class TreePlaceholder
- {
- private final String _text;
- private final Image _image;
-
- TreePlaceholder(final String text, final Image image)
- {
- _text = text;
- _image = image;
- }
-
- /**
- * @return the placeholder text or null if none
- */
- public String getText()
- {
- return _text;
- }
-
- /**
- * @return the image or null if none
- */
- public Image getImage()
- {
- return _image;
- }
-
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ELPrefPanel.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ELPrefPanel.java
deleted file mode 100644
index 261413c96..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ELPrefPanel.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.jst.jsf.ui.internal.Messages;
-import org.eclipse.jst.jsf.validation.internal.ELValidationPreferences;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-
-/**
- * Creates and manages a panel for configuring
- *
- * @author cbateman
- */
-/*package*/ class ELPrefPanel
-{
- /* view */
- private final Group _container;
- private final Button _chkBuildValidation;
- private final Button _chkIncrementalValidation;
- private final ProblemSeveritiesConfigurationBlock _problemSeverities;
-
- /* model */
- private ELValidationPreferences _prefs;
-
- /**
- * Allocates new container in parent.
- * @param parent
- * @param container
- * @param prefs
- */
- public ELPrefPanel(Composite parent, IWorkbenchPreferenceContainer container, ELValidationPreferences prefs)
- {
- _prefs = prefs;
-
- _container = new Group(parent, SWT.NONE);
- _container.setText(Messages.JSFValidationPreferencePage_ELPrefPanel_Title);
- RowLayout rowLayout = new RowLayout(SWT.VERTICAL);
- rowLayout.marginTop = 5;
- rowLayout.marginLeft = 5;
- _container.setLayout(rowLayout);
-
- _chkBuildValidation = new Button(_container, SWT.CHECK);
- _chkBuildValidation.setText(Messages.JSFValidationPreferencePage_ELPrefPanel_BuildValidationCheckBoxTitle);
- _chkBuildValidation.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- _prefs.setEnableBuildValidation(_chkBuildValidation.getSelection());
- refresh();
- }
- });
-
- _chkIncrementalValidation = new Button(_container, SWT.CHECK);
- _chkIncrementalValidation.setText(Messages.JSFValidationPreferencePage_ELPrefPanel_IncrementalValidationCheckBoxTitle);
- _chkIncrementalValidation.addSelectionListener(new SelectionAdapter()
- {
- public void widgetSelected(SelectionEvent e)
- {
- _prefs.setEnableIncrementalValidation(_chkIncrementalValidation.getSelection());
- refresh();
- }
- });
-
- new Label(_container, SWT.NONE);
-
- _problemSeverities = new ProblemSeveritiesConfigurationBlock(prefs, null, container);
- _problemSeverities.createContents(_container);
- }
-
- /**
- * @return the top-level container managed by this panel
- */
- public Control getControl()
- {
- return _container;
- }
-
-
- /**
- * Refreshes the UI from the model
- */
- public void refresh()
- {
- _chkBuildValidation.setSelection(_prefs.isEnableBuildValidation());
- _chkIncrementalValidation.
- setSelection(_prefs.isEnableIncrementalValidation());
- _problemSeverities.updateControls();
- }
-
- /**
- *
- */
- public void processChanges() {
- _problemSeverities.performOk();
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidationPreferencePage.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidationPreferencePage.java
deleted file mode 100644
index a003a5873..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidationPreferencePage.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-
-/**
- * Workbench preference page for configuring JSF validation
- *
- * @author cbateman
- *
- */
-public class JSFValidationPreferencePage extends PreferencePage implements
- IWorkbenchPreferencePage
-{
- private final ValidationPreferences _prefs;
-
- private ELPrefPanel _elPrefPanel;
-
- /**
- * Constructor
- */
- public JSFValidationPreferencePage()
- {
- super(/* TODO: title*/);
- _prefs = new ValidationPreferences(getPreferenceStore());
- _prefs.load();
- }
-
- protected Control createContents(Composite parent)
- {
- _elPrefPanel = new ELPrefPanel(parent, (IWorkbenchPreferenceContainer) getContainer(), _prefs.getElPrefs());
- _elPrefPanel.refresh();
- return _elPrefPanel.getControl();
- }
-
- public void init(IWorkbench workbench)
- {
- // do nothing
- }
-
- protected void performApply()
- {
- // process changes before committing to pref store
- _elPrefPanel.processChanges();
- _prefs.commit(getPreferenceStore());
- }
-
- protected void performDefaults()
- {
- _prefs.setDefaults();
- _elPrefPanel.refresh();
- super.performDefaults();
- }
-
- public boolean performOk()
- {
- performApply();
- return true;
- }
-
- protected IPreferenceStore doGetPreferenceStore()
- {
- // load the validation pref store
- return JSFCorePlugin.getDefault().getPreferenceStore();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidator.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidator.java
deleted file mode 100644
index 42b0ecd70..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/JSFValidator.java
+++ /dev/null
@@ -1,128 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator;
-import org.eclipse.jst.jsf.validation.internal.JSFValidatorFactory;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.jst.jsp.core.internal.validation.JSPValidator;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidationContext;
-
-/**
- * @author cbateman
- *
- */
-public class JSFValidator extends JSPValidator implements ISourceValidator
-{
- // TODO: should the source validator be a separate class in jsp.ui?
- // problem with simple split off is that preference must also be split off
- static final boolean DEBUG;
- static
- {
- final String value = Platform
- .getDebugOption("org.eclipse.jst.jsf.ui/validation"); //$NON-NLS-1$
- DEBUG = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- private IDocument fDocument;
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#connect(org.eclipse.jface.text.IDocument)
- */
- public void connect(final IDocument document)
- {
- fDocument = document;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#disconnect(org.eclipse.jface.text.IDocument)
- */
- public void disconnect(final IDocument document)
- {
- // finished
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.wst.sse.ui.internal.reconcile.validator.ISourceValidator#validate(org.eclipse.jface.text.IRegion,
- * org.eclipse.wst.validation.internal.provisional.core.IValidationContext,
- * org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- public void validate(final IRegion dirtyRegion,
- final IValidationContext helper, final IReporter reporter)
- {
- if (DEBUG)
- {
- System.out.println("exec JSPSemanticsValidator.validateRegion");
- }
-
- final IFile file = getFile(helper);
-
- if (fDocument instanceof IStructuredDocument)
- {
- final IStructuredDocument sDoc = (IStructuredDocument) fDocument;
- final IStructuredDocumentRegion[] regions = sDoc
- .getStructuredDocumentRegions(dirtyRegion.getOffset(),
- dirtyRegion.getLength());
- if (regions != null)
- {
- final IJSFViewValidator validator = JSFValidatorFactory
- .createDefaultXMLValidator();
- final ValidationPreferences prefs = new ValidationPreferences(
- JSFCorePlugin.getDefault().getPreferenceStore());
- prefs.load();
-
- final ValidationReporter jsfReporter = new ValidationReporter(
- this, reporter, file, prefs);
- validator.validateView(file, regions, jsfReporter);
- }
- }
- }
-
- private IFile getFile(final IValidationContext helper)
- {
- final String[] uris = helper.getURIs();
- final IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
- if (uris.length > 0)
- {
- return wsRoot.getFile(new Path(uris[0]));
- }
- return null;
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jst.jsp.core.internal.validation.JSPValidator#validateFile(org.eclipse.core.resources.IFile,
- * org.eclipse.wst.validation.internal.provisional.core.IReporter)
- */
- @Override
- protected void validateFile(final IFile file, final IReporter reporter)
- {
- final IJSFViewValidator validator = JSFValidatorFactory
- .createDefaultXMLValidator();
- final ValidationPreferences prefs = new ValidationPreferences(
- JSFCorePlugin.getDefault().getPreferenceStore());
- prefs.load();
-
- final ValidationReporter jsfReporter = new ValidationReporter(this,
- reporter, file, prefs);
- validator.validateView(file, jsfReporter);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/MyLocalizedMessage.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/MyLocalizedMessage.java
deleted file mode 100644
index f479a0f53..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/MyLocalizedMessage.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import java.util.Locale;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.wst.validation.internal.core.Message;
-
-/**
- * EL customized localizable validation message
- * @author cbateman
- *
- */
-class MyLocalizedMessage extends Message
-{
- private final String _message;
- private final int _errorCode;
-
- /**
- * @param severity
- * @param messageText
- * @param targetObject
- * @param errorCode
- */
- public MyLocalizedMessage(int severity, String messageText, IResource targetObject, int errorCode) {
- this(severity, messageText, (Object) targetObject, errorCode);
- }
-
- /**
- * @param severity
- * @param messageText
- * @param targetObject
- * @param errorCode
- */
- private MyLocalizedMessage(int severity, String messageText, Object targetObject, int errorCode) {
- super(JSFCorePlugin.getDefault().getBundle().getSymbolicName(), severity,
- messageText);
- _message = messageText;
- setTargetObject(targetObject);
- _errorCode = errorCode;
- }
-
- /**
- * @return the localized message
- */
- public String getLocalizedMessage() {
- return _message;
- }
-
- /**
- * @see org.eclipse.wst.validation.internal.core.Message#getText()
- */
- public String getText() {
- return getLocalizedMessage();
- }
-
- /**
- * @see org.eclipse.wst.validation.internal.core.Message#getText(java.lang.ClassLoader)
- */
- public String getText(ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- /**
- * @see org.eclipse.wst.validation.internal.core.Message#getText(java.util.Locale)
- */
- public String getText(Locale l) {
- return getLocalizedMessage();
- }
-
- public String getText(Locale l, ClassLoader cl) {
- return getLocalizedMessage();
- }
-
- /**
- * @return the error code related to this message
- */
- public int getErrorCode() {
- return _errorCode;
- }
-
-
- /**
- * @param offset
- * @return true if this message applies to document offset
- */
- public boolean appliesTo(int offset)
- {
- return (offset >= getOffset() && offset < getOffset()+getLength());
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/OptionsConfigurationBlock.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/OptionsConfigurationBlock.java
deleted file mode 100644
index f26a66055..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/OptionsConfigurationBlock.java
+++ /dev/null
@@ -1,979 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Cameron Bateman/Oracle - adapted for use in JSF validation tooling
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.IdentityHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ProjectScope;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.preferences.DefaultScope;
-import org.eclipse.core.runtime.preferences.IScopeContext;
-import org.eclipse.core.runtime.preferences.InstanceScope;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.MessageDialogWithToggle;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel;
-import org.eclipse.jst.jsf.core.internal.JSFCorePlugin;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.validation.internal.ELValidationPreferences.Severity;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-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.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Widget;
-import org.eclipse.ui.forms.events.ExpansionAdapter;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.ui.preferences.IWorkingCopyManager;
-import org.eclipse.ui.preferences.WorkingCopyManager;
-import org.osgi.service.prefs.BackingStoreException;
-
-/**
- * Abstract options configuration block providing a general implementation for setting up
- * an options configuration page.
- *
- * @since 2.1
- */
-abstract class OptionsConfigurationBlock
-{
- /**
- * The preference model to be used
- */
- protected final IJSFPreferenceModel _prefs;
-
- static final class Key
- {
- private String fQualifier;
- private String fKey;
-
- Key(String qualifier, String key) {
- fQualifier= qualifier;
- fKey= key;
- }
-
- /**
- * @return the key name
- */
- public String getName() {
- return fKey;
- }
-
-// private IEclipsePreferences getNode(IScopeContext context, IWorkingCopyManager manager) {
-// IEclipsePreferences node= context.getNode(fQualifier);
-// if (manager != null) {
-// return manager.getWorkingCopy(node);
-// }
-// return node;
-//
-// }
-
- /**
- * @param prefModel
- * @param context
- * @param manager
- * @return the value stored for the key
- */
- public Object getStoredValue(IJSFPreferenceModel prefModel, IScopeContext context, IWorkingCopyManager manager)
- {
- return prefModel.getStoredValueByKey(context, fKey);
- }
-
- /**
- * @param prefModel
- * @param context
- * @param manager
- * @return the stored value in prefModel under context for
- * this key
- */
- public Object getCurValue(IJSFPreferenceModel prefModel, IScopeContext context, IWorkingCopyManager manager) {
- //return getNode(context, manager).get(fKey, null);
- return prefModel.getValueByKey(context, fKey);
- }
-
- /**
- * @param prefModel
- * @param lookupOrder
- * @param ignoreTopScope
- * @param manager
- * @return the stored value in the prefModelunder context
- * using the list of lookupOrder for precedence of scopes
- * in which to look. Return first found based on order in lookupOrder
- */
- public Object getCurValue(IJSFPreferenceModel prefModel, IScopeContext[] lookupOrder, boolean ignoreTopScope, IWorkingCopyManager manager) {
- for (int i= ignoreTopScope ? 1 : 0; i < lookupOrder.length; i++) {
- Object value= getCurValue(prefModel, lookupOrder[i], manager);
- if (value != null) {
- return value;
- }
- }
- return null;
- }
-
- /**
- * Set the stored value
- * @param prefModel
- * @param context
- * @param value
- * @param manager
- * @return the old value or null if none
- */
- public Object setCurValue(IJSFPreferenceModel prefModel, IScopeContext context, Object value, IWorkingCopyManager manager) {
- return prefModel.setValueByKey(context, fKey, value);
-// if (value != null) {
-// getNode(context, manager).put(fKey, value);
-// } else {
-// getNode(context, manager).remove(fKey);
-// }
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return fQualifier + '/' + fKey;
- }
-
- /**
- * @return the plugin qualifier
- */
- public String getQualifier() {
- return fQualifier;
- }
-
- }
-
-
- static class ControlData {
- private Key fKey;
- private String[] fValues;
-
- ControlData(Key key, String[] values) {
- fKey= key;
- fValues= values;
- }
-
- Key getKey() {
- return fKey;
- }
-
- String getValue(boolean selection) {
- int index= selection ? 0 : 1;
- return fValues[index];
- }
-
- String getValue(int index) {
- return fValues[index];
- }
-
- int getSelection(String value) {
- if (value != null) {
- for (int i= 0; i < fValues.length; i++) {
- if (value.equals(fValues[i])) {
- return i;
- }
- }
- }
- return fValues.length -1; // assume the last option is the least severe
- }
- }
-
- private static final String REBUILD_COUNT_KEY= "preferences_build_requested"; //$NON-NLS-1$
-
- private static final String SETTINGS_EXPANDED= "expanded"; //$NON-NLS-1$
-
- private final ArrayList fCheckBoxes;
- private final ArrayList fComboBoxes;
- private final ArrayList fTextBoxes;
- private final HashMap fLabels;
- private final ArrayList fExpandedComposites;
-
- private SelectionListener fSelectionListener;
- private ModifyListener fTextModifyListener;
-
- // TODO: protected IStatusChangeListener fContext;
- private final IProject fProject; // project or null
- private final Key[] fAllKeys;
-
- private IScopeContext[] fLookupOrder;
-
- private Shell fShell;
-
- private final IWorkingCopyManager fManager;
- private IWorkbenchPreferenceContainer fContainer;
-
- private Map fDisabledProjectSettings; // null when project specific settings are turned off
-
- private int fRebuildCount; /// used to prevent multiple dialogs that ask for a rebuild
-
- OptionsConfigurationBlock(/*IStatusChangeListener context,*/IJSFPreferenceModel prefs, IProject project, Key[] allKeys, IWorkbenchPreferenceContainer container) {
- //fContext= context;
- fProject= project;
- fAllKeys= allKeys;
- fContainer= container;
- _prefs = prefs;
-
- if (container == null) {
- fManager= new WorkingCopyManager();
- } else {
- fManager= container.getWorkingCopyManager();
- }
-
- if (fProject != null) {
- fLookupOrder= new IScopeContext[] {
- new ProjectScope(fProject),
- new InstanceScope(),
- new DefaultScope()
- };
- } else {
- fLookupOrder= new IScopeContext[] {
- new InstanceScope(),
- new DefaultScope()
- };
- }
-
- testIfOptionsComplete(allKeys);
- if (fProject == null || hasProjectSpecificOptions(fProject)) {
- fDisabledProjectSettings= null;
- } else {
- fDisabledProjectSettings= new IdentityHashMap();
- for (int i= 0; i < allKeys.length; i++) {
- Key curr= allKeys[i];
- fDisabledProjectSettings.put(curr, curr.getCurValue(_prefs, fLookupOrder, false, fManager));
- }
- }
-
- fCheckBoxes= new ArrayList();
- fComboBoxes= new ArrayList();
- fTextBoxes= new ArrayList(2);
- fLabels= new HashMap();
- fExpandedComposites= new ArrayList();
-
- fRebuildCount= getRebuildCount();
- }
-
- /**
- * @return the preference container
- */
- protected final IWorkbenchPreferenceContainer getPreferenceContainer() {
- return fContainer;
- }
-
- /**
- * @param plugin
- * @param key
- * @return construct a new Key based on the on the plugin id and
- * preference key
- */
- protected static Key getKey(String plugin, String key) {
- return new Key(plugin, key);
- }
-
- /**
- * @param key
- * @return construct a new Key for a JSF core plugin preference
- */
- protected final static Key getJSFCoreKey(String key) {
- return getKey(JSFCorePlugin.PLUGIN_ID, key);
- }
-
- private void testIfOptionsComplete(Key[] allKeys) {
- for (int i= 0; i < allKeys.length; i++) {
- if (allKeys[i].getCurValue(_prefs, fLookupOrder, false, fManager) == null) {
- JSFUiPlugin.log(IStatus.ERROR, "preference option missing: " + allKeys[i] + " (" + this.getClass().getName() +')'); //$NON-NLS-1$//$NON-NLS-2$
- }
- }
- }
-
- private int getRebuildCount() {
- return fManager.getWorkingCopy(new DefaultScope().getNode(JavaUI.ID_PLUGIN)).getInt(REBUILD_COUNT_KEY, 0);
- }
-
- private void incrementRebuildCount() {
- fRebuildCount++;
- fManager.getWorkingCopy(new DefaultScope().getNode(JavaUI.ID_PLUGIN)).putInt(REBUILD_COUNT_KEY, fRebuildCount);
- }
-
-// public void selectOption(String key, String qualifier) {
-// for (int i= 0; i < fAllKeys.length; i++) {
-// Key curr= fAllKeys[i];
-// if (curr.getName().equals(key) && curr.getQualifier().equals(qualifier)) {
-// selectOption(curr);
-// }
-// }
-// }
-//
-// public void selectOption(Key key) {
-// Control control= findControl(key);
-// if (control != null) {
-// if (!fExpandedComposites.isEmpty()) {
-// ExpandableComposite expandable= getParentExpandableComposite(control);
-// if (expandable != null) {
-// for (int i= 0; i < fExpandedComposites.size(); i++) {
-// ExpandableComposite curr= (ExpandableComposite) fExpandedComposites.get(i);
-// curr.setExpanded(curr == expandable);
-// }
-// expandedStateChanged(expandable);
-// }
-// }
-// control.setFocus();
-// }
-// }
-
-
- /**
- * @param project
- * @return true if there are project specific overrides in the
- * preferences for 'project'
- */
- public final boolean hasProjectSpecificOptions(IProject project) {
- if (project != null) {
- IScopeContext projectContext= new ProjectScope(project);
- Key[] allKeys= fAllKeys;
- for (int i= 0; i < allKeys.length; i++) {
- if (allKeys[i].getCurValue(_prefs, projectContext, fManager) != null) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * @return the shell hosting the UI
- */
- protected Shell getShell() {
- return fShell;
- }
-
- /**
- * Set the shell hosting the UI.
- * @param shell
- */
- protected void setShell(Shell shell) {
- fShell= shell;
- }
-
- /**
- * @param parent
- * @return the parent of the UI control to be created
- */
- protected abstract Control createContents(Composite parent);
-
-// protected Button addCheckBox(Composite parent, String label, Key key, String[] values, int indent) {
-// ControlData data= new ControlData(key, values);
-//
-// GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-// gd.horizontalSpan= 3;
-// gd.horizontalIndent= indent;
-//
-// Button checkBox= new Button(parent, SWT.CHECK);
-// checkBox.setFont(JFaceResources.getDialogFont());
-// checkBox.setText(label);
-// checkBox.setData(data);
-// checkBox.setLayoutData(gd);
-// checkBox.addSelectionListener(getSelectionListener());
-//
-// makeScrollableCompositeAware(checkBox);
-//
-// String currValue= getValue(key);
-// checkBox.setSelection(data.getSelection(currValue) == 0);
-//
-// fCheckBoxes.add(checkBox);
-//
-// return checkBox;
-// }
-
- /**
- * @param parent
- * @param label
- * @param key
- * @param values
- * @param indent
- * @param widthHint
- * @param listener
- * @return a check box styled button with a related link
- */
- protected Button addCheckBoxWithLink(Composite parent, String label, Key key, String[] values, int indent, int widthHint, SelectionListener listener) {
- ControlData data= new ControlData(key, values);
-
- GridData gd= new GridData(GridData.FILL, GridData.FILL, true, false);
- gd.horizontalSpan= 3;
- gd.horizontalIndent= indent;
-
- Composite composite= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- composite.setLayout(layout);
- composite.setLayoutData(gd);
-
- Button checkBox= new Button(composite, SWT.CHECK);
- checkBox.setFont(JFaceResources.getDialogFont());
- checkBox.setData(data);
- checkBox.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
- checkBox.addSelectionListener(getSelectionListener());
-
- gd= new GridData(GridData.FILL, GridData.CENTER, true, false);
- gd.widthHint= widthHint;
-
- Link link= new Link(composite, SWT.NONE);
- link.setText(label);
- link.setLayoutData(gd);
- if (listener != null) {
- link.addSelectionListener(listener);
- }
-
- makeScrollableCompositeAware(link);
- makeScrollableCompositeAware(checkBox);
-
- String currValue= getValue(key);
- checkBox.setSelection(data.getSelection(currValue) == 0);
-
- fCheckBoxes.add(checkBox);
-
- return checkBox;
- }
-
- /**
- * @param parent
- * @param label
- * @param key
- * @param values
- * @param valueLabels
- * @param indent
- * @return a Combo box added to parent with the label and key
- */
- protected Combo addComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels, int indent) {
- GridData gd= new GridData(GridData.FILL, GridData.CENTER, true, false, 2, 1);
- gd.horizontalIndent= indent;
-
- Label labelControl= new Label(parent, SWT.LEFT);
- labelControl.setFont(JFaceResources.getDialogFont());
-
- labelControl.setText(label);
- labelControl.setLayoutData(gd);
-
- Combo comboBox= newComboControl(parent, key, values, valueLabels);
- comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- fLabels.put(comboBox, labelControl);
-
- return comboBox;
- }
-
- Combo addInversedComboBox(Composite parent, String label, Key key, String[] values, String[] valueLabels, int indent) {
- GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- gd.horizontalIndent= indent;
- gd.horizontalSpan= 3;
-
- Composite composite= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- layout.numColumns= 2;
- composite.setLayout(layout);
- composite.setLayoutData(gd);
-
- Combo comboBox= newComboControl(composite, key, values, valueLabels);
- comboBox.setFont(JFaceResources.getDialogFont());
- comboBox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
-
- Label labelControl= new Label(composite, SWT.LEFT | SWT.WRAP);
- labelControl.setText(label);
- labelControl.setLayoutData(new GridData());
-
- fLabels.put(comboBox, labelControl);
- return comboBox;
- }
-
- Combo newComboControl(Composite composite, Key key, String[] values, String[] valueLabels) {
- ControlData data= new ControlData(key, values);
-
- Combo comboBox= new Combo(composite, SWT.READ_ONLY);
- comboBox.setItems(valueLabels);
- comboBox.setData(data);
- comboBox.addSelectionListener(getSelectionListener());
- comboBox.setFont(JFaceResources.getDialogFont());
-
- makeScrollableCompositeAware(comboBox);
-
- String currValue= getValue(key);
- comboBox.select(data.getSelection(currValue));
-
- fComboBoxes.add(comboBox);
- return comboBox;
- }
-
- Text addTextField(Composite parent, String label, Key key, int indent, int widthHint) {
- Label labelControl= new Label(parent, SWT.WRAP);
- labelControl.setText(label);
- labelControl.setFont(JFaceResources.getDialogFont());
- labelControl.setLayoutData(new GridData());
-
- Text textBox= new Text(parent, SWT.BORDER | SWT.SINGLE);
- textBox.setData(key);
- textBox.setLayoutData(new GridData());
-
- makeScrollableCompositeAware(textBox);
-
- fLabels.put(textBox, labelControl);
-
- String currValue= getValue(key);
- if (currValue != null) {
- textBox.setText(currValue);
- }
- textBox.addModifyListener(getTextModifyListener());
-
- GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- if (widthHint != 0) {
- data.widthHint= widthHint;
- }
- data.horizontalIndent= indent;
- data.horizontalSpan= 2;
- textBox.setLayoutData(data);
-
- fTextBoxes.add(textBox);
- return textBox;
- }
-
- ScrolledPageContent getParentScrolledComposite(Control control) {
- Control parent= control.getParent();
- while (!(parent instanceof ScrolledPageContent) && parent != null) {
- parent= parent.getParent();
- }
- if (parent instanceof ScrolledPageContent) {
- return (ScrolledPageContent) parent;
- }
- return null;
- }
-
- ExpandableComposite getParentExpandableComposite(Control control) {
- Control parent= control.getParent();
- while (!(parent instanceof ExpandableComposite) && parent != null) {
- parent= parent.getParent();
- }
- if (parent instanceof ExpandableComposite) {
- return (ExpandableComposite) parent;
- }
- return null;
- }
-
- private void makeScrollableCompositeAware(Control control) {
- ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(control);
- if (parentScrolledComposite != null) {
- parentScrolledComposite.adaptChild(control);
- }
- }
-
- ExpandableComposite createStyleSection(Composite parent, String label, int nColumns) {
- ExpandableComposite excomposite= new ExpandableComposite(parent, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);
- excomposite.setText(label);
- excomposite.setExpanded(false);
- excomposite.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- excomposite.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, nColumns, 1));
- excomposite.addExpansionListener(new ExpansionAdapter() {
- public void expansionStateChanged(ExpansionEvent e) {
- expandedStateChanged((ExpandableComposite) e.getSource());
- }
- });
- fExpandedComposites.add(excomposite);
- makeScrollableCompositeAware(excomposite);
- return excomposite;
- }
-
- final void expandedStateChanged(ExpandableComposite expandable) {
- ScrolledPageContent parentScrolledComposite= getParentScrolledComposite(expandable);
- if (parentScrolledComposite != null) {
- parentScrolledComposite.reflow(true);
- }
- }
-
- void restoreSectionExpansionStates(IDialogSettings settings) {
- for (int i= 0; i < fExpandedComposites.size(); i++) {
- ExpandableComposite excomposite= (ExpandableComposite) fExpandedComposites.get(i);
- if (settings == null) {
- excomposite.setExpanded(i == 0); // only expand the first node by default
- } else {
- excomposite.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + String.valueOf(i)));
- }
- }
- }
-
- void storeSectionExpansionStates(IDialogSettings settings) {
- for (int i= 0; i < fExpandedComposites.size(); i++) {
- ExpandableComposite curr= (ExpandableComposite) fExpandedComposites.get(i);
- settings.put(SETTINGS_EXPANDED + String.valueOf(i), curr.isExpanded());
- }
- }
-
- SelectionListener getSelectionListener() {
- if (fSelectionListener == null) {
- fSelectionListener= new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {/*do nothing*/}
-
- public void widgetSelected(SelectionEvent e) {
- controlChanged(e.widget);
- }
- };
- }
- return fSelectionListener;
- }
-
- ModifyListener getTextModifyListener() {
- if (fTextModifyListener == null) {
- fTextModifyListener= new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- textChanged((Text) e.widget);
- }
- };
- }
- return fTextModifyListener;
- }
-
- void controlChanged(Widget widget) {
- ControlData data= (ControlData) widget.getData();
- String newValue= null;
- if (widget instanceof Button) {
- newValue= data.getValue(((Button)widget).getSelection());
- } else if (widget instanceof Combo) {
- newValue= data.getValue(((Combo)widget).getSelectionIndex());
- } else {
- return;
- }
- String oldValue= setValue(data.getKey(), newValue);
- validateSettings(data.getKey(), oldValue, newValue);
- }
-
- void textChanged(Text textControl) {
- Key key= (Key) textControl.getData();
- String number= textControl.getText();
- String oldValue= setValue(key, number);
- validateSettings(key, oldValue, number);
- }
-
- boolean checkValue(Key key, String value) {
- return value.equals(getValue(key));
- }
-
- String getValue(Key key) {
- if (fDisabledProjectSettings != null) {
- return (String) fDisabledProjectSettings.get(key);
- }
- return key.getCurValue(_prefs, fLookupOrder, false, fManager).toString();
- }
-
-
- boolean getBooleanValue(Key key) {
- return Boolean.valueOf(getValue(key)).booleanValue();
- }
-
- String setValue(Key key, String value) {
- if (fDisabledProjectSettings != null) {
- return (String) fDisabledProjectSettings.put(key, value);
- }
- Object newValue = key.setCurValue(_prefs, fLookupOrder[0], Severity.valueOfString(value), fManager);
- return newValue != null ? newValue.toString() : "";
- }
-
- String setValue(Key key, boolean value) {
- return setValue(key, String.valueOf(value));
- }
-
- /**
- * Returns the value as actually stored in the preference store.
- * @param key
- * @return the value as actually stored in the preference store.
- */
- Object getStoredValue(Key key) {
- return key.getCurValue(_prefs, fLookupOrder, false, fManager);
- }
-
- /**
- * Update fields and validate.
- * @param changedKey Key that changed, or null, if all changed.
- * @param oldValue
- * @param newValue
- */
- protected abstract void validateSettings(Key changedKey, String oldValue, String newValue);
-
-
- String[] getTokens(String text, String separator) {
- StringTokenizer tok= new StringTokenizer(text, separator);
- int nTokens= tok.countTokens();
- String[] res= new String[nTokens];
- for (int i= 0; i < res.length; i++) {
- res[i]= tok.nextToken().trim();
- }
- return res;
- }
-
- private boolean getChanges(IScopeContext currContext, List changedSettings) {
- boolean needsBuild= false;
- for (int i= 0; i < fAllKeys.length; i++) {
- Key key= fAllKeys[i];
- Object oldVal= key.getStoredValue(_prefs, currContext, null);
- Object val= key.getCurValue(_prefs, currContext, fManager);
- if (val == null) {
- if (oldVal != null) {
- changedSettings.add(key);
- needsBuild |= !oldVal.equals(key.getCurValue(_prefs, fLookupOrder, true, fManager));
- }
- } else if (!val.equals(oldVal)) {
- changedSettings.add(key);
- needsBuild |= oldVal != null || !val.equals(key.getCurValue(_prefs, fLookupOrder, true, fManager));
- }
- }
- return needsBuild;
- }
-
- void useProjectSpecificSettings(boolean enable) {
- boolean hasProjectSpecificOption= fDisabledProjectSettings == null;
- if (enable != hasProjectSpecificOption && fProject != null) {
- if (enable) {
- for (int i= 0; i < fAllKeys.length; i++) {
- Key curr= fAllKeys[i];
- String val= (String) fDisabledProjectSettings.get(curr);
- curr.setCurValue(_prefs, fLookupOrder[0], Severity.valueOfString(val), fManager);
- }
- fDisabledProjectSettings= null;
- updateControls();
- validateSettings(null, null, null);
- } else {
- fDisabledProjectSettings= new IdentityHashMap();
- for (int i= 0; i < fAllKeys.length; i++) {
- Key curr= fAllKeys[i];
- Object oldSetting= curr.getCurValue(_prefs, fLookupOrder, false, fManager);
- fDisabledProjectSettings.put(curr, oldSetting);
- curr.setCurValue(_prefs, fLookupOrder[0], null, fManager); // clear project settings
- }
- }
- }
- }
-
- boolean areSettingsEnabled() {
- return fDisabledProjectSettings == null || fProject == null;
- }
-
-
- boolean performOk() {
- return processChanges(fContainer);
- }
-
-// public boolean performApply() {
-// return processChanges(null); // apply directly
-// }
-
- boolean processChanges(IWorkbenchPreferenceContainer container) {
- IScopeContext currContext= fLookupOrder[0];
-
- List /* <Key>*/ changedOptions= new ArrayList();
- boolean needsBuild= getChanges(currContext, changedOptions);
- if (changedOptions.isEmpty()) {
- return true;
- }
- if (needsBuild) {
- int count= getRebuildCount();
- if (count > fRebuildCount) {
- needsBuild= false; // build already requested
- fRebuildCount= count;
- }
- }
-
- boolean doBuild= false;
-
- final String showBuildWarningKey = JSFCorePlugin.PLUGIN_ID + "." + "buildwarning_dont_show_again";
- final IPreferenceStore prefStore = JSFCorePlugin.getDefault().getPreferenceStore();
- final boolean showDialog = !MessageDialogWithToggle.ALWAYS.equals(prefStore.getString(showBuildWarningKey));
-
- if (needsBuild && showDialog) {
- String[] strings= getFullBuildDialogStrings(fProject == null);
- if (strings != null) {
- MessageDialogWithToggle.openInformation
- (getShell(), strings[0], strings[1],
- PreferencesMessages.ProblemSeveritiesConfigurationBlock_buildwarning_dont_show_again
- , false, prefStore, showBuildWarningKey);
-// int res= dialog.open();
-// if (res == 0) {
-// doBuild= true;
-// } else if (res != 1) {
-// return false; // cancel pressed
-// }
- }
- }
- if (container != null) {
- // no need to apply the changes to the original store: will be done by the page container
- if (doBuild) { // post build
- incrementRebuildCount();
- // TODO: container.registerUpdateJob(CoreUtility.getBuildJob(fProject));
- }
- } else {
- // apply changes right away
- try {
- fManager.applyChanges();
- } catch (BackingStoreException e) {
- JSFUiPlugin.log(IStatus.ERROR, "Error applying changes", e);
- return false;
- }
- if (doBuild) {
- //CoreUtility.getBuildJob(fProject).schedule();
- }
-
- }
- return true;
- }
-
- abstract String[] getFullBuildDialogStrings(boolean workspaceSettings);
-
-
-// public void performDefaults() {
-// for (int i= 0; i < fAllKeys.length; i++) {
-// Key curr= fAllKeys[i];
-// String defValue= curr.getStoredValue(fLookupOrder, true, fManager);
-// setValue(curr, defValue);
-// }
-//
-// settingsUpdated();
-// updateControls();
-// validateSettings(null, null, null);
-// }
-
- /**
- * @since 3.1
- */
- void performRevert() {
- for (int i= 0; i < fAllKeys.length; i++) {
- Key curr= fAllKeys[i];
- String origValue= curr.getCurValue(_prefs, fLookupOrder, false, null).toString();
- setValue(curr, origValue);
- }
-
- updateControls();
- validateSettings(null, null, null);
- }
-
- void dispose() {
- // do nothing; sub-class should override
- }
-
- void updateControls() {
- // update the UI
- for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
- updateCheckBox((Button) fCheckBoxes.get(i));
- }
- for (int i= fComboBoxes.size() - 1; i >= 0; i--) {
- updateCombo((Combo) fComboBoxes.get(i));
- }
- for (int i= fTextBoxes.size() - 1; i >= 0; i--) {
- updateText((Text) fTextBoxes.get(i));
- }
- }
-
- void updateCombo(Combo curr) {
- ControlData data= (ControlData) curr.getData();
-
- String currValue= getValue(data.getKey());
- curr.select(data.getSelection(currValue));
- }
-
- void updateCheckBox(Button curr) {
- ControlData data= (ControlData) curr.getData();
-
- String currValue= getValue(data.getKey());
- curr.setSelection(data.getSelection(currValue) == 0);
- }
-
- void updateText(Text curr) {
- Key key= (Key) curr.getData();
-
- String currValue= getValue(key);
- if (currValue != null) {
- curr.setText(currValue);
- }
- }
-
- Button getCheckBox(Key key) {
- for (int i= fCheckBoxes.size() - 1; i >= 0; i--) {
- Button curr= (Button) fCheckBoxes.get(i);
- ControlData data= (ControlData) curr.getData();
- if (key.equals(data.getKey())) {
- return curr;
- }
- }
- return null;
- }
-
- Combo getComboBox(Key key) {
- for (int i= fComboBoxes.size() - 1; i >= 0; i--) {
- Combo curr= (Combo) fComboBoxes.get(i);
- ControlData data= (ControlData) curr.getData();
- if (key.equals(data.getKey())) {
- return curr;
- }
- }
- return null;
- }
-
- Text getTextControl(Key key) {
- for (int i= fTextBoxes.size() - 1; i >= 0; i--) {
- Text curr= (Text) fTextBoxes.get(i);
- ControlData data= (ControlData) curr.getData();
- if (key.equals(data.getKey())) {
- return curr;
- }
- }
- return null;
- }
-
- Control findControl(Key key) {
- Combo comboBox= getComboBox(key);
- if (comboBox != null) {
- return comboBox;
- }
- Button checkBox= getCheckBox(key);
- if (checkBox != null) {
- return checkBox;
- }
- Text text= getTextControl(key);
- if (text != null) {
- return text;
- }
- return null;
- }
-
- void setComboEnabled(Key key, boolean enabled) {
- Combo combo= getComboBox(key);
- Label label= (Label) fLabels.get(combo);
- combo.setEnabled(enabled);
- label.setEnabled(enabled);
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PixelConverter.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PixelConverter.java
deleted file mode 100644
index a5ed50309..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PixelConverter.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Oracle - copied for use in JSF validation tooling
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.FontMetrics;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.widgets.Control;
-
-import org.eclipse.jface.dialogs.Dialog;
-
-/**
- * Copied from JDT. Used by OptionsConfigurationBlock
- *
- */
-class PixelConverter {
-
- private final FontMetrics fFontMetrics;
-
- /**
- * @param control
- */
- PixelConverter(Control control) {
- this(control.getFont());
- }
-
- /**
- * @param font
- */
- PixelConverter(Font font) {
- GC gc = new GC(font.getDevice());
- gc.setFont(font);
- fFontMetrics= gc.getFontMetrics();
- gc.dispose();
- }
-
- /*
- * see org.eclipse.jface.dialogs.DialogPage#convertHeightInCharsToPixels(int)
- */
- int convertHeightInCharsToPixels(int chars) {
- return Dialog.convertHeightInCharsToPixels(fFontMetrics, chars);
- }
-
- /*
- * see org.eclipse.jface.dialogs.DialogPage#convertHorizontalDLUsToPixels(int)
- */
- int convertHorizontalDLUsToPixels(int dlus) {
- return Dialog.convertHorizontalDLUsToPixels(fFontMetrics, dlus);
- }
-
- /*
- * see org.eclipse.jface.dialogs.DialogPage#convertVerticalDLUsToPixels(int)
- */
- int convertVerticalDLUsToPixels(int dlus) {
- return Dialog.convertVerticalDLUsToPixels(fFontMetrics, dlus);
- }
-
- /*
- * see org.eclipse.jface.dialogs.DialogPage#convertWidthInCharsToPixels(int)
- */
- int convertWidthInCharsToPixels(int chars) {
- return Dialog.convertWidthInCharsToPixels(fFontMetrics, chars);
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PreferencesMessages.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PreferencesMessages.java
deleted file mode 100644
index 9c755a117..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/PreferencesMessages.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * John Kaplan, johnkaplantech@gmail.com - 108071 [code templates] template for body of newly created class
- * Oracle - adapted for JSF tooling
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * NLS messages for validation severity preferences
- *
- * @author cbateman
- *
- */
-public final class PreferencesMessages extends NLS {
-
- private static final String BUNDLE_NAME= "org.eclipse.jst.jsf.ui.internal.validation.messages";//$NON-NLS-1$
-
- private PreferencesMessages() {
- // Do not instantiate
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, PreferencesMessages.class);
- }
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesPreferencePage_title;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_warning;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_ignore;
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_section_id_resolution;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_section_general;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_section_type_coercion_problems;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_section_constant_folding_and_unused_code;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_section_programming_errors;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_needsbuild_title;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_needsfullbuild_message;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_needsprojectbuild_message;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_buildwarning_dont_show_again;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_common_description;
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_general_syntax_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_empty_el_expression;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_missing_closing_expr_bracket;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_cannot_apply_operator_to_method_binding;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_dotted_property_key_should_use_array;
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_variable_not_found;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_member_not_found;
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_binary_op_numeric_coercion_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_binary_op_boolean_coercion_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_binary_op_no_coercion_available;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_binary_op_literal_to_number_coercion_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_unary_op_numeric_coercion_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_unary_op_boolean_coercion_error;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_unary_op_string_coercion_not_guaranteed;
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_both_binary_operands_null;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_binary_expression_always_evaluates_same;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_equality_with_null_always_same;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_unary_expression_always_evaluates_same;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_empty_expression_always_false;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_enumeration_comparision_always_same;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_minus_on_null_always_zero;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_first_argument_short_circuits_expression;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_second_argument_always_evaluates_same;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_apply_dot_operator_with_null;
-
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_possible_division_by_zero;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_possible_array_index_out_of_bounds;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_incompatible_enumeration_comparison;
- /**
- * see messages.properties
- */
- public static String ProblemSeveritiesConfigurationBlock_pb_member_is_intermediate;
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ProblemSeveritiesConfigurationBlock.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ProblemSeveritiesConfigurationBlock.java
deleted file mode 100644
index 69b31a73d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ProblemSeveritiesConfigurationBlock.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2006 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Oracle - adapted for use in JSF Tooling
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jst.jsf.core.internal.IJSFPreferenceModel;
-import org.eclipse.jst.jsf.ui.internal.JSFUiPlugin;
-import org.eclipse.jst.jsf.validation.internal.ELValidationPreferences;
-import org.eclipse.jst.jsf.validation.internal.ELValidationPreferences.Severity;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-
-
-/**
- */
-/*package*/ class ProblemSeveritiesConfigurationBlock extends OptionsConfigurationBlock {
-
- private static final String SETTINGS_SECTION_NAME= "ProblemSeveritiesConfigurationBlock"; //$NON-NLS-1$
-
- /**
- * preference key. Match to DiagnosticFactory constants
- */
- private final static Key PREF_BINARY_OP_BOTH_OPERANDS_NULL =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_BOTH_OPERANDS_NULL);
- private final static Key PREF_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_POSSIBLE_DIVISION_BY_ZERO);
- private final static Key PREF_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION);
- private final static Key PREF_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME);
- private final static Key PREF_BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME);
- private final static Key PREF_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN);
- private final static Key PREF_BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS);
- private final static Key PREF_BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME);
- private final static Key PREF_BINARY_OP_NO_AVAILABLE_TYPE_COERCION =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_NO_AVAILABLE_TYPE_COERCION);
- private final static Key PREF_BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS);
- private final static Key PREF_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME =
- getJSFCoreKey(ELValidationPreferences.UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME);
- private final static Key PREF_UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE =
- getJSFCoreKey(ELValidationPreferences.UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE);
- private final static Key PREF_UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO =
- getJSFCoreKey(ELValidationPreferences.UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO);
- private final static Key PREF_UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION =
- getJSFCoreKey(ELValidationPreferences.UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION);
- private final static Key PREF_UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN =
- getJSFCoreKey(ELValidationPreferences.UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN);
-// private final static Key PREF_TERNARY_OP_CHOICE_IS_ALWAYS_SAME =
-// getJSFCoreKey(ELValidationPreferences.TERNARY_OP_CHOICE_IS_ALWAYS_SAME);
-// private final static Key PREF_TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN =
-// getJSFCoreKey(ELValidationPreferences.TERNARY_OP_CANNOT_COERCE_CHOICE_TO_BOOLEAN);
- private final static Key PREF_UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED =
- getJSFCoreKey(ELValidationPreferences.UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED);
- private final static Key PREF_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING =
- getJSFCoreKey(ELValidationPreferences.CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING);
- private final static Key PREF_MEMBER_NOT_FOUND =
- getJSFCoreKey(ELValidationPreferences.MEMBER_NOT_FOUND);
- private final static Key PREF_VARIABLE_NOT_FOUND =
- getJSFCoreKey(ELValidationPreferences.VARIABLE_NOT_FOUND);
- private final static Key PREF_MISSING_CLOSING_EXPR_BRACKET =
- getJSFCoreKey(ELValidationPreferences.MISSING_CLOSING_EXPR_BRACKET);
- private final static Key PREF_GENERAL_SYNTAX_ERROR =
- getJSFCoreKey(ELValidationPreferences.GENERAL_SYNTAX_ERROR);
- private final static Key PREF_EMPTY_EL_EXPRESSION =
- getJSFCoreKey(ELValidationPreferences.EMPTY_EL_EXPRESSION);
- private final static Key PREF_BINARY_OP_DOT_WITH_VALUEB_NULL =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_DOT_WITH_VALUEB_NULL);
- private final static Key PREF_BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY);
- private final static Key PREF_POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS =
- getJSFCoreKey(ELValidationPreferences.POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS);
- private final static Key PREF_BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME =
- getJSFCoreKey(ELValidationPreferences.BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME);
- private final static Key PREF_BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE =
- getJSFCoreKey(ELValidationPreferences.BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE);
- private final static Key PREF_MEMBER_IS_INTERMEDIATE =
- getJSFCoreKey(ELValidationPreferences.MEMBER_IS_INTERMEDIATE);
-
- private final static int EXPECTED_PREFS = 28;
-
- private PixelConverter fPixelConverter;
-
- /**
- * @param prefs
- * @param project
- * @param container
- */
- public ProblemSeveritiesConfigurationBlock(/*TODO:IStatusChangeListener context,*/ IJSFPreferenceModel prefs, IProject project, IWorkbenchPreferenceContainer container) {
- super(prefs, project, getKeys(), container);
- }
-
- private static Key[] getKeys()
- {
- Key[] keys = new Key[] {
- PREF_BINARY_OP_BOTH_OPERANDS_NULL
- , PREF_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO
- , PREF_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION
- , PREF_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME
- , PREF_BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME
- , PREF_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN
- , PREF_BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS
- , PREF_BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME
- , PREF_BINARY_OP_NO_AVAILABLE_TYPE_COERCION
- , PREF_BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS
- , PREF_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME
- , PREF_UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE
- , PREF_UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO
- , PREF_UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION
- , PREF_UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN
- , PREF_UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED
- , PREF_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING
- , PREF_MEMBER_NOT_FOUND
- , PREF_VARIABLE_NOT_FOUND
- , PREF_MISSING_CLOSING_EXPR_BRACKET
- , PREF_GENERAL_SYNTAX_ERROR
- , PREF_EMPTY_EL_EXPRESSION
- , PREF_BINARY_OP_DOT_WITH_VALUEB_NULL
- , PREF_BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY
- , PREF_POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS
- , PREF_BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME
- , PREF_BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE
- , PREF_MEMBER_IS_INTERMEDIATE
- };
-
- if (EXPECTED_PREFS != keys.length)
- {
- JSFUiPlugin.log(IStatus.WARNING, "Expected "+EXPECTED_PREFS+" preferences but was "+keys.length, new Throwable());
- }
-
- return keys;
- }
-
- /*
- * @see org.eclipse.jface.preference.PreferencePage#createContents(Composite)
- */
- protected Control createContents(Composite parent) {
- fPixelConverter= new PixelConverter(parent);
- setShell(parent.getShell());
-
- Group mainComp= new Group(parent, SWT.NONE);
- mainComp.setFont(parent.getFont());
- GridLayout layout= new GridLayout();
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- mainComp.setLayout(layout);
- mainComp.setText(PreferencesMessages.ProblemSeveritiesConfigurationBlock_common_description);
-
- Composite commonComposite= createStyleTabContent(mainComp);
- GridData gridData= new GridData(GridData.FILL, GridData.FILL, true, true);
- gridData.heightHint= fPixelConverter.convertHeightInCharsToPixels(20);
- commonComposite.setLayoutData(gridData);
-
- validateSettings(null, null, null);
-
- return mainComp;
- }
-
- private Composite createStyleTabContent(Composite folder) {
- String[] errorWarningIgnore= new String[] { Severity.ERROR.toString(), Severity.WARNING.toString(), Severity.IGNORE.toString() };
-
- String[] errorWarningIgnoreLabels= new String[] {
- PreferencesMessages.ProblemSeveritiesConfigurationBlock_error,
- PreferencesMessages.ProblemSeveritiesConfigurationBlock_warning,
- PreferencesMessages.ProblemSeveritiesConfigurationBlock_ignore
- };
-
- //String[] enabledDisabled= new String[] { ENABLED, DISABLED };
-
- int nColumns= 3;
-
- final ScrolledPageContent sc1 = new ScrolledPageContent(folder);
-
- Composite composite= sc1.getBody();
- GridLayout layout= new GridLayout(nColumns, false);
- layout.marginHeight= 0;
- layout.marginWidth= 0;
- composite.setLayout(layout);
-
-// Label description= new Label(composite, SWT.LEFT | SWT.WRAP);
-// description.setFont(description.getFont());
-// description.setText(PreferencesMessages.ProblemSeveritiesConfigurationBlock_common_description);
-// description.setLayoutData(new GridData(GridData.BEGINNING, GridData.CENTER, true, false, nColumns - 1, 1));
-
- int indentStep= fPixelConverter.convertWidthInCharsToPixels(1);
-
- int defaultIndent= indentStep * 0;
- //int extraIndent= indentStep * 2;
- String label;
- ExpandableComposite excomposite;
- Composite inner;
-
- // -- general errors
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_general;
- excomposite= createStyleSection(composite, label, nColumns);
-
- inner= new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_general_syntax_error;
- addComboBox(inner, label, PREF_GENERAL_SYNTAX_ERROR, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_empty_el_expression;
- addComboBox(inner, label, PREF_EMPTY_EL_EXPRESSION, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_missing_closing_expr_bracket;
- addComboBox(inner, label, PREF_MISSING_CLOSING_EXPR_BRACKET, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_cannot_apply_operator_to_method_binding;
- addComboBox(inner, label, PREF_CANNOT_APPLY_OPERATOR_TO_METHOD_BINDING, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_dotted_property_key_should_use_array;
- addComboBox(inner, label, PREF_BINARY_OP_DOT_WITH_DOTTED_KEY_SHOULD_USE_ARRAY, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- // --- id resolution
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_id_resolution;
- excomposite= createStyleSection(composite, label, nColumns);
-
- inner= new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_variable_not_found;
- addComboBox(inner, label, PREF_VARIABLE_NOT_FOUND, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_member_not_found;
- addComboBox(inner, label, PREF_MEMBER_NOT_FOUND, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_member_is_intermediate;
- addComboBox(inner, label, PREF_MEMBER_IS_INTERMEDIATE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- // --- type coercion problems
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_type_coercion_problems;
- excomposite= createStyleSection(composite, label, nColumns);
-
- inner= new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_binary_op_numeric_coercion_error;
- addComboBox(inner, label, PREF_BINARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_binary_op_boolean_coercion_error;
- addComboBox(inner, label, PREF_BINARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_binary_op_no_coercion_available;
- addComboBox(inner, label, PREF_BINARY_OP_NO_AVAILABLE_TYPE_COERCION, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_binary_op_literal_to_number_coercion_error;
- addComboBox(inner, label, PREF_BINARY_OP_COULD_NOT_COERCE_LITERALS_TO_NUMBERS, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unary_op_numeric_coercion_error;
- addComboBox(inner, label, PREF_UNARY_OP_COULD_NOT_MAKE_NUMERIC_COERCION, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unary_op_boolean_coercion_error;
- addComboBox(inner, label, PREF_UNARY_OP_CANNOT_COERCE_ARGUMENT_TO_BOOLEAN, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unary_op_string_coercion_not_guaranteed;
- addComboBox(inner, label, PREF_UNARY_OP_STRING_CONVERSION_NOT_GUARANTEED, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- // --- constant folder and unused code
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_constant_folding_and_unused_code;
- excomposite= createStyleSection(composite, label, nColumns);
-
- inner= new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_both_binary_operands_null;
- addComboBox(inner, label, PREF_BINARY_OP_BOTH_OPERANDS_NULL, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_binary_expression_always_evaluates_same;
- addComboBox(inner, label, PREF_BINARY_OP_CONSTANT_EXPRESSION_ALWAYS_EVAL_SAME, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_equality_with_null_always_same;
- addComboBox(inner, label, PREF_BINARY_OP_EQUALITY_COMP_WITH_NULL_ALWAYS_EVAL_SAME, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_enumeration_comparision_always_same;
- addComboBox(inner, label, PREF_BINARY_COMPARISON_WITH_ENUM_ALWAYS_SAME, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_unary_expression_always_evaluates_same;
- addComboBox(inner, label, PREF_UNARY_OP_CONSTANT_EXPRESSION_EVAL_SAME, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_empty_expression_always_false;
- addComboBox(inner, label, PREF_UNARY_OP_EMPTY_ALWAYS_FALSE_ON_TYPE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_minus_on_null_always_zero;
- addComboBox(inner, label, PREF_UNARY_OP_MINUS_ON_NULL_ALWAYS_ZERO, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_first_argument_short_circuits_expression;
- addComboBox(inner, label, PREF_BINARY_OP_FIRST_ARGUMENT_SHORT_CIRCUITS, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_second_argument_always_evaluates_same;
- addComboBox(inner, label, PREF_BINARY_OP_SECOND_ARGUMENT_ALWAYS_EVAL_SAME, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_apply_dot_operator_with_null;
- addComboBox(inner, label, PREF_BINARY_OP_DOT_WITH_VALUEB_NULL, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- // --- possible programming errors
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_section_programming_errors;
- excomposite= createStyleSection(composite, label, nColumns);
-
- inner= new Composite(excomposite, SWT.NONE);
- inner.setFont(composite.getFont());
- inner.setLayout(new GridLayout(nColumns, false));
- excomposite.setClient(inner);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_possible_division_by_zero;
- addComboBox(inner, label, PREF_BINARY_OP_POSSIBLE_DIVISION_BY_ZERO, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_possible_array_index_out_of_bounds;
- addComboBox(inner, label, PREF_POSSIBLE_ARRAY_INDEX_OUT_OF_BOUNDS, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
- label= PreferencesMessages.ProblemSeveritiesConfigurationBlock_pb_incompatible_enumeration_comparison;
- addComboBox(inner, label, PREF_BINARY_OP_COMPARISON_OF_ENUMS_INCOMPATIBLE, errorWarningIgnore, errorWarningIgnoreLabels, defaultIndent);
-
-
- new Label(composite, SWT.NONE);
-
- IDialogSettings section= JSFUiPlugin.getDefault().getDialogSettings().getSection(SETTINGS_SECTION_NAME);
- restoreSectionExpansionStates(section);
-
- return sc1;
- }
-
- /* (non-javadoc)
- * Update fields and validate.
- * @param changedKey Key that changed, or null, if all changed.
- */
- protected void validateSettings(Key changedKey, String oldValue, String newValue) {
- if (!areSettingsEnabled()) {
- return;
- }
-
-// if (changedKey != null) {
-// if (PREF_PB_UNUSED_PARAMETER.equals(changedKey) ||
-// PREF_PB_DEPRECATION.equals(changedKey) ||
-// PREF_PB_LOCAL_VARIABLE_HIDING.equals(changedKey) ||
-// PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION.equals(changedKey)) {
-// updateEnableStates();
-// } else if (PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING.equals(changedKey)) {
-// // merging the two options
-// setValue(PREF_PB_SIGNAL_PARAMETER_IN_ABSTRACT, newValue);
-// } else {
-// return;
-// }
-// } else {
- updateEnableStates();
-// }
- // TODO: fContext.statusChanged(new StatusInfo());
- }
-
- private void updateEnableStates() {
-// boolean enableUnusedParams= !checkValue(PREF_PB_UNUSED_PARAMETER, Severity.IGNORE.toString());
-// getCheckBox(PREF_PB_SIGNAL_PARAMETER_IN_OVERRIDING).setEnabled(enableUnusedParams);
-// getCheckBox(PREF_PB_UNUSED_PARAMETER_INCLUDE_DOC_COMMENT_REFERENCE).setEnabled(enableUnusedParams);
-//
-// boolean enableDeprecation= !checkValue(PREF_PB_DEPRECATION, Severity.IGNORE.toString());
-// getCheckBox(PREF_PB_DEPRECATION_IN_DEPRECATED_CODE).setEnabled(enableDeprecation);
-// getCheckBox(PREF_PB_DEPRECATION_WHEN_OVERRIDING).setEnabled(enableDeprecation);
-//
-// boolean enableThrownExceptions= !checkValue(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION, Severity.IGNORE.toString());
-// getCheckBox(PREF_PB_UNUSED_DECLARED_THROWN_EXCEPTION_WHEN_OVERRIDING).setEnabled(enableThrownExceptions);
-//
-// boolean enableHiding= !checkValue(PREF_PB_LOCAL_VARIABLE_HIDING, Severity.IGNORE.toString());
-// getCheckBox(PREF_PB_SPECIAL_PARAMETER_HIDING_FIELD).setEnabled(enableHiding);
- }
-
- protected String[] getFullBuildDialogStrings(boolean workspaceSettings) {
- String title= PreferencesMessages.ProblemSeveritiesConfigurationBlock_needsbuild_title;
- String message;
- if (workspaceSettings) {
- message= PreferencesMessages.ProblemSeveritiesConfigurationBlock_needsfullbuild_message;
- } else {
- message= PreferencesMessages.ProblemSeveritiesConfigurationBlock_needsprojectbuild_message;
- }
- return new String[] { title, message };
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.internal.ui.preferences.OptionsConfigurationBlock#dispose()
- */
- public void dispose() {
- IDialogSettings section= JSFUiPlugin.getDefault().getDialogSettings().addNewSection(SETTINGS_SECTION_NAME);
- storeSectionExpansionStates(section);
- super.dispose();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ScrolledPageContent.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ScrolledPageContent.java
deleted file mode 100644
index 5cc17717d..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ScrolledPageContent.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2005 IBM Corporation 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:
- * IBM Corporation - initial API and implementation
- * Oracle - updated for JSF tools
- *******************************************************************************/
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.forms.FormColors;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.SharedScrolledComposite;
-
-
-/**
- * Customized SharedScrolledComposite
- */
-/*package*/ class ScrolledPageContent extends SharedScrolledComposite {
-
- private FormToolkit fToolkit;
-
- /**
- * @param parent
- */
- public ScrolledPageContent(Composite parent) {
- this(parent, SWT.V_SCROLL | SWT.H_SCROLL);
- }
-
- /**
- * @param parent
- * @param style
- */
- public ScrolledPageContent(Composite parent, int style) {
- super(parent, style);
-
- setFont(parent.getFont());
-
- initDialogsFormToolkit();
-
- setExpandHorizontal(true);
- setExpandVertical(true);
-
- Composite body= new Composite(this, SWT.NONE);
- body.setFont(parent.getFont());
- setContent(body);
- }
-
- private FormToolkit initDialogsFormToolkit()
- {
- if (fToolkit == null) {
- FormColors colors= new FormColors(Display.getCurrent());
- colors.setBackground(null);
- colors.setForeground(null);
- fToolkit= new FormToolkit(colors);
- }
- return fToolkit;
- }
-
- /**
- * @param childControl
- */
- public void adaptChild(Control childControl) {
- fToolkit.adapt(childControl, true, true);
- }
-
- /**
- * @return the content composite
- */
- public Composite getBody() {
- return (Composite) getContent();
- }
-
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationMessageFactory.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationMessageFactory.java
deleted file mode 100644
index fef3aa3d3..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationMessageFactory.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006 Oracle Corporation.
- * 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:
- * Cameron Bateman/Oracle - initial API and implementation
- *
- ********************************************************************************/
-
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.validation.internal.ELValidationPreferences;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.wst.validation.internal.core.Message;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * Creates configured validation Message objects.
- *
- * @author cbateman
- *
- */
-public final class ValidationMessageFactory
-{
- /**
- * @param diagnostic
- * @param offset
- * @param length
- * @param file
- * @param prefs
- * @return a configured message
- */
- public static Message createFromDiagnostic(final Diagnostic diagnostic, final int offset, final int length, final IFile file, final ValidationPreferences prefs)
- {
-
- final int code = diagnostic.getCode();
-
- int severity = diagnostic.getSeverity();
-
- // XXX: this is a temporary solution. We need a way to allow
- // severity overrides from default that is decoupled from the
- // factory or code value for a diagnostic
- if (code >= 0)
- {
- final ELValidationPreferences elPrefs =
- prefs.getElPrefs();
- severity =
- elPrefs.getDiagnosticSeverity(code);
- }
-
- final Message message =
- new MyLocalizedMessage(
- convertSeverity(severity),
- diagnostic.getMessage(),
- file,
- diagnostic.getCode());
-
- message.setOffset(offset);
- message.setLength(length);
-
- return message;
- }
-
- /**
- * @param severity
- * @return a Message severity equivilent to diagnostic.getSeverity()
- */
- private static int convertSeverity(final int severity)
- {
- switch (severity)
- {
- case Diagnostic.ERROR:
- return IMessage.HIGH_SEVERITY;
- case Diagnostic.WARNING:
- return IMessage.NORMAL_SEVERITY;
- case Diagnostic.INFO:
- return IMessage.LOW_SEVERITY;
- case Diagnostic.OK:
- default:
- // no bits set
- return 0;
- }
- }
-
- private ValidationMessageFactory()
- {
- // no external instantiation
- }
-}
-
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationReporter.java b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationReporter.java
deleted file mode 100644
index e29fae7fb..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/ValidationReporter.java
+++ /dev/null
@@ -1,48 +0,0 @@
-package org.eclipse.jst.jsf.ui.internal.validation;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.jst.jsf.validation.internal.IJSFViewValidator;
-import org.eclipse.jst.jsf.validation.internal.ValidationPreferences;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-import org.eclipse.wst.validation.internal.provisional.core.IValidator;
-
-/*package*/class ValidationReporter implements
- IJSFViewValidator.IValidationReporter
-{
- private final IValidator _validator;
- private final IReporter _reporter;
- private final IFile _file;
- private final ValidationPreferences _prefs;
-
- public ValidationReporter(final IValidator validator,
- final IReporter reporter, final IFile file,
- final ValidationPreferences prefs)
- {
- _validator = validator;
- _reporter = reporter;
- _file = file;
- _prefs = prefs;
- }
-
- public void report(final Diagnostic problem, final int start,
- final int length)
- {
- final IMessage message = ValidationMessageFactory.createFromDiagnostic(
- problem, start, length, _file, _prefs);
-
- if ((message.getSeverity() & IMessage.ALL_MESSAGES) != 0)
- {
- _reporter.addMessage(_validator, message);
- }
- }
-
- public void report(IMessage message)
- {
- if ((message.getSeverity() & IMessage.ALL_MESSAGES) != 0)
- {
- _reporter.addMessage(_validator, message);
- }
- }
-}
diff --git a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/messages.properties b/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/messages.properties
deleted file mode 100644
index eaeea759a..000000000
--- a/jsf/plugins/org.eclipse.jst.jsf.ui/src/org/eclipse/jst/jsf/ui/internal/validation/messages.properties
+++ /dev/null
@@ -1,64 +0,0 @@
-###############################################################################
-# Copyright (c) 2000, 2007 IBM Corporation 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:
-# IBM Corporation - initial API and implementation
-# John Kaplan, johnkaplantech@gmail.com - 108071 [code templates] template for body of newly created class
-# Cameron Bateman/Oracle - adapted for use in JSF validation tooling
-###############################################################################
-
-ProblemSeveritiesPreferencePage_title=Problem Severities
-
-ProblemSeveritiesConfigurationBlock_error=Error
-ProblemSeveritiesConfigurationBlock_warning=Warning
-ProblemSeveritiesConfigurationBlock_ignore=Ignore
-
-ProblemSeveritiesConfigurationBlock_section_id_resolution=&Identifier Resolution
-ProblemSeveritiesConfigurationBlock_section_general=&General Problems
-ProblemSeveritiesConfigurationBlock_section_type_coercion_problems=&Type Coercion Problems
-ProblemSeveritiesConfigurationBlock_section_constant_folding_and_unused_code=&Constant folding and unused code
-ProblemSeveritiesConfigurationBlock_section_programming_errors=&Possible programming errors
-
-ProblemSeveritiesConfigurationBlock_needsbuild_title=Error/Warning Settings Changed
-ProblemSeveritiesConfigurationBlock_needsfullbuild_message=The Error/Warning settings have changed. You will need to rebuild or revalidate for these changes to take effect.
-ProblemSeveritiesConfigurationBlock_needsprojectbuild_message=The Error/Warning settings have changed. A rebuild of the project is required for changes to take effect. Build the project now?
-ProblemSeveritiesConfigurationBlock_buildwarning_dont_show_again=Don't show this dialog again
-
-ProblemSeveritiesConfigurationBlock_common_description=Select the severity level for the following problems
-
-ProblemSeveritiesConfigurationBlock_pb_general_syntax_error=General Syntax Error
-ProblemSeveritiesConfigurationBlock_pb_empty_el_expression=Empty EL expression
-ProblemSeveritiesConfigurationBlock_pb_missing_closing_expr_bracket=Missing closing bracket on expression
-ProblemSeveritiesConfigurationBlock_pb_cannot_apply_operator_to_method_binding=Applying operator to method binding
-ProblemSeveritiesConfigurationBlock_pb_dotted_property_key_should_use_array=Dotted property names should use array ([]) syntax
-
-ProblemSeveritiesConfigurationBlock_pb_variable_not_found=Variable not found
-ProblemSeveritiesConfigurationBlock_pb_member_not_found=Member not found
-ProblemSeveritiesConfigurationBlock_pb_member_is_intermediate=Member is intermediate
-
-ProblemSeveritiesConfigurationBlock_pb_binary_op_numeric_coercion_error=Binary operation number coercion problems
-ProblemSeveritiesConfigurationBlock_pb_binary_op_boolean_coercion_error=Binary operation boolean coercion problems
-ProblemSeveritiesConfigurationBlock_pb_binary_op_no_coercion_available=Binary operation no available coercions
-ProblemSeveritiesConfigurationBlock_pb_binary_op_literal_to_number_coercion_error=Binary coercion of literal to number
-ProblemSeveritiesConfigurationBlock_pb_unary_op_numeric_coercion_error=Unary operation number coercion problems
-ProblemSeveritiesConfigurationBlock_pb_unary_op_boolean_coercion_error=Unary operation boolean coercion problems
-ProblemSeveritiesConfigurationBlock_pb_unary_op_string_coercion_not_guaranteed=Unary operation string coercion not guaranteed
-
-ProblemSeveritiesConfigurationBlock_pb_both_binary_operands_null=Both operands null
-ProblemSeveritiesConfigurationBlock_pb_binary_expression_always_evaluates_same=Binary expression always evaluates to same value
-ProblemSeveritiesConfigurationBlock_pb_equality_with_null_always_same=Equality comparison with null always evaluates to same value
-ProblemSeveritiesConfigurationBlock_pb_unary_expression_always_evaluates_same=Unary expression always evaluates to same value
-ProblemSeveritiesConfigurationBlock_pb_empty_expression_always_false=Empty operator always resolves to false on type
-ProblemSeveritiesConfigurationBlock_pb_enumeration_comparision_always_same=Enumeration comparison always evaluates to same value
-ProblemSeveritiesConfigurationBlock_pb_minus_on_null_always_zero=Minus applied to null always evaluates to zero
-ProblemSeveritiesConfigurationBlock_pb_first_argument_short_circuits_expression=First argument short-circuits expression
-ProblemSeveritiesConfigurationBlock_pb_second_argument_always_evaluates_same=Second argument always evaluates the same
-ProblemSeveritiesConfigurationBlock_pb_apply_dot_operator_with_null=Applying the dot ('.') operator with null always returns null
-
-ProblemSeveritiesConfigurationBlock_pb_possible_division_by_zero=Possible division by zero
-ProblemSeveritiesConfigurationBlock_pb_possible_array_index_out_of_bounds=Possible array index out of bounds
-ProblemSeveritiesConfigurationBlock_pb_incompatible_enumeration_comparison=Incompatible enumeration comparison

Back to the top