JBoss Tools SVN: r21245 - branches/modular_build.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-04-02 14:08:12 -0400 (Fri, 02 Apr 2010)
New Revision: 21245
Added:
branches/modular_build/build.xml
Log:
generic build script for use in Eclipse or Hudson job; regenerates poms and then builds the specified ${COMPONENT}
Added: branches/modular_build/build.xml
===================================================================
--- branches/modular_build/build.xml (rev 0)
+++ branches/modular_build/build.xml 2010-04-02 18:08:12 UTC (rev 21245)
@@ -0,0 +1,74 @@
+<!-- Run a given ${COMPONENT} build -->
+<project default="run" xmlns:artifact="antlib:org.apache.maven.artifact.ant" basedir=".">
+
+ <target name="run" depends="init, genpom, install, deploy" />
+
+ <!-- override for local build -->
+ <available file="/qa/tools/opt" type="dir" property="isJBossQA" />
+ <target name="local" unless="jbossQAConfig">
+ <property name="WORKINGDIR" value="${basedir}" />
+ <property name="COMMON_TOOLS" value="${java.io.tmpdir}" />
+ </target>
+
+ <!-- default settings for JBQA Hudson -->
+ <target name="init" depends="local">
+ <property name="WORKINGDIR" value="${WORKSPACE}/jbosstools-trunk" />
+ <!-- <property name="COMMON_TOOLS" value="/qa/tools/opt" /> -->
+ <property name="COMMON_TOOLS" value="${WORKSPACE}/tools" />
+ <mkdir dir="${COMMON_TOOLS}" />
+
+ <property name="MAVEN_MIRROR" value="http://mirror.csclub.uwaterloo.ca/apache/maven/binaries" />
+ <get usetimestamp="true"
+ dest="${COMMON_TOOLS}/apache-maven-3.0-alpha-7-bin.tar.gz"
+ src="${MAVEN_MIRROR}/apache-maven-3.0-alpha-7-bin.tar.gz"
+ />
+ <untar compression="gzip"
+ overwrite="false"
+ dest="${COMMON_TOOLS}"
+ src="${COMMON_TOOLS}/apache-maven-3.0-alpha-7-bin.tar.gz"
+ />
+ <chmod perm="755" file="${COMMON_TOOLS}/apache-maven-3.0-alpha-7/bin/mvn"/>
+
+ <!-- maven ant tasks -->
+ <!--<get usetimestamp="true"
+ dest="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar"
+ src="${MAVEN_MIRROR}/maven-ant-tasks-2.1.0.jar"
+ />
+ <path id="maven-ant-tasks.classpath" path="${COMMON_TOOLS}/maven-ant-tasks-2.1.0.jar" />
+ <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
+ uri="antlib:org.apache.maven.artifact.ant"
+ classpathref="maven-ant-tasks.classpath"
+ /> -->
+ </target>
+
+ <!-- TODO: replace this with ant script for better portability -->
+ <target name="genpom">
+ <exec executable="scala" dir="${WORKINGDIR}">
+ <arg line="${WORKINGDIR}/genpom.scala" />
+ </exec>
+ </target>
+
+ <target name="install">
+ <property name="COMPONENT" value="tests" />
+ <echo>Run pom file: ${WORKINGDIR}/${COMPONENT}/pom.xml</echo>
+
+ <exec executable="${COMMON_TOOLS}/apache-maven-3.0-alpha-7/bin/mvn" dir="${WORKINGDIR}/${COMPONENT}">
+ <!-- <arg line="-o -Dmaven.test.skip" /> -->
+ <arg line="clean install" />
+ </exec>
+ </target>
+
+ <target name="deploy">
+ <!-- TODO enable publishing to download.jboss.org or porkchop.jboss.com
+ <artifact:install-provider artifactId="wagon-ssh" version="1.0-beta-2"/>
+
+ <artifact:deploy file="target/my-project-1.0.jar">
+ <remoteRepository url="scp://localhost/www/repository">
+ <authentication username="${repository.username}" privateKey="${user.home}/.ssh/id_dsa" />
+ </remoteRepository>
+ <pom refid="mypom" />
+ </artifact:deploy>
+ -->
+ </target>
+</project>
+
Property changes on: branches/modular_build/build.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss Tools SVN: r21244 - in trunk: seam/docs/reference/en-US and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: abogachuk
Date: 2010-04-02 13:35:18 -0400 (Fri, 02 Apr 2010)
New Revision: 21244
Modified:
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam3.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam4.png
trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam5.png
trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_1.png
trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_15.png
trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_16.png
trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_7.png
trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_8.png
trunk/seam/docs/reference/en-US/intro.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-1163 - screens were updated for the Seam Web Project Wizard
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam3.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam4.png
===================================================================
(Binary files differ)
Modified: trunk/documentation/guides/GettingStartedGuide/en-US/images/first_seam/first_seam5.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_1.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_15.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_16.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_7.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en-US/images/create_new_seam/create_seam_8.png
===================================================================
(Binary files differ)
Modified: trunk/seam/docs/reference/en-US/intro.xml
===================================================================
--- trunk/seam/docs/reference/en-US/intro.xml 2010-04-02 16:06:43 UTC (rev 21243)
+++ trunk/seam/docs/reference/en-US/intro.xml 2010-04-02 17:35:18 UTC (rev 21244)
@@ -138,7 +138,7 @@
<title>Other relevant resources on the topic</title>
<para>The <ulink url="http://seamframework.org/">Seam Framework</ulink> - Next generation enterprise Java development.</para>
- <para>All JBoss Developer Studio/JBoss Tools release documentation you can find at<ulink url="http://docs.jboss.org/tools/">http://docs.jboss.org/tools</ulink> in the corresponding release directory.</para>
+ <para>All JBoss Developer Studio/JBoss Tools release documentation you can find at <ulink url="http://docs.jboss.org/tools/">http://docs.jboss.org/tools</ulink> in the corresponding release directory.</para>
<para>There is some extra information on <ulink url="http://www.jboss.org/community/wiki/JBossSeam">JBoss Wiki. </ulink></para>
<para>The latest documentation builds are available at <ulink url="http://download.jboss.org/jbosstools/nightly-docs/">http://download.jboss.org/jbosstools/nightly-docs</ulink>.</para>
<para>You can find a set of screencasts on how to search/find references and use Seam refactoring tools in the following Max Andersen's
14 years, 9 months
JBoss Tools SVN: r21243 - in trunk: cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core and 12 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2010-04-02 12:06:43 -0400 (Fri, 02 Apr 2010)
New Revision: 21243
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/RenameNamedBeanWizard.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
Removed:
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELReferencesQueryParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java
trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/ELRenameProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5927
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/META-INF/MANIFEST.MF 2010-04-02 16:06:43 UTC (rev 21243)
@@ -18,7 +18,8 @@
org.jboss.tools.jst.web.kb,
org.jboss.tools.common.el.core,
org.eclipse.jface.text,
- org.eclipse.equinox.preferences
+ org.eclipse.equinox.preferences,
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: JBoss by Red Hat
@@ -28,6 +29,7 @@
org.jboss.tools.cdi.internal.core.impl,
org.jboss.tools.cdi.internal.core.impl.definition,
org.jboss.tools.cdi.internal.core.project.facet,
+ org.jboss.tools.cdi.internal.core.refactoring,
org.jboss.tools.cdi.internal.core.scanner,
org.jboss.tools.cdi.internal.core.scanner.lib,
org.jboss.tools.cdi.internal.core.validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/CDICoreMessages.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -25,4 +25,8 @@
public static String CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERRORS_OCCURED;
public static String CDI_FACET_INSTALL_ABSTRACT_DELEGATE_CHECK_ERROR_LOG_VIEW;
public static String CDI_FACET_INSTALL_ABSTRACT_DELEGATE_ERROR;
+
+ public static String CDI_RENAME_PROCESSOR_OUT_OF_SYNC_FILE;
+ public static String CDI_RENAME_PROCESSOR_ERROR_PHANTOM_FILE;
+ public static String CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE;
}
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -0,0 +1,296 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.internal.core.refactoring;
+
+import java.util.ArrayList;
+import java.util.Set;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.TextFileChange;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.internal.core.refactoring.Messages;
+import org.eclipse.text.edits.MultiTextEdit;
+import org.eclipse.text.edits.ReplaceEdit;
+import org.eclipse.text.edits.TextEdit;
+import org.jboss.tools.cdi.core.CDICoreMessages;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
+
+/**
+ * @author Daniel Azarov
+ */
+public abstract class CDIRenameProcessor extends RenameProcessor {
+ protected static final String JAVA_EXT = "java"; //$NON-NLS-1$
+ protected static final String XML_EXT = "xml"; //$NON-NLS-1$
+ protected static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
+ protected static final String JSP_EXT = "jsp"; //$NON-NLS-1$
+ protected static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
+
+ protected static final RefactoringParticipant[] EMPTY_REF_PARTICIPANT = new RefactoringParticipant[0];
+
+ protected RefactoringStatus status;
+
+ protected CompositeChange rootChange;
+ protected TextFileChange lastChange;
+ protected IFile declarationFile=null;
+
+ private String newName;
+ private String oldName;
+
+ private CDISearcher searcher = null;
+ protected IBean bean;
+
+ protected CDISearcher getSearcher(){
+ if(searcher == null){
+ searcher = new CDISearcher(declarationFile, getOldName());
+ }
+ return searcher;
+ }
+
+ public void setNewName(String newName){
+ this.newName = newName;
+ }
+
+ protected String getNewName(){
+ return newName;
+ }
+
+ protected void setOldName(String oldName){
+ this.oldName = oldName;
+ }
+
+ public String getOldName(){
+ return oldName;
+ }
+
+ // lets collect all changes for the same files in one MultiTextEdit
+ protected TextFileChange getChange(IFile file){
+ if(lastChange != null && lastChange.getFile().equals(file))
+ return lastChange;
+
+ for(int i=0; i < rootChange.getChildren().length; i++){
+ TextFileChange change = (TextFileChange)rootChange.getChildren()[i];
+ if(change.getFile().equals(file)){
+ lastChange = change;
+ return lastChange;
+ }
+ }
+ lastChange = new TextFileChange(file.getName(), file);
+ MultiTextEdit root = new MultiTextEdit();
+ lastChange.setEdit(root);
+ rootChange.add(lastChange);
+
+ return lastChange;
+ }
+
+ protected void findDeclarations(IBean bean) throws CoreException{
+ changeDeclarations(bean);
+ }
+
+
+ private boolean isBadLocation(ITextSourceReference location, IFile file){
+ boolean flag=false;
+ return flag;
+ }
+
+ private void changeXMLNode(ITextSourceReference location, IFile file){
+ if(isBadLocation(location, file))
+ return;
+
+ if(!isFileCorrect(file))
+ return;
+
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+
+ String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
+ if(text.startsWith("<")){ //$NON-NLS-1$
+ int position = text.lastIndexOf("/>"); //$NON-NLS-1$
+ if(position < 0){
+ position = text.lastIndexOf(">"); //$NON-NLS-1$
+ }
+ change(file, location.getStartPosition()+position, 0, " name=\""+getNewName()+"\""); //$NON-NLS-1$ //$NON-NLS-2$
+ }else{
+ change(file, location.getStartPosition(), location.getLength(), getNewName());
+ }
+ }
+
+ private void changeAnnotation(ITextSourceReference location, IFile file){
+ if(isBadLocation(location, file))
+ return;
+
+ if(!isFileCorrect(file))
+ return;
+
+ String content = null;
+ try {
+ content = FileUtil.readStream(file);
+ } catch (CoreException e) {
+ CDICorePlugin.getDefault().logError(e);
+ }
+
+ String text = content.substring(location.getStartPosition(), location.getStartPosition()+location.getLength());
+ int openBracket = text.indexOf("("); //$NON-NLS-1$
+ int openQuote = text.indexOf("\""); //$NON-NLS-1$
+ if(openBracket >= 0){
+ int closeBracket = text.indexOf(")", openBracket); //$NON-NLS-1$
+
+ int equals = text.indexOf("=", openBracket); //$NON-NLS-1$
+ int value = text.indexOf("value", openBracket); //$NON-NLS-1$
+
+ if(closeBracket == openBracket+1){ // empty brackets
+ String newText = "\""+getNewName()+"\""; //$NON-NLS-1$ //$NON-NLS-2$
+ change(file, location.getStartPosition()+openBracket+1, 0, newText);
+ }else if(value > 0){ // construction value="name" found so change name
+ String newText = text.replace(getOldName(), getNewName());
+ change(file, location.getStartPosition(), location.getLength(), newText);
+ }else if(equals > 0){ // other parameters are found
+ String newText = "value=\""+getNewName()+"\","; //$NON-NLS-1$ //$NON-NLS-2$
+ change(file, location.getStartPosition()+openBracket+1, 0, newText);
+ }else{ // other cases
+ String newText = text.replace(getOldName(), getNewName());
+ change(file, location.getStartPosition(), location.getLength(), newText);
+ }
+ }else if(openQuote >= 0){
+ int closeQuota = text.indexOf("\"", openQuote); //$NON-NLS-1$
+
+ if(closeQuota == openQuote+1){ // empty quotas
+ String newText = "\""+getNewName()+"\""; //$NON-NLS-1$ //$NON-NLS-2$
+ change(file, location.getStartPosition()+openQuote+1, 0, newText);
+ }else{ // the other cases
+ String newText = text.replace(getOldName(), getNewName());
+ change(file, location.getStartPosition(), location.getLength(), newText);
+ }
+ }else{
+ String newText = "(\""+getNewName()+"\")"; //$NON-NLS-1$ //$NON-NLS-2$
+ change(file, location.getStartPosition()+location.getLength(), 0, newText);
+ }
+ }
+
+
+ private void changeDeclarations(IBean bean) throws CoreException{
+ }
+
+ protected void checkDeclarations(IBean bean) throws CoreException{
+ }
+
+ protected boolean isFileCorrect(IFile file){
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ status.addFatalError(Messages.format(CDICoreMessages.CDI_RENAME_PROCESSOR_OUT_OF_SYNC_FILE, file.getFullPath().toString()));
+ return false;
+ }else if(file.isPhantom()){
+ status.addFatalError(Messages.format(CDICoreMessages.CDI_RENAME_PROCESSOR_ERROR_PHANTOM_FILE, file.getFullPath().toString()));
+ return false;
+ }else if(file.isReadOnly()){
+ status.addFatalError(Messages.format(CDICoreMessages.CDI_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
+ return false;
+ }
+ return true;
+ }
+
+
+ protected void renameBean(IProgressMonitor pm, IBean bean)throws CoreException{
+ pm.beginTask("", 3);
+
+ clearChanges();
+
+ findDeclarations(bean);
+
+ if(status.hasFatalError())
+ return;
+
+ pm.worked(1);
+
+ getSearcher().findELReferences();
+
+ pm.done();
+ }
+
+ ArrayList<String> keys = new ArrayList<String>();
+
+ private void clearChanges(){
+ keys.clear();
+ }
+
+ private void change(IFile file, int offset, int length, String text){
+ //System.out.println("change file - "+file.getFullPath()+" offset - "+offset+" len - "+length+" text"+text);
+ String key = file.getFullPath().toString()+" "+offset;
+ if(!keys.contains(key)){
+ TextFileChange change = getChange(file);
+ TextEdit edit = new ReplaceEdit(offset, length, text);
+ change.addEdit(edit);
+ keys.add(key);
+ }
+ }
+
+ class CDISearcher extends RefactorSearcher{
+ public CDISearcher(IFile declarationFile, String oldName){
+ super(declarationFile, oldName);
+ }
+
+ @Override
+ protected boolean isFileCorrect(IFile file) {
+ return CDIRenameProcessor.this.isFileCorrect(file);
+ }
+
+ @Override
+ protected void match(IFile file, int offset, int length) {
+ change(file, offset, length, newName);
+ }
+
+ protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
+ if(bean != null)
+ return invocationExpression;
+
+ ELInvocationExpression invExp = invocationExpression;
+ while(invExp != null){
+ if(invExp instanceof ELPropertyInvocation){
+ if(((ELPropertyInvocation)invExp).getQualifiedName() != null && ((ELPropertyInvocation)invExp).getQualifiedName().equals(propertyName))
+ return invExp;
+ else
+ invExp = invExp.getLeft();
+
+ }else{
+ invExp = invExp.getLeft();
+ }
+ }
+ return null;
+ }
+
+ @Override
+ protected IProject[] getProjects() {
+ return null;
+ }
+
+ @Override
+ protected IContainer getViewFolder(IProject project) {
+ return null;
+ }
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/CDIRenameProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -0,0 +1,142 @@
+ /*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.internal.core.refactoring;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.ltk.core.refactoring.Change;
+import org.eclipse.ltk.core.refactoring.CompositeChange;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext;
+import org.eclipse.ltk.core.refactoring.participants.RefactoringParticipant;
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.SharableParticipants;
+import org.jboss.tools.cdi.core.IBean;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameNamedBeanProcessor extends CDIRenameProcessor {
+ private IBean bean;
+ /**
+ * @param component Renamed component
+ */
+ public RenameNamedBeanProcessor(IBean bean) {
+ super();
+ setBean(bean);
+ }
+
+ public IBean getBean() {
+ return bean;
+ }
+
+ public void setBean(IBean bean) {
+ this.bean = bean;
+ setOldName(bean.getName());
+ }
+
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkFinalConditions(org.eclipse.core.runtime.IProgressMonitor, org.eclipse.ltk.core.refactoring.participants.CheckConditionsContext)
+ */
+ @Override
+ public RefactoringStatus checkFinalConditions(IProgressMonitor pm,
+ CheckConditionsContext context) throws CoreException,
+ OperationCanceledException {
+ status = new RefactoringStatus();
+ if(bean != null){
+ checkDeclarations(bean);
+
+ if(status.hasFatalError())
+ return status;
+
+ rootChange = new CompositeChange("Rename @Named Bean");
+
+ renameBean(pm, bean);
+ }
+ return status;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#checkInitialConditions(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public RefactoringStatus checkInitialConditions(IProgressMonitor pm)
+ throws CoreException, OperationCanceledException {
+ RefactoringStatus result = new RefactoringStatus();
+ if(bean==null) {
+ result.addFatalError("This is not a @Named Bean");
+ }
+ return result;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#createChange(org.eclipse.core.runtime.IProgressMonitor)
+ */
+ @Override
+ public Change createChange(IProgressMonitor pm) throws CoreException,
+ OperationCanceledException {
+
+ return rootChange;
+ }
+
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
+ */
+ @Override
+ public Object[] getElements() {
+ return new IBean[]{bean};
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getIdentifier()
+ */
+ @Override
+ public String getIdentifier() {
+ return getClass().getName();
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getProcessorName()
+ */
+ @Override
+ public String getProcessorName() {
+ return "Rename @Named Bean";
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
+ */
+ @Override
+ public boolean isApplicable() throws CoreException {
+ return bean!=null;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#loadParticipants(org.eclipse.ltk.core.refactoring.RefactoringStatus, org.eclipse.ltk.core.refactoring.participants.SharableParticipants)
+ */
+ @Override
+ public RefactoringParticipant[] loadParticipants(RefactoringStatus status,
+ SharableParticipants sharedParticipants) throws CoreException {
+ return EMPTY_REF_PARTICIPANT;
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/refactoring/RenameNamedBeanProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/META-INF/MANIFEST.MF 2010-04-02 16:06:43 UTC (rev 21243)
@@ -19,7 +19,15 @@
org.eclipse.wst.sse.ui,
org.jboss.tools.jst.web.kb,
org.eclipse.jdt.core;bundle-version="3.5.0",
- org.eclipse.search;bundle-version="3.5.0"
+ org.eclipse.search;bundle-version="3.5.0",
+ org.eclipse.wst.sse.core;bundle-version="1.1.400",
+ org.eclipse.ltk.ui.refactoring;bundle-version="3.4.100",
+ org.eclipse.ui.ide;bundle-version="3.5.0",
+ org.jboss.tools.common.model;bundle-version="2.0.0",
+ org.jboss.tools.common.model.ui;bundle-version="2.0.0",
+ org.jboss.tools.jst.web.ui;bundle-version="2.0.0",
+ org.eclipse.core.expressions;bundle-version="3.4.100",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-Vendor: %Bundle-Vendor.0
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/plugin.xml 2010-04-02 16:06:43 UTC (rev 21243)
@@ -106,4 +106,13 @@
nature="org.jboss.tools.cdi.core.cdinature">
</queryParticipant>
</extension>
+ <!-- Refactorng -->
+ <extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ class="org.jboss.tools.cdi.ui.refactoring.CDIRefactorContributionFactory"
+ locationURI="popup:org.eclipse.ui.popup.any?after=save">
+ </menuContribution>
+ </extension>
+
</plugin>
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -22,4 +22,9 @@
public static String INJECTION_POINT_LABEL_PROVIDER;
public static String CDI_UI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL;
public static String CDI_UI_IMAGESIMAGE_NAME_CANNOT_BE_NULL;
+
+ public static String CDI_REFACTOR_CONTRIBUTOR_MENU_NAME;
+ public static String CDI_REFACTOR_CONTRIBUTOR_ERROR;
+ public static String CDI_REFACTOR_CONTRIBUTOR_RENAME_NAMED_BEAN_ACTION_NAME;
+ public static String RENAME_NAMED_BEAN_WIZARD_FIELD_NAME;
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/CDIUIMessages.properties 2010-04-02 16:06:43 UTC (rev 21243)
@@ -11,4 +11,8 @@
INJECTION_POINT_LABEL_PROVIDER=Injected class
CDI_UI_IMAGESBASE_URL_FOR_IMAGE_REGISTRY_CANNOT_BE_NULL=Base url for image registry cannot be null.
-CDI_UI_IMAGESIMAGE_NAME_CANNOT_BE_NULL=Image name cannot be null.
\ No newline at end of file
+CDI_UI_IMAGESIMAGE_NAME_CANNOT_BE_NULL=Image name cannot be null.
+CDI_REFACTOR_CONTRIBUTOR_MENU_NAME=CDI Refactor
+CDI_REFACTOR_CONTRIBUTOR_ERROR=Error
+CDI_REFACTOR_CONTRIBUTOR_RENAME_NAMED_BEAN_ACTION_NAME=Rename Named Bean
+RENAME_NAMED_BEAN_WIZARD_FIELD_NAME=@Named Bean Name
\ No newline at end of file
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -0,0 +1,200 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.refactoring;
+
+import java.util.Set;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jdt.core.IAnnotation;
+import org.eclipse.jdt.core.ICompilationUnit;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizardOpenOperation;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.internal.services.IWorkbenchLocationService;
+import org.eclipse.ui.menus.AbstractContributionFactory;
+import org.eclipse.ui.menus.IContributionRoot;
+import org.eclipse.ui.part.FileEditorInput;
+import org.eclipse.ui.services.IServiceLocator;
+import org.jboss.tools.cdi.core.CDICoreNature;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.core.ICDIProject;
+import org.jboss.tools.cdi.internal.core.refactoring.RenameNamedBeanProcessor;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.cdi.ui.CDIUIPlugin;
+import org.jboss.tools.common.model.util.EclipseJavaUtil;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+
+/**
+ * @author Daniel Azarov
+ */
+public class CDIRefactorContributionFactory extends AbstractContributionFactory {
+ private static final String ANNOTATION_NAMED = "javax.inject.Named"; //$NON-NLS-1$
+ private static final String JAVA_EXT = "java"; //$NON-NLS-1$
+
+ static private IFile editorFile;
+ private IEditorPart editor;
+ private Shell shell;
+
+ public CDIRefactorContributionFactory(){
+ super("","");
+ }
+
+ public CDIRefactorContributionFactory(String location, String namespace){
+ super(location, namespace);
+ }
+
+ @Override
+ public void createContributionItems(IServiceLocator serviceLocator,
+ IContributionRoot additions) {
+
+ if(serviceLocator.hasService(IWorkbenchLocationService.class)){
+ IWorkbenchLocationService service = (IWorkbenchLocationService)serviceLocator.getService(IWorkbenchLocationService.class);
+ editor = service.getWorkbenchWindow().getActivePage().getActiveEditor();
+ shell = service.getWorkbench().getActiveWorkbenchWindow().getShell();
+
+ if(!(editor.getEditorInput() instanceof FileEditorInput))
+ return;
+
+ FileEditorInput input = (FileEditorInput)editor.getEditorInput();
+
+ editorFile = input.getFile();
+ String ext = editorFile.getFileExtension();
+
+ if (!JAVA_EXT.equalsIgnoreCase(ext) )
+ return;
+
+ if(CDICorePlugin.getCDI(editorFile.getProject(), true) == null)
+ return;
+
+ MenuManager mm = new MenuManager(CDIUIMessages.CDI_REFACTOR_CONTRIBUTOR_MENU_NAME);
+ mm.setVisible(true);
+
+ boolean separatorIsAdded = false;
+
+ if(JAVA_EXT.equalsIgnoreCase(ext)){
+ IBean bean = getBean(editorFile);
+ if(bean != null){
+ mm.add(new RenameNamedBeanAction());
+
+ additions.addContributionItem(new Separator(), null);
+ additions.addContributionItem(mm, null);
+ separatorIsAdded = true;
+ }
+ }
+
+ }
+ }
+
+ private IBean getBean(IFile file){
+ IProject project = file.getProject();
+ CDICoreNature cdiNature = CDICorePlugin.getCDI(file.getProject(), true);
+ if(cdiNature == null)
+ return null;
+
+ ICDIProject cdiProject = cdiNature.getDelegate();
+
+ if(cdiProject == null)
+ return null;
+
+ Set<IBean> beans = cdiProject.getBeans(file.getFullPath());
+
+ for(IBean bean : beans){
+ if(bean.getName() != null)
+ return bean;
+ }
+
+ return null;
+ }
+
+ private IAnnotation getNamedAnnotation(IFile file){
+ try{
+ ICompilationUnit unit = getCompilationUnit(file);
+ for(IType type : unit.getAllTypes()){
+ for(IAnnotation annotation : type.getAnnotations()){
+ if(EclipseJavaUtil.resolveType(type, annotation.getElementName()).equals(ANNOTATION_NAMED))
+ return annotation;
+ }
+ }
+ }catch(CoreException ex){
+ CDIUIPlugin.getDefault().logError(ex);
+ }
+ return null;
+ }
+
+ private ICompilationUnit getCompilationUnit(IFile file) throws CoreException {
+ IProject project = file.getProject();
+ IJavaProject javaProject = (IJavaProject)project.getNature(JavaCore.NATURE_ID);
+ for (IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)) {
+ if(resource.getFullPath().isPrefixOf(file.getFullPath())) {
+ IPath path = file.getFullPath().removeFirstSegments(resource.getFullPath().segmentCount());
+ IJavaElement element = javaProject.findElement(path);
+ if(element instanceof ICompilationUnit) {
+ return (ICompilationUnit)element;
+ }
+ }
+ }
+ return null;
+ }
+
+ private static void saveAndBuild(){
+ if(!CDIUIPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage().saveAllEditors(true))
+ return;
+
+ try {
+ Job.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
+ } catch (InterruptedException e) {
+ // do nothing
+ }
+ }
+
+ public static void invokeRenameNamedBeanWizard(IBean bean, Shell activeShell) {
+ saveAndBuild();
+
+ RenameNamedBeanProcessor processor = new RenameNamedBeanProcessor(bean);
+ RenameRefactoring refactoring = new RenameRefactoring(processor);
+ RenameNamedBeanWizard wizard = new RenameNamedBeanWizard(refactoring, bean);
+ RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
+ try {
+ String titleForFailedChecks = CDIUIMessages.CDI_REFACTOR_CONTRIBUTOR_ERROR;
+ op.run(activeShell, titleForFailedChecks);
+ } catch (final InterruptedException irex) {
+ // operation was canceled
+ }
+ }
+
+ class RenameNamedBeanAction extends Action{
+ public RenameNamedBeanAction(){
+ super(CDIUIMessages.CDI_REFACTOR_CONTRIBUTOR_RENAME_NAMED_BEAN_ACTION_NAME);
+ }
+
+ public void run(){
+ saveAndBuild();
+
+ IBean bean = getBean(editorFile);
+ invokeRenameNamedBeanWizard(bean, shell);
+ }
+ }
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/CDIRefactorContributionFactory.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/RenameNamedBeanWizard.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/RenameNamedBeanWizard.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/RenameNamedBeanWizard.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -0,0 +1,119 @@
+ /*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.cdi.ui.refactoring;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Map;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.jface.wizard.IWizardPage;
+import org.eclipse.ltk.core.refactoring.Refactoring;
+import org.eclipse.ltk.core.refactoring.RefactoringStatus;
+import org.eclipse.ltk.ui.refactoring.RefactoringWizard;
+import org.eclipse.ltk.ui.refactoring.UserInputWizardPage;
+import org.eclipse.osgi.util.NLS;
+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.jboss.tools.cdi.core.IBean;
+import org.jboss.tools.cdi.internal.core.refactoring.RenameNamedBeanProcessor;
+import org.jboss.tools.cdi.ui.CDIUIMessages;
+import org.jboss.tools.common.ui.IValidator;
+import org.jboss.tools.common.ui.widget.editor.CompositeEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditor;
+import org.jboss.tools.common.ui.widget.editor.IFieldEditorFactory;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameNamedBeanWizard extends RefactoringWizard {
+
+ private IBean bean;
+ private String componentName;
+ private IFieldEditor editor;
+
+ public RenameNamedBeanWizard(Refactoring refactoring, IBean bean) {
+ super(refactoring, WIZARD_BASED_USER_INTERFACE);
+ this.bean = bean;
+ if(bean != null){
+
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.RefactoringWizard#addUserInputPages()
+ */
+ @Override
+ protected void addUserInputPages() {
+ setDefaultPageTitle(getRefactoring().getName());
+ RenameNamedBeanProcessor processor= (RenameNamedBeanProcessor) getRefactoring().getAdapter(RenameNamedBeanProcessor.class);
+ addPage(new RenameNamedBeanWizardPage(processor));
+ }
+
+ class RenameNamedBeanWizardPage extends UserInputWizardPage{
+ private RenameNamedBeanProcessor processor;
+
+ public RenameNamedBeanWizardPage(RenameNamedBeanProcessor processor){
+ super("");
+ this.processor = processor;
+ }
+
+ public void createControl(Composite parent) {
+ Composite container = new Composite(parent, SWT.NULL);
+ container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
+ GridLayout layout = new GridLayout();
+ container.setLayout(layout);
+ layout.numColumns = 2;
+
+ String defaultName = bean.getName();
+ editor = IFieldEditorFactory.INSTANCE.createTextEditor(componentName, CDIUIMessages.RENAME_NAMED_BEAN_WIZARD_FIELD_NAME, defaultName);
+ editor.doFillIntoGrid(container);
+
+ ((CompositeEditor)editor).addPropertyChangeListener(new PropertyChangeListener(){
+ public void propertyChange(PropertyChangeEvent evt){
+ validatePage();
+ }
+ });
+ setControl(container);
+ setPageComplete(false);
+ }
+
+ protected final void validatePage() {
+ RefactoringStatus status= new RefactoringStatus();
+ setPageComplete(status);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.UserInputWizardPage#performFinish()
+ */
+ protected boolean performFinish() {
+
+ initializeRefactoring();
+ return super.performFinish();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.UserInputWizardPage#getNextPage()
+ */
+ public IWizardPage getNextPage() {
+ initializeRefactoring();
+ return super.getNextPage();
+ }
+
+ private void initializeRefactoring() {
+ processor.setNewName(editor.getValueAsString());
+ }
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.ui/src/org/jboss/tools/cdi/ui/refactoring/RenameNamedBeanWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/ELRenameProcessor.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/ELRenameProcessor.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/ELRenameProcessor.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -31,6 +31,7 @@
import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
import org.jboss.tools.common.model.project.ProjectHome;
import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
/**
* @author Daniel Azarov
Deleted: trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf/src/org/jboss/tools/jsf/el/refactoring/RefactorSearcher.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -1,493 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.jsf.el.refactoring;
-
-import java.util.List;
-import java.util.StringTokenizer;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IMethod;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.jboss.tools.common.el.core.ELCorePlugin;
-import org.jboss.tools.common.el.core.ELReference;
-import org.jboss.tools.common.el.core.model.ELExpression;
-import org.jboss.tools.common.el.core.model.ELInstance;
-import org.jboss.tools.common.el.core.model.ELInvocationExpression;
-import org.jboss.tools.common.el.core.model.ELMethodInvocation;
-import org.jboss.tools.common.el.core.model.ELModel;
-import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
-import org.jboss.tools.common.el.core.parser.ELParser;
-import org.jboss.tools.common.el.core.parser.ELParserUtil;
-import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.el.core.resolver.ELResolution;
-import org.jboss.tools.common.el.core.resolver.ELResolver;
-import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
-import org.jboss.tools.common.el.core.resolver.ELSegment;
-import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
-import org.jboss.tools.common.el.core.resolver.SimpleELContext;
-import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.common.model.util.EclipseResourceUtil;
-import org.jboss.tools.common.util.FileUtil;
-import org.jboss.tools.jst.web.kb.PageContextFactory;
-
-public abstract class RefactorSearcher {
- protected static final String JAVA_EXT = "java"; //$NON-NLS-1$
- protected static final String XML_EXT = "xml"; //$NON-NLS-1$
- protected static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
- protected static final String JSP_EXT = "jsp"; //$NON-NLS-1$
- protected static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
-
- private static final String GET = "get"; //$NON-NLS-1$
- private static final String SET = "set"; //$NON-NLS-1$
- private static final String IS = "is"; //$NON-NLS-1$
-
- protected static final String SEAM_PROPERTIES_FILE = "seam.properties"; //$NON-NLS-1$
-
- protected IFile baseFile;
- protected String propertyName;
- protected IJavaElement javaElement;
- protected IJavaSearchScope searchScope;
-
-
- public RefactorSearcher(IFile baseFile, String propertyName){
- this.baseFile = baseFile;
- this.propertyName = propertyName;
- }
-
- public RefactorSearcher(IFile baseFile, String propertyName, IJavaElement javaElement){
- this(baseFile, propertyName);
- this.javaElement = javaElement;
- }
-
- public void setSearchScope(IJavaSearchScope searchScope){
- this.searchScope = searchScope;
- }
-
- public void findELReferences(){
- if(baseFile == null)
- return;
-
- //startStatistics();
-
- IProject[] projects = getProjects();
- for (IProject project : projects) {
- if(project == null) continue;
-
- if(!containsInSearchScope(project))
- continue;
-
- updateEnvironment(project);
-
- IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
-
- // searching java, xml and property files in source folders
- if(javaProject != null){
- for(IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)){
- if(resource instanceof IFolder)
- scanForJava((IFolder) resource);
- else if(resource instanceof IFile)
- scanForJava((IFile) resource);
- }
- }
-
- // searching jsp, xhtml and xml files in WebContent folders
-
- if(getViewFolder(project) != null)
- scan(getViewFolder(project));
- else
- scan(project);
- }
- //stopStatistic();
- }
-
- protected void updateEnvironment(IProject project){
-
- }
-
- protected abstract IProject[] getProjects();
-
- protected abstract IContainer getViewFolder(IProject project);
-
- private void scanForJava(IContainer container){
- try{
- for(IResource resource : container.members()){
- if(resource instanceof IFolder)
- scanForJava((IFolder) resource);
- else if(resource instanceof IFile)
- scanForJava((IFile) resource);
- }
- }catch(CoreException ex){
- ELCorePlugin.getDefault().logError(ex);
- }
- }
-
- private void scan(IContainer container){
- try{
- for(IResource resource : container.members()){
- if(resource instanceof IFolder)
- scan((IFolder) resource);
- else if(resource instanceof IFile)
- scan((IFile) resource);
- }
- }catch(CoreException ex){
- ELCorePlugin.getDefault().logError(ex);
- }
- }
-
- private String getFileContent(IFile file){
- try {
- return FileUtil.readStream(file);
- //collectStatistic(content.length());
- } catch (CoreException e) {
- ELCorePlugin.getDefault().logError(e);
- }
- return null;
- }
-
- private void scanForJava(IFile file){
- if(isFileCorrect(file)) {
- if(PROPERTIES_EXT.equalsIgnoreCase(file.getFileExtension())){
- if(file.getName().equals(SEAM_PROPERTIES_FILE)){
- String content = getFileContent(file);
- scanProperties(file, content);
- }else
- searchInCach(file);
- } else if (JAVA_EXT.equalsIgnoreCase(file.getFileExtension())
- || JSP_EXT.equalsIgnoreCase(file.getFileExtension())
- || XHTML_EXT.equalsIgnoreCase(file.getFileExtension())
- || XML_EXT.equalsIgnoreCase(file.getFileExtension())) {
- searchInCach(file);
- }
- }
- }
-
- private void scan(IFile file){
- if(isFileCorrect(file)) {
- String ext = file.getFileExtension();
- if(XML_EXT.equalsIgnoreCase(ext)
- || XHTML_EXT.equalsIgnoreCase(ext)
- || JSP_EXT.equalsIgnoreCase(ext)) {
- searchInCach(file);
- }
- }
- }
-
- private void searchInCach(IFile file){
- ELContext context = PageContextFactory.createPageContext(file);
-
- if(context == null)
- return;
-
- ELReference[] references = context.getELReferences();
- ELResolver[] resolvers = context.getElResolvers();
-
- if(javaElement != null){
- for(ELReference reference : references){
- int offset = reference.getStartPosition();
- for(ELExpression operand : reference.getEl()){
- for (ELResolver resolver : resolvers) {
- if (!(resolver instanceof ELCompletionEngine))
- continue;
-
- ELResolution resolution = resolver.resolve(context, operand, offset);
-
- if(resolution == null)
- continue;
-
- List<ELSegment> segments = resolution.findSegmentsByJavaElement(javaElement);
-
- for(ELSegment segment : segments){
- match(file, offset+segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength());
- }
- }
- }
- }
- }else{
- for(ELReference reference : references){
- int offset = reference.getStartPosition();
- ELExpression[] expressions = reference.getEl();
- for(ELExpression operand : expressions){
- if(operand instanceof ELInvocationExpression){
- ELInvocationExpression expression = findComponentReference((ELInvocationExpression)operand);
- if(expression != null){
- checkMatch(file, expression, offset+getOffset(expression), getLength(expression));
- }
- }
- }
- }
- }
-
- }
-
-
- // looking for component references in EL
- private void scanString(IFile file, String string, int offset) {
- int startEl = string.indexOf("#{"); //$NON-NLS-1$
- if(startEl<0)
- startEl = string.indexOf("${"); //$NON-NLS-1$
- if(startEl>-1) {
- ELParser parser = ELParserUtil.getJbossFactory().createParser();
- ELModel model = parser.parse(string);
- for (ELInstance instance : model.getInstances()) {
- for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELInvocationExpression expression = findComponentReference(ie);
- if(expression != null){
- checkMatch(file, expression, offset+getOffset(expression), getLength(expression));
- }
- }
- }
- }
- }
-
- protected int getOffset(ELInvocationExpression expression){
- if(expression instanceof ELPropertyInvocation){
- ELPropertyInvocation pi = (ELPropertyInvocation)expression;
-
- if(pi.getName() != null)
- return pi.getName().getStart();
- }else if(expression instanceof ELMethodInvocation){
- ELMethodInvocation mi = (ELMethodInvocation)expression;
-
- if(mi.getName() != null)
- return mi.getName().getStart();
- }
- return 0;
- }
-
- private int getLength(ELInvocationExpression expression){
- if(expression instanceof ELPropertyInvocation){
- ELPropertyInvocation pi = (ELPropertyInvocation)expression;
-
- if(pi.getName() != null)
- return pi.getName().getLength();
- }else if(expression instanceof ELMethodInvocation){
- ELMethodInvocation mi = (ELMethodInvocation)expression;
-
- if(mi.getName() != null)
- return mi.getName().getLength();
- }
- return 0;
- }
-
- private void scanProperties(IFile file, String content){
- //scanString(file, content, 0);
-
- if(!file.getName().equals(SEAM_PROPERTIES_FILE))
- return;
-
- StringTokenizer tokenizer = new StringTokenizer(content, "#= \t\r\n\f", true); //$NON-NLS-1$
-
- String lastToken = "\n"; //$NON-NLS-1$
- int offset = 0;
- boolean comment = false;
- boolean key = true;
-
- while(tokenizer.hasMoreTokens()){
- String token = tokenizer.nextToken("#= \t\r\n\f"); //$NON-NLS-1$
- if(token.equals("\r")) //$NON-NLS-1$
- token = "\n"; //$NON-NLS-1$
-
- if(token.equals("#") && lastToken.equals("\n")) //$NON-NLS-1$ //$NON-NLS-2$
- comment = true;
- else if(token.equals("\n") && comment) //$NON-NLS-1$
- comment = false;
-
- if(!comment){
- if(!token.equals("\n") && lastToken.equals("\n")) //$NON-NLS-1$ //$NON-NLS-2$
- key = true;
- else if(key && (token.equals("=") || token.equals(" "))) //$NON-NLS-1$ //$NON-NLS-2$
- key = false;
-
- if(key && token.startsWith(propertyName)){
- match(file, offset, token.length());
- }
- }
-
- lastToken = token;
- offset += token.length();
- }
- }
-
- protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
- return invocationExpression;
- }
-
- protected abstract boolean isFileCorrect(IFile file);
-
- protected abstract void match(IFile file, int offset, int length);
-
- protected void checkMatch(IFile file, ELExpression operand, int offset, int length){
- if(javaElement != null && operand != null)
- resolve(file, operand, offset-getOffset((ELInvocationExpression)operand));
- else
- match(file, offset, length);
- }
-
- // TODO: move to util class
- public static boolean isGetter(IMethod method) {
- String name = method.getElementName();
- int numberOfParameters = method.getNumberOfParameters();
-
- return (((name.startsWith(GET) && !name.equals(GET)) || name.startsWith(IS)) && numberOfParameters == 0);
- }
-
- // TODO: move to util class
- public static boolean isSetter(IMethod method) {
- String name = method.getElementName();
- int numberOfParameters = method.getNumberOfParameters();
-
- return ((name.startsWith(SET) && !name.equals(SET)) && numberOfParameters == 1);
- }
-
- // TODO: move to util class
- public static String getPropertyName(IMethod method, String methodName){
- if (isGetter(method) || isSetter(method)) {
- StringBuffer name = new StringBuffer(methodName);
- if(methodName.startsWith("i")) { //$NON-NLS-1$
- name.delete(0, 2);
- } else {
- name.delete(0, 3);
- }
- if(name.length()<2 || Character.isLowerCase(name.charAt(1))) {
- name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
- }
- String propertyName = name.toString();
- return propertyName;
- }
- return methodName;
- }
-
- public static String getPropertyName(IType method, String className){
- StringBuffer name = new StringBuffer(className);
- if(name.length()<2 || Character.isLowerCase(name.charAt(1))) {
- name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
- }
- String propertyName = name.toString();
- return propertyName;
- }
-
- private boolean containsInSearchScope(IProject project){
- if(searchScope == null)
- return true;
- IPath[] paths = searchScope.enclosingProjectsAndJars();
- for(IPath path : paths){
- if(path.equals(project.getFullPath()))
- return true;
- }
- return false;
- }
-
- protected void resolve(IFile file, ELExpression operand, int offset) {
- ELResolver[] resolvers = ELResolverFactoryManager.getInstance()
- .getResolvers(file);
-
- for (ELResolver resolver : resolvers) {
- if (!(resolver instanceof ELCompletionEngine))
- continue;
-
- SimpleELContext context = new SimpleELContext();
-
- context.setResource(file);
- context.setElResolvers(resolvers);
-
- List<Var> vars = ElVarSearcher.findAllVars(context, offset,
- resolver);
-
- context.setVars(vars);
-
- ELResolution resolution = resolver.resolve(context, operand, offset);
- if(resolution!=null) {
- List<ELSegment> segments = resolution.findSegmentsByJavaElement(javaElement);
-
- for(ELSegment segment : segments){
- match(file, offset+segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength());
- }
- }
- }
- }
- // performance measure
-// private int totalSize = 0;
-// private int filesNumber = 0;
-// private long startTime = 0;
-// private long stopTime = 0;
-// private long startMem = 0;
-// private long stopMem = 0;
-//
-// private boolean log = false;
-//
-// private void clearHistory(){
-// totalSize = 0;
-// filesNumber = 0;
-// startTime = 0;
-// stopTime = 0;
-// startMem = 0;
-// stopMem = 0;
-// }
-//
-// private void startStatistics(){
-// clearHistory();
-// startTime = System.currentTimeMillis();
-// startMem = Runtime.getRuntime().freeMemory();
-// }
-//
-// private void stopStatistic(){
-// stopTime = System.currentTimeMillis();
-// stopMem = Runtime.getRuntime().freeMemory();
-// printELSearchStatistics();
-// }
-//
-// private void collectStatistic(int fileSize){
-// filesNumber++;
-// totalSize += fileSize;
-// }
-//
-// private void printELSearchStatistics(){
-// if(log){
-// System.out.println("EL Search"); //$NON-NLS-1$
-// System.out.println("Total files number: "+getFilesNumber()); //$NON-NLS-1$
-// System.out.println("Total files size: "+getTotlalFilesSize()+" Mb"); //$NON-NLS-1$ $NON-NLS-2$
-// System.out.println("Memory usage size: "+getTotlalMemorySize()+" Mb"); //$NON-NLS-1$ $NON-NLS-2$
-// System.out.println("Free Memory size: "+getRestMemorySize()+" Mb"); //$NON-NLS-1$ $NON-NLS-2$
-// System.out.println("Total time: "+getTotalTime()+" sec"); //$NON-NLS-1$ $NON-NLS-2$
-// }
-// }
-//
-// private double getTotlalFilesSize(){
-// return (double)totalSize/(1024*1025);
-// }
-//
-// private double getTotlalMemorySize(){
-// return (double)(startMem-stopMem)/(1024*1025);
-// }
-//
-// private double getRestMemorySize(){
-// return (double)stopMem/(1024*1025);
-// }
-//
-// private int getFilesNumber(){
-// return filesNumber;
-// }
-//
-// private double getTotalTime(){
-// return (double)(stopTime - startTime)/1000;
-// }
-
-}
\ No newline at end of file
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELReferencesQueryParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELReferencesQueryParticipant.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/ELReferencesQueryParticipant.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -30,7 +30,7 @@
import org.jboss.tools.common.model.project.ProjectHome;
import org.jboss.tools.jsf.el.refactoring.ELProjectSetExtension;
import org.jboss.tools.jsf.el.refactoring.ProjectsSet;
-import org.jboss.tools.jsf.el.refactoring.RefactorSearcher;
+import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
public class ELReferencesQueryParticipant implements IQueryParticipant{
private ELSearcher searcher;
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/el/refactoring/RenameMethodParticipant.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -35,8 +35,8 @@
import org.jboss.tools.common.model.project.ProjectHome;
import org.jboss.tools.jsf.el.refactoring.ELProjectSetExtension;
import org.jboss.tools.jsf.el.refactoring.ProjectsSet;
-import org.jboss.tools.jsf.el.refactoring.RefactorSearcher;
import org.jboss.tools.jsf.ui.JsfUIMessages;
+import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
public class RenameMethodParticipant extends RenameParticipant{
private IJavaElement element;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/META-INF/MANIFEST.MF 2010-04-02 16:06:43 UTC (rev 21243)
@@ -39,5 +39,6 @@
org.jboss.tools.jst.web.kb.internal.taglib,
org.jboss.tools.jst.web.kb.internal.taglib.composite,
org.jboss.tools.jst.web.kb.internal.validation,
+ org.jboss.tools.jst.web.kb.refactoring,
org.jboss.tools.jst.web.kb.taglib,
org.jboss.tools.jst.web.kb.validation
Added: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/refactoring/RefactorSearcher.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -0,0 +1,493 @@
+/*******************************************************************************
+ * Copyright (c) 2009 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.kb.refactoring;
+
+import java.util.List;
+import java.util.StringTokenizer;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.IMethod;
+import org.eclipse.jdt.core.IType;
+import org.eclipse.jdt.core.search.IJavaSearchScope;
+import org.jboss.tools.common.el.core.ELCorePlugin;
+import org.jboss.tools.common.el.core.ELReference;
+import org.jboss.tools.common.el.core.model.ELExpression;
+import org.jboss.tools.common.el.core.model.ELInstance;
+import org.jboss.tools.common.el.core.model.ELInvocationExpression;
+import org.jboss.tools.common.el.core.model.ELMethodInvocation;
+import org.jboss.tools.common.el.core.model.ELModel;
+import org.jboss.tools.common.el.core.model.ELPropertyInvocation;
+import org.jboss.tools.common.el.core.parser.ELParser;
+import org.jboss.tools.common.el.core.parser.ELParserUtil;
+import org.jboss.tools.common.el.core.resolver.ELCompletionEngine;
+import org.jboss.tools.common.el.core.resolver.ELContext;
+import org.jboss.tools.common.el.core.resolver.ELResolution;
+import org.jboss.tools.common.el.core.resolver.ELResolver;
+import org.jboss.tools.common.el.core.resolver.ELResolverFactoryManager;
+import org.jboss.tools.common.el.core.resolver.ELSegment;
+import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
+import org.jboss.tools.common.el.core.resolver.SimpleELContext;
+import org.jboss.tools.common.el.core.resolver.Var;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.web.kb.PageContextFactory;
+
+public abstract class RefactorSearcher {
+ protected static final String JAVA_EXT = "java"; //$NON-NLS-1$
+ protected static final String XML_EXT = "xml"; //$NON-NLS-1$
+ protected static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
+ protected static final String JSP_EXT = "jsp"; //$NON-NLS-1$
+ protected static final String PROPERTIES_EXT = "properties"; //$NON-NLS-1$
+
+ private static final String GET = "get"; //$NON-NLS-1$
+ private static final String SET = "set"; //$NON-NLS-1$
+ private static final String IS = "is"; //$NON-NLS-1$
+
+ protected static final String SEAM_PROPERTIES_FILE = "seam.properties"; //$NON-NLS-1$
+
+ protected IFile baseFile;
+ protected String propertyName;
+ protected IJavaElement javaElement;
+ protected IJavaSearchScope searchScope;
+
+
+ public RefactorSearcher(IFile baseFile, String propertyName){
+ this.baseFile = baseFile;
+ this.propertyName = propertyName;
+ }
+
+ public RefactorSearcher(IFile baseFile, String propertyName, IJavaElement javaElement){
+ this(baseFile, propertyName);
+ this.javaElement = javaElement;
+ }
+
+ public void setSearchScope(IJavaSearchScope searchScope){
+ this.searchScope = searchScope;
+ }
+
+ public void findELReferences(){
+ if(baseFile == null)
+ return;
+
+ //startStatistics();
+
+ IProject[] projects = getProjects();
+ for (IProject project : projects) {
+ if(project == null) continue;
+
+ if(!containsInSearchScope(project))
+ continue;
+
+ updateEnvironment(project);
+
+ IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
+
+ // searching java, xml and property files in source folders
+ if(javaProject != null){
+ for(IResource resource : EclipseResourceUtil.getJavaSourceRoots(project)){
+ if(resource instanceof IFolder)
+ scanForJava((IFolder) resource);
+ else if(resource instanceof IFile)
+ scanForJava((IFile) resource);
+ }
+ }
+
+ // searching jsp, xhtml and xml files in WebContent folders
+
+ if(getViewFolder(project) != null)
+ scan(getViewFolder(project));
+ else
+ scan(project);
+ }
+ //stopStatistic();
+ }
+
+ protected void updateEnvironment(IProject project){
+
+ }
+
+ protected abstract IProject[] getProjects();
+
+ protected abstract IContainer getViewFolder(IProject project);
+
+ private void scanForJava(IContainer container){
+ try{
+ for(IResource resource : container.members()){
+ if(resource instanceof IFolder)
+ scanForJava((IFolder) resource);
+ else if(resource instanceof IFile)
+ scanForJava((IFile) resource);
+ }
+ }catch(CoreException ex){
+ ELCorePlugin.getDefault().logError(ex);
+ }
+ }
+
+ private void scan(IContainer container){
+ try{
+ for(IResource resource : container.members()){
+ if(resource instanceof IFolder)
+ scan((IFolder) resource);
+ else if(resource instanceof IFile)
+ scan((IFile) resource);
+ }
+ }catch(CoreException ex){
+ ELCorePlugin.getDefault().logError(ex);
+ }
+ }
+
+ private String getFileContent(IFile file){
+ try {
+ return FileUtil.readStream(file);
+ //collectStatistic(content.length());
+ } catch (CoreException e) {
+ ELCorePlugin.getDefault().logError(e);
+ }
+ return null;
+ }
+
+ private void scanForJava(IFile file){
+ if(isFileCorrect(file)) {
+ if(PROPERTIES_EXT.equalsIgnoreCase(file.getFileExtension())){
+ if(file.getName().equals(SEAM_PROPERTIES_FILE)){
+ String content = getFileContent(file);
+ scanProperties(file, content);
+ }else
+ searchInCach(file);
+ } else if (JAVA_EXT.equalsIgnoreCase(file.getFileExtension())
+ || JSP_EXT.equalsIgnoreCase(file.getFileExtension())
+ || XHTML_EXT.equalsIgnoreCase(file.getFileExtension())
+ || XML_EXT.equalsIgnoreCase(file.getFileExtension())) {
+ searchInCach(file);
+ }
+ }
+ }
+
+ private void scan(IFile file){
+ if(isFileCorrect(file)) {
+ String ext = file.getFileExtension();
+ if(XML_EXT.equalsIgnoreCase(ext)
+ || XHTML_EXT.equalsIgnoreCase(ext)
+ || JSP_EXT.equalsIgnoreCase(ext)) {
+ searchInCach(file);
+ }
+ }
+ }
+
+ private void searchInCach(IFile file){
+ ELContext context = PageContextFactory.createPageContext(file);
+
+ if(context == null)
+ return;
+
+ ELReference[] references = context.getELReferences();
+ ELResolver[] resolvers = context.getElResolvers();
+
+ if(javaElement != null){
+ for(ELReference reference : references){
+ int offset = reference.getStartPosition();
+ for(ELExpression operand : reference.getEl()){
+ for (ELResolver resolver : resolvers) {
+ if (!(resolver instanceof ELCompletionEngine))
+ continue;
+
+ ELResolution resolution = resolver.resolve(context, operand, offset);
+
+ if(resolution == null)
+ continue;
+
+ List<ELSegment> segments = resolution.findSegmentsByJavaElement(javaElement);
+
+ for(ELSegment segment : segments){
+ match(file, offset+segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength());
+ }
+ }
+ }
+ }
+ }else{
+ for(ELReference reference : references){
+ int offset = reference.getStartPosition();
+ ELExpression[] expressions = reference.getEl();
+ for(ELExpression operand : expressions){
+ if(operand instanceof ELInvocationExpression){
+ ELInvocationExpression expression = findComponentReference((ELInvocationExpression)operand);
+ if(expression != null){
+ checkMatch(file, expression, offset+getOffset(expression), getLength(expression));
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+
+ // looking for component references in EL
+ private void scanString(IFile file, String string, int offset) {
+ int startEl = string.indexOf("#{"); //$NON-NLS-1$
+ if(startEl<0)
+ startEl = string.indexOf("${"); //$NON-NLS-1$
+ if(startEl>-1) {
+ ELParser parser = ELParserUtil.getJbossFactory().createParser();
+ ELModel model = parser.parse(string);
+ for (ELInstance instance : model.getInstances()) {
+ for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
+ ELInvocationExpression expression = findComponentReference(ie);
+ if(expression != null){
+ checkMatch(file, expression, offset+getOffset(expression), getLength(expression));
+ }
+ }
+ }
+ }
+ }
+
+ protected int getOffset(ELInvocationExpression expression){
+ if(expression instanceof ELPropertyInvocation){
+ ELPropertyInvocation pi = (ELPropertyInvocation)expression;
+
+ if(pi.getName() != null)
+ return pi.getName().getStart();
+ }else if(expression instanceof ELMethodInvocation){
+ ELMethodInvocation mi = (ELMethodInvocation)expression;
+
+ if(mi.getName() != null)
+ return mi.getName().getStart();
+ }
+ return 0;
+ }
+
+ private int getLength(ELInvocationExpression expression){
+ if(expression instanceof ELPropertyInvocation){
+ ELPropertyInvocation pi = (ELPropertyInvocation)expression;
+
+ if(pi.getName() != null)
+ return pi.getName().getLength();
+ }else if(expression instanceof ELMethodInvocation){
+ ELMethodInvocation mi = (ELMethodInvocation)expression;
+
+ if(mi.getName() != null)
+ return mi.getName().getLength();
+ }
+ return 0;
+ }
+
+ private void scanProperties(IFile file, String content){
+ //scanString(file, content, 0);
+
+ if(!file.getName().equals(SEAM_PROPERTIES_FILE))
+ return;
+
+ StringTokenizer tokenizer = new StringTokenizer(content, "#= \t\r\n\f", true); //$NON-NLS-1$
+
+ String lastToken = "\n"; //$NON-NLS-1$
+ int offset = 0;
+ boolean comment = false;
+ boolean key = true;
+
+ while(tokenizer.hasMoreTokens()){
+ String token = tokenizer.nextToken("#= \t\r\n\f"); //$NON-NLS-1$
+ if(token.equals("\r")) //$NON-NLS-1$
+ token = "\n"; //$NON-NLS-1$
+
+ if(token.equals("#") && lastToken.equals("\n")) //$NON-NLS-1$ //$NON-NLS-2$
+ comment = true;
+ else if(token.equals("\n") && comment) //$NON-NLS-1$
+ comment = false;
+
+ if(!comment){
+ if(!token.equals("\n") && lastToken.equals("\n")) //$NON-NLS-1$ //$NON-NLS-2$
+ key = true;
+ else if(key && (token.equals("=") || token.equals(" "))) //$NON-NLS-1$ //$NON-NLS-2$
+ key = false;
+
+ if(key && token.startsWith(propertyName)){
+ match(file, offset, token.length());
+ }
+ }
+
+ lastToken = token;
+ offset += token.length();
+ }
+ }
+
+ protected ELInvocationExpression findComponentReference(ELInvocationExpression invocationExpression){
+ return invocationExpression;
+ }
+
+ protected abstract boolean isFileCorrect(IFile file);
+
+ protected abstract void match(IFile file, int offset, int length);
+
+ protected void checkMatch(IFile file, ELExpression operand, int offset, int length){
+ if(javaElement != null && operand != null)
+ resolve(file, operand, offset-getOffset((ELInvocationExpression)operand));
+ else
+ match(file, offset, length);
+ }
+
+ // TODO: move to util class
+ public static boolean isGetter(IMethod method) {
+ String name = method.getElementName();
+ int numberOfParameters = method.getNumberOfParameters();
+
+ return (((name.startsWith(GET) && !name.equals(GET)) || name.startsWith(IS)) && numberOfParameters == 0);
+ }
+
+ // TODO: move to util class
+ public static boolean isSetter(IMethod method) {
+ String name = method.getElementName();
+ int numberOfParameters = method.getNumberOfParameters();
+
+ return ((name.startsWith(SET) && !name.equals(SET)) && numberOfParameters == 1);
+ }
+
+ // TODO: move to util class
+ public static String getPropertyName(IMethod method, String methodName){
+ if (isGetter(method) || isSetter(method)) {
+ StringBuffer name = new StringBuffer(methodName);
+ if(methodName.startsWith("i")) { //$NON-NLS-1$
+ name.delete(0, 2);
+ } else {
+ name.delete(0, 3);
+ }
+ if(name.length()<2 || Character.isLowerCase(name.charAt(1))) {
+ name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
+ }
+ String propertyName = name.toString();
+ return propertyName;
+ }
+ return methodName;
+ }
+
+ public static String getPropertyName(IType method, String className){
+ StringBuffer name = new StringBuffer(className);
+ if(name.length()<2 || Character.isLowerCase(name.charAt(1))) {
+ name.setCharAt(0, Character.toLowerCase(name.charAt(0)));
+ }
+ String propertyName = name.toString();
+ return propertyName;
+ }
+
+ private boolean containsInSearchScope(IProject project){
+ if(searchScope == null)
+ return true;
+ IPath[] paths = searchScope.enclosingProjectsAndJars();
+ for(IPath path : paths){
+ if(path.equals(project.getFullPath()))
+ return true;
+ }
+ return false;
+ }
+
+ protected void resolve(IFile file, ELExpression operand, int offset) {
+ ELResolver[] resolvers = ELResolverFactoryManager.getInstance()
+ .getResolvers(file);
+
+ for (ELResolver resolver : resolvers) {
+ if (!(resolver instanceof ELCompletionEngine))
+ continue;
+
+ SimpleELContext context = new SimpleELContext();
+
+ context.setResource(file);
+ context.setElResolvers(resolvers);
+
+ List<Var> vars = ElVarSearcher.findAllVars(context, offset,
+ resolver);
+
+ context.setVars(vars);
+
+ ELResolution resolution = resolver.resolve(context, operand, offset);
+ if(resolution!=null) {
+ List<ELSegment> segments = resolution.findSegmentsByJavaElement(javaElement);
+
+ for(ELSegment segment : segments){
+ match(file, offset+segment.getSourceReference().getStartPosition(), segment.getSourceReference().getLength());
+ }
+ }
+ }
+ }
+ // performance measure
+// private int totalSize = 0;
+// private int filesNumber = 0;
+// private long startTime = 0;
+// private long stopTime = 0;
+// private long startMem = 0;
+// private long stopMem = 0;
+//
+// private boolean log = false;
+//
+// private void clearHistory(){
+// totalSize = 0;
+// filesNumber = 0;
+// startTime = 0;
+// stopTime = 0;
+// startMem = 0;
+// stopMem = 0;
+// }
+//
+// private void startStatistics(){
+// clearHistory();
+// startTime = System.currentTimeMillis();
+// startMem = Runtime.getRuntime().freeMemory();
+// }
+//
+// private void stopStatistic(){
+// stopTime = System.currentTimeMillis();
+// stopMem = Runtime.getRuntime().freeMemory();
+// printELSearchStatistics();
+// }
+//
+// private void collectStatistic(int fileSize){
+// filesNumber++;
+// totalSize += fileSize;
+// }
+//
+// private void printELSearchStatistics(){
+// if(log){
+// System.out.println("EL Search"); //$NON-NLS-1$
+// System.out.println("Total files number: "+getFilesNumber()); //$NON-NLS-1$
+// System.out.println("Total files size: "+getTotlalFilesSize()+" Mb"); //$NON-NLS-1$ $NON-NLS-2$
+// System.out.println("Memory usage size: "+getTotlalMemorySize()+" Mb"); //$NON-NLS-1$ $NON-NLS-2$
+// System.out.println("Free Memory size: "+getRestMemorySize()+" Mb"); //$NON-NLS-1$ $NON-NLS-2$
+// System.out.println("Total time: "+getTotalTime()+" sec"); //$NON-NLS-1$ $NON-NLS-2$
+// }
+// }
+//
+// private double getTotlalFilesSize(){
+// return (double)totalSize/(1024*1025);
+// }
+//
+// private double getTotlalMemorySize(){
+// return (double)(startMem-stopMem)/(1024*1025);
+// }
+//
+// private double getRestMemorySize(){
+// return (double)stopMem/(1024*1025);
+// }
+//
+// private int getFilesNumber(){
+// return filesNumber;
+// }
+//
+// private double getTotalTime(){
+// return (double)(stopTime - startTime)/1000;
+// }
+
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2010-04-02 15:19:07 UTC (rev 21242)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/refactoring/SeamRefactorSearcher.java 2010-04-02 16:06:43 UTC (rev 21243)
@@ -28,7 +28,7 @@
import org.jboss.tools.common.el.core.resolver.ElVarSearcher;
import org.jboss.tools.common.el.core.resolver.SimpleELContext;
import org.jboss.tools.common.el.core.resolver.Var;
-import org.jboss.tools.jsf.el.refactoring.RefactorSearcher;
+import org.jboss.tools.jst.web.kb.refactoring.RefactorSearcher;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
14 years, 9 months
JBoss Tools SVN: r21242 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-02 11:19:07 -0400 (Fri, 02 Apr 2010)
New Revision: 21242
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6125 - remove unused methods and classes
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-04-02 15:09:39 UTC (rev 21241)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-04-02 15:19:07 UTC (rev 21242)
@@ -13,7 +13,6 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.SafeRunner;
import org.eclipse.jface.util.Assert;
import org.eclipse.jface.util.SafeRunnable;
@@ -33,22 +32,16 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.IKeyBindingService;
import org.eclipse.ui.INestableKeyBindingService;
-import org.eclipse.ui.IPartListener;
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.part.EditorPart;
import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
import org.eclipse.ui.part.MultiPageEditorSite;
import org.eclipse.ui.part.MultiPageSelectionProvider;
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
-import org.jboss.tools.common.reporting.ProblemReportingHelper;
-import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
/**
*
@@ -334,28 +327,5 @@
protected void setPageText(int pageIndex, String text) {
getItem(pageIndex).setText(text);
}
-
-
- private class ActivationListener implements IPartListener {
-
- public void partActivated(IWorkbenchPart part) {
-
- }
-
- public void partBroughtToTop(IWorkbenchPart part) {
-
- }
-
- public void partClosed(IWorkbenchPart part) {
-
- }
-
- public void partDeactivated(IWorkbenchPart part) {
-
- }
-
- public void partOpened(IWorkbenchPart part) {
-
- }
- }
+
}
14 years, 9 months
JBoss Tools SVN: r21241 - trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-02 11:09:39 -0400 (Fri, 02 Apr 2010)
New Revision: 21241
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java
Log:
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java 2010-04-02 15:07:28 UTC (rev 21240)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java 2010-04-02 15:09:39 UTC (rev 21241)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.ui.editor.check;
import org.eclipse.core.resources.IProject;
@@ -3,4 +14,10 @@
import org.jboss.tools.jsf.ui.action.AddJSFNatureActionDelegate;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
public class AddJSFCapabilitiesDelegate extends AddJSFNatureActionDelegate {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java 2010-04-02 15:07:28 UTC (rev 21240)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java 2010-04-02 15:09:39 UTC (rev 21241)
@@ -1,3 +1,14 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
package org.jboss.tools.jsf.ui.editor.check;
import org.eclipse.core.runtime.CoreException;
@@ -10,6 +21,12 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
public class ProjectNaturesPartListener implements IPartListener {
public void partActivated(IWorkbenchPart part) {
14 years, 9 months
JBoss Tools SVN: r21240 - in trunk: jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2010-04-02 11:07:28 -0400 (Fri, 02 Apr 2010)
New Revision: 21240
Added:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6125 - completed
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2010-04-02 13:04:21 UTC (rev 21239)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/JsfUiPlugin.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -12,12 +12,18 @@
import org.eclipse.core.runtime.Platform;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
+import org.jboss.tools.jsf.ui.editor.check.ProjectNaturesChecker;
+import org.jboss.tools.jsf.ui.editor.check.ProjectNaturesPartListener;
import org.osgi.framework.BundleContext;
public class JsfUiPlugin extends BaseUIPlugin {
+ private ProjectNaturesPartListener partListener = new ProjectNaturesPartListener();
+
public static String PLUGIN_ID = "org.jboss.tools.jsf.ui"; //$NON-NLS-1$
public JsfUiPlugin() {
@@ -25,6 +31,8 @@
public void start(BundleContext context) throws Exception {
super.start(context);
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ window.getPartService().addPartListener(partListener);
}
public static JsfUiPlugin getDefault() {
@@ -49,4 +57,18 @@
public static IPluginLog getPluginLog() {
return getDefault();
}
+
+ @Override
+ public void stop(BundleContext context) throws Exception {
+ if (partListener != null) {
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
+ window.getPartService().removePartListener(partListener);
+ partListener = null;
+ }
+ ProjectNaturesChecker naturesChecker = ProjectNaturesChecker.getInstance();
+ naturesChecker.dispose();
+ naturesChecker = null;
+ super.stop(context);
+ }
+
}
\ No newline at end of file
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/AddJSFCapabilitiesDelegate.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -0,0 +1,22 @@
+package org.jboss.tools.jsf.ui.editor.check;
+
+import org.eclipse.core.resources.IProject;
+import org.jboss.tools.jsf.ui.action.AddJSFNatureActionDelegate;
+
+public class AddJSFCapabilitiesDelegate extends AddJSFNatureActionDelegate {
+
+ private static AddJSFCapabilitiesDelegate instance = new AddJSFCapabilitiesDelegate();
+
+ private AddJSFCapabilitiesDelegate() {
+ }
+
+ public static AddJSFCapabilitiesDelegate getInstance(IProject project) {
+ instance.setProject(project);
+ return instance;
+ }
+
+ public void setProject(IProject project) {
+ this.project = project;
+ }
+
+}
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java (from rev 21188, trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesChecker.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesChecker.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -0,0 +1,206 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.editor.check;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.QualifiedName;
+import org.eclipse.jdt.core.IJavaElement;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.tools.common.reporting.ProblemReportingHelper;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.util.FileUtil;
+import org.jboss.tools.jst.web.kb.IKbProject;
+import org.jboss.tools.jst.web.kb.internal.KbProject;
+import org.jboss.tools.jst.web.project.WebProject;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class ProjectNaturesChecker implements IResourceChangeListener {
+
+ private static final String SEARCH_CLASS = "javax.faces.webapp.FacesServlet"; //$NON-NLS-1$
+ public static final QualifiedName IS_NATURES_CHECK_NEED = new QualifiedName(
+ "", "Is natures check"); //$NON-NLS-1$ //$NON-NLS-2$
+ public static final QualifiedName IS_JSF_CHECK_NEED = new QualifiedName(
+ "", "Is JSF check"); //$NON-NLS-1$ //$NON-NLS-2$
+ private Set<IProject> projectsCollection;
+ private static final String JSF_NATURE = "JavaServer Faces Nature"; //$NON-NLS-1$
+ private static final String KB_NATURE = "Knowledge Base Nature"; //$NON-NLS-1$
+ private static final String STRUTS_NATURE_ID = "org.jboss.tools.struts.strutsnature"; //$NON-NLS-1$
+
+ private static ProjectNaturesChecker checker;
+
+ public static ProjectNaturesChecker getInstance(){
+ if (checker == null) {
+ checker = new ProjectNaturesChecker();
+ }
+ return checker;
+ }
+
+ private ProjectNaturesChecker() {
+ projectsCollection = new HashSet<IProject>(0);
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this,
+ IResourceChangeEvent.POST_CHANGE);
+ }
+
+ public void resourceChanged(final IResourceChangeEvent event) {
+ Display display = Display.getDefault();
+ if (display != null) {
+ display.asyncExec(new Runnable() {
+ public void run() {
+ handleResourceChangeEvent(event);
+ }
+ });
+ }
+ }
+
+ public void checkNatures(IProject project) throws CoreException {
+ if (project == null) {
+ return;
+ }
+ addProject(project);
+ boolean isJSFCheck = true;
+ boolean isNaturesCheck = true;
+ updateProjectPersistentProperties(project);
+ isJSFCheck = Boolean.parseBoolean(project
+ .getPersistentProperty(IS_JSF_CHECK_NEED));
+ isNaturesCheck = Boolean.parseBoolean(project
+ .getPersistentProperty(IS_NATURES_CHECK_NEED));
+ if (isJSFCheck) {
+ if (isNaturesCheck) {
+ String[] missingNatures = getMissingNatures(project);
+ if (missingNatures != null) {
+ KbProject.checkKBBuilderInstalled(project);
+ ProjectNaturesInfoDialog dialog = new ProjectNaturesInfoDialog(
+ missingNatures, project);
+ dialog.open();
+ }
+ }
+ }
+ }
+
+ private String[] getMissingNatures(IProject project) throws CoreException {
+ List<String> missingNatures = new ArrayList<String>(0);
+ if (project.getNature(STRUTS_NATURE_ID) != null) {
+ return null;
+ }
+ if (project.getNature(IKbProject.NATURE_ID) == null) {
+ missingNatures.add(JSF_NATURE);
+ }
+ if (project.getNature(WebProject.JSF_NATURE_ID) == null) {
+ missingNatures.add(KB_NATURE);
+ }
+ if (missingNatures.size() == 0) {
+ return null;
+ }
+ return missingNatures.toArray(new String[0]);
+ }
+
+ private void handleResourceChangeEvent(IResourceChangeEvent changeEvent) {
+ IResourceDelta[] affectedChildren = changeEvent.getDelta()
+ .getAffectedChildren();
+ if (affectedChildren == null) {
+ return;
+ }
+ for (int i = 0; i < affectedChildren.length; i++) {
+ IResourceDelta resourceDelta = affectedChildren[i];
+ if (resourceDelta.getResource() instanceof IProject) {
+ IProject project = (IProject) resourceDelta.getResource();
+ if (resourceDelta.getKind() == IResourceDelta.ADDED) {
+ processAddProject(project);
+ continue;
+ }
+ if (resourceDelta.getKind() == IResourceDelta.REMOVED) {
+ processRemoveProject(project);
+ continue;
+ }
+ try {
+ updateProjectJSFPersistents(project);
+ } catch (CoreException e) {
+ ProblemReportingHelper.reportProblem(JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+ }
+ }
+
+ private void updateProjectPersistentProperties(IProject project)
+ throws CoreException {
+ if (project.isAccessible()) {
+ String jsfCheckString = project
+ .getPersistentProperty(IS_JSF_CHECK_NEED);
+ if (jsfCheckString == null) {
+ updateProjectJSFPersistents(project);
+ }
+ if (project.getPersistentProperty(IS_NATURES_CHECK_NEED) == null) {
+ project.setPersistentProperty(IS_NATURES_CHECK_NEED, "true"); //$NON-NLS-1$
+ }
+ }
+ }
+
+ public IProject getProject(IProject project) {
+ return projectsCollection.contains(project) ? project : null;
+ }
+
+ public void addProject(IProject project) {
+ if (getProject(project) == null) {
+ projectsCollection.add(project);
+ }
+ }
+
+ public void dispose() {
+ ResourcesPlugin.getWorkspace().removeResourceChangeListener(this);
+ projectsCollection.clear();
+ }
+
+ private void processAddProject(IProject project) {
+ addProject(project);
+ try {
+ updateProjectJSFPersistents(project);
+ } catch (CoreException e) {
+ ProblemReportingHelper.reportProblem(JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+
+ private void processRemoveProject(IProject project) {
+ projectsCollection.remove(project);
+ }
+
+ private void updateProjectJSFPersistents(IProject project)
+ throws CoreException {
+ if (project.isAccessible()) {
+ try {
+ IJavaElement javaElement = FileUtil.searchForClass(JavaCore
+ .create(project), SEARCH_CLASS);
+ if (javaElement == null) {
+ project.setPersistentProperty(IS_JSF_CHECK_NEED, "false"); //$NON-NLS-1$
+ } else {
+ project.setPersistentProperty(IS_JSF_CHECK_NEED, "true"); //$NON-NLS-1$
+ }
+ } catch (CoreException e) {
+ project.setPersistentProperty(IS_JSF_CHECK_NEED, "false"); //$NON-NLS-1$
+ }
+ }
+ }
+
+}
Copied: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java (from rev 21188, trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/check/ProjectNaturesInfoDialog.java)
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesInfoDialog.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -0,0 +1,159 @@
+/*******************************************************************************
+ * Copyright (c) 2007-2010 Exadel, Inc. and Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.editor.check;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BusyIndicator;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
+import org.jboss.tools.common.reporting.ProblemReportingHelper;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.messages.JstUIMessages;
+
+/**
+ *
+ * @author yzhishko
+ *
+ */
+
+public class ProjectNaturesInfoDialog extends MessageDialog {
+
+ private Button button;
+ private Link link;
+ private boolean isRemember = false;
+ private static final String QUESTION = "Do not show this dialog again!"; //$NON-NLS-1$
+ private static final String TITLE = "Missing Natures"; //$NON-NLS-1$
+ private IProject project;
+
+ public ProjectNaturesInfoDialog(String[] missingNatures, IProject project) {
+ super(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
+ TITLE, null, "", INFORMATION, //$NON-NLS-1$
+ new String[] {"Add JSF Capabilities...", IDialogConstants.OK_LABEL }, 0); //$NON-NLS-1$
+ this.project = project;
+ message = getMessageInfo(missingNatures, project);
+ }
+
+ @Override
+ protected Control createCustomArea(Composite parent) {
+
+ GridLayout gridLayout = (GridLayout) parent.getLayout();
+ gridLayout.numColumns = 2;
+ gridLayout.makeColumnsEqualWidth = true;
+ parent.setLayout(gridLayout);
+ button = new Button(parent, SWT.CHECK);
+ GridData gridData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
+ button.setLayoutData(gridData);
+ button.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ isRemember = !isRemember;
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ isRemember = !isRemember;
+ }
+ });
+ button.setText(QUESTION);
+ link = new Link(parent, SWT.NONE);
+ gridData = new GridData(GridData.HORIZONTAL_ALIGN_END);
+ gridData.grabExcessHorizontalSpace = true;
+ link.setLayoutData(gridData);
+ link.setText("<A>" + JstUIMessages.DOCS_INFO_LINK_TEXT + "</A>"); //$NON-NLS-1$ //$NON-NLS-2$
+ link.setToolTipText(JstUIMessages.DOCS_INFO_LINK);
+ link.addSelectionListener(new SelectionListener() {
+
+ public void widgetSelected(SelectionEvent e) {
+ processLink(link);
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ processLink(link);
+ }
+
+ });
+ return parent;
+ }
+
+ @Override
+ protected void buttonPressed(int buttonId) {
+ if (buttonId == 0) {
+ BusyIndicator.showWhile(getShell().getDisplay(), new Runnable() {
+ public void run() {
+ AddJSFCapabilitiesDelegate.getInstance(project).run(null);
+ }
+ });
+ }
+ if (buttonId == 1) {
+ try {
+ project.setPersistentProperty(
+ ProjectNaturesChecker.IS_NATURES_CHECK_NEED, Boolean
+ .toString(!isRemember));
+ } catch (CoreException e) {
+ }
+ }
+ super.buttonPressed(buttonId);
+ }
+
+ private void processLink(Link link) {
+ BusyIndicator.showWhile(link.getDisplay(), new Runnable() {
+ public void run() {
+ URL theURL = null;
+ try {
+ theURL = new URL(JstUIMessages.DOCS_INFO_LINK);
+ } catch (MalformedURLException e) {
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
+ }
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ try {
+ support.getExternalBrowser().openURL(theURL);
+ } catch (PartInitException e) {
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+ });
+ }
+
+ @SuppressWarnings("unused")
+ private String arrayToString(String[] strings) {
+ StringBuilder builder = new StringBuilder(""); //$NON-NLS-1$
+ for (int i = 0; i < strings.length; i++) {
+ builder.append(strings[i] + "\n"); //$NON-NLS-1$
+ }
+ return builder.toString();
+ }
+
+ private String getMessageInfo(String[] missingNatures, IProject project) {
+ String dialogMessage = "JBoss Tools Visual Editor might not fully work in project \"" + project.getName() + //$NON-NLS-1$
+ "\" because it does not have JSF and code completion enabled completely.\n\n" //$NON-NLS-1$
+ + "Please use the Configure menu on the project to enable JSF if " //$NON-NLS-1$
+ + "you want all features of the editor working."; //$NON-NLS-1$
+ return dialogMessage;
+ }
+
+}
Added: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java (rev 0)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/editor/check/ProjectNaturesPartListener.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -0,0 +1,66 @@
+package org.jboss.tools.jsf.ui.editor.check;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.IPartListener;
+import org.eclipse.ui.IWorkbenchPart;
+import org.jboss.tools.common.reporting.ProblemReportingHelper;
+import org.jboss.tools.jst.jsp.JspEditorPlugin;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
+
+public class ProjectNaturesPartListener implements IPartListener {
+
+ public void partActivated(IWorkbenchPart part) {
+
+ }
+
+ public void partBroughtToTop(IWorkbenchPart part) {
+
+ }
+
+ public void partClosed(IWorkbenchPart part) {
+
+ }
+
+ public void partDeactivated(IWorkbenchPart part) {
+
+ }
+
+ public void partOpened(IWorkbenchPart part) {
+ boolean isCheck = true;
+ String isCheckString = System
+ .getProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER"); //$NON-NLS-1$
+ if (isCheckString != null) {
+ isCheck = Boolean.parseBoolean(isCheckString);
+ }
+ if (isCheck) {
+ if (JspEditorPlugin
+ .getDefault()
+ .getPreferenceStore()
+ .getBoolean(
+ IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE)) {
+ try {
+ checkNaturesFromPart(part);
+ } catch (CoreException e) {
+ ProblemReportingHelper.reportProblem(
+ JspEditorPlugin.PLUGIN_ID, e);
+ }
+ }
+ }
+ }
+
+ private void checkNaturesFromPart(IWorkbenchPart part) throws CoreException {
+ if (part instanceof JSPMultiPageEditor) {
+ IEditorInput editorInput = ((JSPMultiPageEditor)part).getEditorInput();
+ if (editorInput instanceof IFileEditorInput) {
+ ProjectNaturesChecker.getInstance()
+ .checkNatures(
+ ((IFileEditorInput) editorInput).getFile()
+ .getProject());
+ }
+ }
+ }
+
+}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2010-04-02 13:04:21 UTC (rev 21239)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/JspEditorPlugin.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -14,7 +14,6 @@
import java.io.IOException;
import java.net.URL;
import java.util.HashMap;
-
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -24,8 +23,6 @@
import org.eclipse.jdt.ui.text.JavaTextTools;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jface.resource.JFaceResources;
import org.eclipse.jst.jsp.ui.internal.JSPUIPlugin;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
@@ -35,10 +32,8 @@
import org.jboss.tools.common.log.BaseUIPlugin;
import org.jboss.tools.common.log.IPluginLog;
import org.jboss.tools.common.text.xml.XmlEditorPlugin;
-import org.jboss.tools.jst.jsp.check.ProjectNaturesChecker;
import org.jboss.tools.jst.jsp.preferences.JSPOccurrencePreferenceConstants;
import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
@@ -281,12 +276,5 @@
}
return fImageDescRegistry;
}
-
- @Override
- public void stop(BundleContext context) throws Exception {
- ProjectNaturesChecker naturesChecker = ProjectNaturesChecker.getInstance();
- naturesChecker.dispose();
- naturesChecker = null;
- super.stop(context);
- }
+
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-04-02 13:04:21 UTC (rev 21239)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorPart.java 2010-04-02 15:07:28 UTC (rev 21240)
@@ -48,7 +48,6 @@
import org.jboss.tools.common.core.resources.XModelObjectEditorInput;
import org.jboss.tools.common.reporting.ProblemReportingHelper;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
-import org.jboss.tools.jst.jsp.check.ProjectNaturesChecker;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
/**
@@ -60,8 +59,6 @@
private ArrayList nestedEditors = new ArrayList(3);
- private ActivationListener activationListener = new ActivationListener();
-
protected JSPMultiPageEditorPart() {
super();
}
@@ -133,8 +130,6 @@
public final void createPartControl(Composite parent) {
this.container = createContainer(parent);
createPages();
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().addPartListener(activationListener);
// set the active page (page 0 by default), unless it has already been
// done
if (getActivePage() == -1)
@@ -144,11 +139,6 @@
protected abstract IEditorSite createSite(IEditorPart editor);
public void dispose() {
- if (activationListener != null) {
- IWorkbenchWindow window = getSite().getWorkbenchWindow();
- window.getPartService().removePartListener(activationListener);
- activationListener = null;
- }
getSite().setSelectionProvider(null);
for (int i = 0; i < nestedEditors.size(); ++i) {
IEditorPart editor = (IEditorPart) nestedEditors.get(i);
@@ -345,17 +335,6 @@
getItem(pageIndex).setText(text);
}
- private void checkNaturesFromPart(IWorkbenchPart part) throws CoreException {
- if (part == this) {
- IEditorInput editorInput = getEditorInput();
- if (editorInput instanceof IFileEditorInput) {
- ProjectNaturesChecker.getInstance()
- .checkNatures(
- ((IFileEditorInput) editorInput).getFile()
- .getProject());
- }
- }
- }
private class ActivationListener implements IPartListener {
@@ -376,26 +355,7 @@
}
public void partOpened(IWorkbenchPart part) {
- boolean isCheck = true;
- String isCheckString = System
- .getProperty("org.jboss.tools.vpe.ENABLE_PROJECT_NATURES_CHECKER"); //$NON-NLS-1$
- if (isCheckString != null) {
- isCheck = Boolean.parseBoolean(isCheckString);
- }
- if (isCheck) {
- if (JspEditorPlugin
- .getDefault()
- .getPreferenceStore()
- .getBoolean(
- IVpePreferencesPage.INFORM_WHEN_PROJECT_MIGHT_NOT_BE_CONFIGURED_PROPERLY_FOR_VPE)) {
- try {
- checkNaturesFromPart(part);
- } catch (CoreException e) {
- ProblemReportingHelper.reportProblem(
- JspEditorPlugin.PLUGIN_ID, e);
- }
- }
- }
+
}
}
}
14 years, 9 months
JBoss Tools SVN: r21239 - trunk/maven/docs/maven_reference_guide/en-US/images/introduction.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-04-02 09:04:21 -0400 (Fri, 02 Apr 2010)
New Revision: 21239
Added:
trunk/maven/docs/maven_reference_guide/en-US/images/introduction/maven_component_structure.png
Log:
JBDS-1121 Maven Integration Guide - updated
Added: trunk/maven/docs/maven_reference_guide/en-US/images/introduction/maven_component_structure.png
===================================================================
(Binary files differ)
Property changes on: trunk/maven/docs/maven_reference_guide/en-US/images/introduction/maven_component_structure.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
14 years, 9 months
JBoss Tools SVN: r21238 - in trunk/maven/docs/maven_reference_guide/en-US: images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2010-04-02 09:03:14 -0400 (Fri, 02 Apr 2010)
New Revision: 21238
Added:
trunk/maven/docs/maven_reference_guide/en-US/images/introduction/
Modified:
trunk/maven/docs/maven_reference_guide/en-US/introduction.xml
Log:
JBDS-1121 Maven Integration Guide - updated
Modified: trunk/maven/docs/maven_reference_guide/en-US/introduction.xml
===================================================================
--- trunk/maven/docs/maven_reference_guide/en-US/introduction.xml 2010-04-02 12:26:08 UTC (rev 21237)
+++ trunk/maven/docs/maven_reference_guide/en-US/introduction.xml 2010-04-02 13:03:14 UTC (rev 21238)
@@ -17,18 +17,102 @@
</keywordset>
</chapterinfo>
+
+
<title>Introduction</title>
- <para>Starting from 3.1 M2 version JBoss Tools includes new Jboss Maven Integration plug-in which for now allows to create mavenized Seam projects and enable Seam tools support for imported Maven projects.</para>
+ <section>
+ <title>What Maven is</title>
+ <para>Maven is a flexible project management, build and deployment tool from Apache Foundation. Maven uses Project Object Model to describe a project and consist from the core, plugins and repository, which can be local or remote.</para>
+ <figure>
+ <title>Maven Component structure</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/introduction/maven_component_structure.png"/>
+ </imageobject>
+
+ </mediaobject>
+ </figure>
+ <para>The core basing on pom.xml controls a process of calling plugins. Plugins contain all other functionality which Maven provides for the projects: compile, build, deploy and etc. </para>
+ <para>Repository is a common place for all plugins which Maven globally uses. Local repository collects plugins snapshots downloaded from remote repository or from a set of repositories.</para>
+ </section>
+ <section>
+ <title>JBoss Maven Integration Functionality Overview</title>
+ <para>In the beginning, we propose you to look through the table of main features of JBoss Maven Tools Integration Tools: </para>
+ <table>
+ <title>Key Functionality for Maven Integration Tool</title>
+ <tgroup cols="3">
+ <colspec colnum="1" align="left" colwidth="2*"/>
+ <colspec colnum="2" colwidth="4*"/>
+ <colspec colnum="3" align="left" colwidth="2*"/>
+ <thead>
+ <row>
+ <entry>Feature</entry>
+ <entry>Benefit</entry>
+ <entry>Chapter</entry>
+ </row>
+ </thead>
+
+
+ <tbody>
+ <row>
+ <entry><para>Library provider</para></entry>
+ <entry><para>Maven Integration Tool provide possibility to use in Eclipse libraries, which is pointed in dependencies pom.xml section, not adding them into the project Build Path.</para>
+ </entry>
+ <entry><para>Library provider chapter</para></entry>
+ </row>
+ <row>
+ <entry><para>Server deployment </para> </entry>
+ <entry>Server deployment is supported by Maven Integration Tools. With it you can deploy a project to the server by default Eclipse instruments.
+ </entry>
+ <entry>Deploy to the JBoss Server chapter
+ </entry>
+ </row>
+ <row>
+ <entry>JBoss Maven Integration Facet
+ </entry>
+ <entry>The facet gives possibility to mavenizing any Dynamic Web Project.
+ </entry>
+ <entry>Mavenizing Dynamic Web Project chapter.
+ </entry>
+ </row>
+
+
+
+ </tbody>
+ </tgroup>
+
+
+
+ </table>
+ <para>Starting from 3.1 M2 version JBoss Tools includes new JBoss Maven Integration plug-in which for now allows to create mavenized Seam projects and enable Seam tools support for imported Maven projects.</para>
- <para>The Jboss Maven Integration requires m2eclipse to be installed.</para>
- <note>
- <title>Note:</title>
- <para>For M2 release of <property>Jboss Tools</property> it is important to use m2eclipse
- <ulink url="http://m2eclipse.sonatype.org/update/">stable updatesite</ulink> or the
- <ulink url="http://m2eclipse.sonatype.org/releases/0.9.9.200906081351">latest
- integration build</ulink> that M2 was developed against. If you want to use the
- latest development release of m2eclipse you need to use the <ulink
- url="http://download.jboss.org/jbosstools/updates/nightly/trunk/">nightly
- builds</ulink> of <property>JBoss Tools</property>.</para>
- </note>
+
+ </section>
+ <section>
+ <title>Requirements and Installation</title>
+ <para>The JBoss Maven Integration requires m2eclipse to be installed.</para>
+ <note>
+ <title>Note:</title>
+ <para>For M2 release of <property>JBoss Tools</property> it is important to use m2eclipse
+ <ulink url="http://m2eclipse.sonatype.org/update/">stable update site</ulink> or the
+ <ulink url="http://m2eclipse.sonatype.org/releases/0.9.9.200906081351">latest
+ integration build</ulink> that M2 was developed against. If you want to use the
+ latest development release of m2eclipse you need to use the <ulink
+ url="http://download.jboss.org/jbosstools/updates/nightly/trunk/">nightly
+ builds</ulink> of <property>JBoss Tools</property>.</para>
+ </note>
+ </section>
+ <section>
+ <title>Other relevant resources on the topic:</title>
+ <itemizedlist>
+ <listitem>
+ <para><ulink url="http://maven.apache.org/">maven.apache.org</ulink> is a official Apache Maven website.</para>
+ </listitem>
+ <listitem>
+ <para><ulink url="http://m2eclipse.sonatype.org/">m2eclipse.sonatype.org</ulink> is a official m2eclipse (Maven Support plugin for Eclipse) website. </para>
+ </listitem>
+
+ </itemizedlist>
+ </section>
+
</chapter>
14 years, 9 months
JBoss Tools SVN: r21237 - branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2010-04-02 08:26:08 -0400 (Fri, 02 Apr 2010)
New Revision: 21237
Removed:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStubFactory.java
Modified:
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java
branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-6070 - update
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AbstractTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.type.AbstractType;
public class AbstractTypeStub extends TypeStub {
+ public static final String CL = "org.hibernate.type.AbstractType"; //$NON-NLS-1$
+
protected AbstractType abstractType;
protected AbstractTypeStub(Object abstractType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/AnyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class AnyStub extends SimpleValueStub {
+ public static final String CL = "org.hibernate.mapping.Any"; //$NON-NLS-1$
+
protected Any any;
protected AnyStub(Object any) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArrayStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class ArrayStub extends ListStub {
+ public static final String CL = "org.hibernate.mapping.Array"; //$NON-NLS-1$
+
protected Array array;
protected ArrayStub(Object array) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ArtifactCollectorStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -6,6 +6,7 @@
import org.hibernate.tool.hbm2x.ArtifactCollector;
public class ArtifactCollectorStub {
+ public static final String CL = "org.hibernate.tool.hbm2x.ArtifactCollector"; //$NON-NLS-1$
protected ArtifactCollector artifactCollector;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/BagStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class BagStub extends CollectionStub {
+ public static final String CL = "org.hibernate.mapping.Bag"; //$NON-NLS-1$
+
protected Bag bag;
protected BagStub(Object bag) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/Cfg2HbmToolStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.tool.hbm2x.Cfg2HbmTool;
public class Cfg2HbmToolStub {
+ public static final String CL = "org.hibernate.tool.hbm2x.Cfg2HbmTool"; //$NON-NLS-1$
+
protected Cfg2HbmTool cfg2HbmTool;
protected Cfg2HbmToolStub(Object cfg2HbmTool) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ClassMetadataStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -5,6 +5,8 @@
import org.hibernate.type.Type;
public class ClassMetadataStub {
+ public static final String CL = "org.hibernate.metadata.ClassMetadata"; //$NON-NLS-1$
+
protected ClassMetadata classMetadata;
protected ClassMetadataStub(Object classMetadata) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionMetadataStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.metadata.CollectionMetadata;
public class CollectionMetadataStub {
+ public static final String CL = "org.hibernate.metadata.CollectionMetadata"; //$NON-NLS-1$
+
protected CollectionMetadata collectionMetadata;
protected CollectionMetadataStub(Object collectionMetadata) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -5,7 +5,8 @@
import org.hibernate.mediator.Messages;
public abstract class CollectionStub extends ValueStub {
-
+ public static final String CL = "org.hibernate.mapping.Collection"; //$NON-NLS-1$
+
protected Collection collection;
protected CollectionStub(Object collection) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/CollectionTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.type.CollectionType;
public class CollectionTypeStub extends AbstractTypeStub {
-
+ public static final String CL = "org.hibernate.type.CollectionType"; //$NON-NLS-1$
+
protected CollectionType collectionType;
protected CollectionTypeStub(Object collectionType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ColumnStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class ColumnStub extends SelectableStub {
+ public static final String CL = "org.hibernate.mapping.Column"; //$NON-NLS-1$
+
public static final int DEFAULT_LENGTH = 255;
public static final int DEFAULT_PRECISION = 19;
public static final int DEFAULT_SCALE = 2;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ComponentStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -8,6 +8,8 @@
import org.hibernate.mediator.Messages;
public class ComponentStub extends SimpleValueStub {
+ public static final String CL = "org.hibernate.mapping.Component"; //$NON-NLS-1$
+
protected Component component;
protected ComponentStub(Object component) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -22,7 +22,8 @@
import org.xml.sax.EntityResolver;
public class ConfigurationStub {
-
+ public static final String CL = "org.hibernate.cfg.Configuration"; //$NON-NLS-1$
+
private Map<String, FakeDelegatingDriver> fakeDrivers = new HashMap<String, FakeDelegatingDriver>();
// configuration != null - by default
@@ -65,7 +66,11 @@
}
public SessionFactoryStub buildSessionFactory() {
- return new SessionFactoryStub(configuration.buildSessionFactory());
+ Object obj = configuration.buildSessionFactory();
+ if (obj == null) {
+ return null;
+ }
+ return new SessionFactoryStub(obj);
}
public EntityResolver getEntityResolver() {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConfigurationStubJDBCMetaData.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -8,6 +8,7 @@
import org.hibernate.mediator.Messages;
public class ConfigurationStubJDBCMetaData extends ConfigurationStub {
+ public static final String CL = "org.hibernate.cfg.JDBCMetaDataConfiguration"; //$NON-NLS-1$
protected JDBCMetaDataConfiguration jdbcMetaDataConfiguration;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ConnectionProviderStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class ConnectionProviderStub {
+ public static final String CL = "org.hibernate.connection.ConnectionProvider"; //$NON-NLS-1$
+
protected ConnectionProvider connectionProvider;
protected ConnectionProviderStub(Object connectionProvider) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultDatabaseCollectorStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -12,6 +12,8 @@
import org.hibernate.mediator.Messages;
public class DefaultDatabaseCollectorStub {
+ public static final String CL = "org.hibernate.cfg.reveng.DefaultDatabaseCollector"; //$NON-NLS-1$
+
protected DefaultDatabaseCollector defaultDatabaseCollector;
protected DefaultDatabaseCollectorStub(Object defaultDatabaseCollector) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DefaultReverseEngineeringStrategyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class DefaultReverseEngineeringStrategyStub extends ReverseEngineeringStrategyStub {
-
+ public static final String CL = "org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy"; //$NON-NLS-1$
+
protected DefaultReverseEngineeringStrategy defaultReverseEngineeringStrategy;
protected DefaultReverseEngineeringStrategyStub(Object defaultReverseEngineeringStrategy) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DependantValueStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class DependantValueStub extends SimpleValueStub {
+ public static final String CL = "org.hibernate.mapping.DependantValue"; //$NON-NLS-1$
+
protected DependantValue dependantValue;
protected DependantValueStub(Object dependantValue) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/DialectStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -8,6 +8,8 @@
import org.hibernate.mediator.Messages;
public class DialectStub {
+ public static final String CL = "org.hibernate.dialect.Dialect"; //$NON-NLS-1$
+
protected Dialect dialect;
protected DialectStub(Object dialect) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityModeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,7 @@
import org.hibernate.mediator.Messages;
public class EntityModeStub {
+ public static final String CL = "org.hibernate.EntityMode"; //$NON-NLS-1$
public static final EntityModeStub POJO = new EntityModeStub(EntityMode.POJO);
public static final EntityModeStub DOM4J = new EntityModeStub(EntityMode.DOM4J);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EntityTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.type.EntityType;
public class EntityTypeStub extends AbstractTypeStub {
+ public static final String CL = "org.hibernate.type.EntityType"; //$NON-NLS-1$
+
protected EntityType entityType;
protected EntityTypeStub(Object entityType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnumTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.type.EnumType;
public class EnumTypeStub {
-
+ public static final String CL = "org.hibernate.type.EnumType"; //$NON-NLS-1$
+
public static final String ENUM = EnumType.ENUM;
public static final String TYPE = EnumType.TYPE;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/EnvironmentStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -9,6 +9,8 @@
import org.hibernate.cfg.Environment;
public class EnvironmentStub {
+ public static final String CL = "org.hibernate.cfg.Environment"; //$NON-NLS-1$
+
public static final String DIALECT = Environment.DIALECT;
public static final String DEFAULT_CATALOG = Environment.DEFAULT_CATALOG;
public static final String DEFAULT_SCHEMA = Environment.DEFAULT_SCHEMA;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ExporterStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -7,6 +7,7 @@
import org.hibernate.tool.hbm2x.Exporter;
public class ExporterStub {
+ public static final String CL = "org.hibernate.tool.hbm2x.Exporter"; //$NON-NLS-1$
protected Exporter exporter;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ForeignKeyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -9,6 +9,8 @@
import org.hibernate.mediator.Messages;
public class ForeignKeyStub {
+ public static final String CL = "org.hibernate.mapping.ForeignKey"; //$NON-NLS-1$
+
protected ForeignKey foreignKey;
protected ForeignKeyStub(Object foreignKey) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/FormulaStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class FormulaStub extends SelectableStub {
-
+ public static final String CL = "org.hibernate.mapping.Formula"; //$NON-NLS-1$
+
protected Formula formula;
protected FormulaStub(Object formula) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/GenericExporterStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.tool.hbm2x.GenericExporter;
public class GenericExporterStub extends ExporterStub {
+ public static final String CL = "org.hibernate.tool.hbm2x.GenericExporter"; //$NON-NLS-1$
+
protected GenericExporter genericExporter;
protected GenericExporterStub(Object genericExporter) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HQLCompletionProposalStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.tool.ide.completion.HQLCompletionProposal;
public class HQLCompletionProposalStub {
-
+ public static final String CL = "org.hibernate.tool.ide.completion.HQLCompletionProposal"; //$NON-NLS-1$
+
public static final int ENTITY_NAME = HQLCompletionProposal.ENTITY_NAME;
public static final int PROPERTY = HQLCompletionProposal.PROPERTY;
public static final int KEYWORD = HQLCompletionProposal.KEYWORD;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateConfigurationExporterStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -7,6 +7,8 @@
import org.hibernate.tool.hbm2x.HibernateConfigurationExporter;
public class HibernateConfigurationExporterStub extends ExporterStub {
+ public static final String CL = "org.hibernate.tool.hbm2x.HibernateConfigurationExporter"; //$NON-NLS-1$
+
protected HibernateConfigurationExporter hibernateConfigurationExporter;
protected HibernateConfigurationExporterStub(Object hibernateConfigurationExporter) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingExporterStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -9,7 +9,8 @@
import org.hibernate.tool.hbm2x.HibernateMappingExporter;
public class HibernateMappingExporterStub {
-
+ public static final String CL = "org.hibernate.tool.hbm2x.HibernateMappingExporter"; //$NON-NLS-1$
+
protected HibernateMappingExporter hibernateMappingExporter;
protected HibernateMappingExporterStub(ConfigurationStub cfg, File outputdir) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateMappingGlobalSettingsStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings;
public class HibernateMappingGlobalSettingsStub {
-
+ public static final String CL = "org.hibernate.tool.hbm2x.HibernateMappingGlobalSettings"; //$NON-NLS-1$
+
protected HibernateMappingGlobalSettings hibernateMappingGlobalSettings;
protected HibernateMappingGlobalSettingsStub(Object hibernateMappingGlobalSettings) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HibernateStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class HibernateStub {
+ public static final String CL = "org.hibernate.Hibernate"; //$NON-NLS-1$
+
public static final NullableTypeStub BOOLEAN = new NullableTypeStub(Hibernate.BOOLEAN);
public static final NullableTypeStub BYTE = new NullableTypeStub(Hibernate.BYTE);
public static final NullableTypeStub BIG_INTEGER = new NullableTypeStub(Hibernate.BIG_INTEGER);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/HqlSqlTokenTypesStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -3,5 +3,7 @@
import org.hibernate.hql.antlr.HqlSqlTokenTypes;
public class HqlSqlTokenTypesStub {
+ public static final String CL = "org.hibernate.hql.antlr.HqlSqlTokenTypes"; //$NON-NLS-1$
+
public static final int IDENT = HqlSqlTokenTypes.IDENT;
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCodeAssistStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.tool.ide.completion.HQLCodeAssist;
public class IHQLCodeAssistStub {
+ public static final String CL = "org.hibernate.tool.ide.completion.HQLCodeAssist"; //$NON-NLS-1$
+
protected HQLCodeAssist hqlCodeAssist;
protected IHQLCodeAssistStub(Object hqlCodeAssist) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IHQLCompletionRequestorStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,7 @@
import org.hibernate.tool.ide.completion.IHQLCompletionRequestor;
public abstract class IHQLCompletionRequestorStub {
+ public static final String CL = "org.hibernate.tool.ide.completion.HQLCompletionProposal"; //$NON-NLS-1$
protected IHQLCompletionRequestor hqlCompletionRequestor;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierBagStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class IdentifierBagStub extends IdentifierCollectionStub {
+ public static final String CL = "org.hibernate.mapping.IdentifierBag"; //$NON-NLS-1$
+
protected IdentifierBag identifierBag;
protected IdentifierBagStub(Object identifierBag) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IdentifierCollectionStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public abstract class IdentifierCollectionStub extends CollectionStub {
+ public static final String CL = "org.hibernate.mapping.IdentifierCollection"; //$NON-NLS-1$
+
protected IdentifierCollection identifierCollection;
protected IdentifierCollectionStub(Object identifierCollection) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ImmutableTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.type.ImmutableType;
public class ImmutableTypeStub extends NullableTypeStub {
-
+ public static final String CL = "org.hibernate.type.ImmutableType"; //$NON-NLS-1$
+
protected ImmutableType immutableType;
protected ImmutableTypeStub(Object immutableType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IndexedCollectionStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public abstract class IndexedCollectionStub extends CollectionStub {
-
+ public static final String CL = "org.hibernate.mapping.IndexedCollection"; //$NON-NLS-1$
+
protected IndexedCollection indexedCollection;
protected IndexedCollectionStub(Object indexedCollection) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/IntegerTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.type.IntegerType;
public class IntegerTypeStub extends PrimitiveTypeStub {
-
+ public static final String CL = "org.hibernate.type.IntegerType"; //$NON-NLS-1$
+
protected IntegerType integerType;
protected IntegerTypeStub(Object integerType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCReaderStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -7,7 +7,8 @@
import org.hibernate.cfg.reveng.JDBCReader;
public class JDBCReaderStub {
-
+ public static final String CL = "org.hibernate.cfg.reveng.JDBCReader"; //$NON-NLS-1$
+
protected JDBCReader jdbcReader;
protected JDBCReaderStub(Properties cfg, SettingsStub settings, ReverseEngineeringStrategyStub revengStrategy) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JDBCToHibernateTypeHelperStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -3,6 +3,7 @@
import org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper;
public class JDBCToHibernateTypeHelperStub {
+ public static final String CL = "org.hibernate.cfg.reveng.JDBCToHibernateTypeHelper"; //$NON-NLS-1$
public static String getJDBCTypeName(int intValue) {
return JDBCToHibernateTypeHelper.getJDBCTypeName(intValue);
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -8,6 +8,8 @@
import org.hibernate.mediator.Messages;
public class JoinStub {
+ public static final String CL = "org.hibernate.mapping.Join"; //$NON-NLS-1$
+
protected Join join;
protected JoinStub(Object join) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/JoinedSubclassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class JoinedSubclassStub extends SubclassStub {
-
+ public static final String CL = "org.hibernate.mapping.JoinedSubclass"; //$NON-NLS-1$
+
protected JoinedSubclass joinedSubclass;
protected JoinedSubclassStub(Object joinedSubclass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public abstract class KeyValueStub extends ValueStub {
+ public static final String CL = "org.hibernate.mapping.KeyValue"; //$NON-NLS-1$
+
protected KeyValue keyValue;
protected KeyValueStub(Object keyValue) {
Deleted: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStubFactory.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/KeyValueStubFactory.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -1,5 +0,0 @@
-package org.hibernate.mediator.stubs;
-
-public class KeyValueStubFactory {
-
-}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ListStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class ListStub extends IndexedCollectionStub {
+ public static final String CL = "org.hibernate.mapping.List"; //$NON-NLS-1$
+
protected List list;
protected ListStub(Object list) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ManyToOneStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class ManyToOneStub extends ToOneStub {
+ public static final String CL = "org.hibernate.mapping.ManyToOne"; //$NON-NLS-1$
+
protected ManyToOne manyToOne;
protected ManyToOneStub(Object manyToOne) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MapStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class MapStub extends IndexedCollectionStub {
+ public static final String CL = "org.hibernate.mapping.Map"; //$NON-NLS-1$
+
protected Map map;
protected MapStub(Object map) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class MappingStub {
+ public static final String CL = "org.hibernate.engine.Mapping"; //$NON-NLS-1$
+
protected Mapping mapping;
protected MappingStub(Object mapping) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/MappingsStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class MappingsStub {
+ public static final String CL = "org.hibernate.cfg.Mappings"; //$NON-NLS-1$
+
protected Mappings mappings;
protected MappingsStub(Object mappings) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NamingStrategyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class NamingStrategyStub {
+ public static final String CL = "org.hibernate.cfg.NamingStrategy"; //$NON-NLS-1$
+
protected NamingStrategy namingStrategy;
protected NamingStrategyStub(Object namingStrategy) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/NullableTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.type.NullableType;
public class NullableTypeStub extends AbstractTypeStub {
-
+ public static final String CL = "org.hibernate.type.NullableType"; //$NON-NLS-1$
+
protected NullableType nullableType;
protected NullableTypeStub(Object nullableType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToManyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class OneToManyStub extends ValueStub {
+ public static final String CL = "org.hibernate.mapping.OneToMany"; //$NON-NLS-1$
+
protected OneToMany oneToMany;
protected OneToManyStub(Object oneToMany) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OneToOneStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class OneToOneStub extends ToOneStub {
+ public static final String CL = "org.hibernate.mapping.OneToOne"; //$NON-NLS-1$
+
protected OneToOne oneToOne;
protected OneToOneStub(Object oneToOne) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/OverrideRepositoryStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -6,6 +6,8 @@
import org.hibernate.mediator.Messages;
public class OverrideRepositoryStub {
+ public static final String CL = "org.hibernate.cfg.reveng.OverrideRepository"; //$NON-NLS-1$
+
protected OverrideRepository overrideRepository;
protected OverrideRepositoryStub(Object overrideRepository) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/POJOClassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.tool.hbm2x.pojo.POJOClass;
public class POJOClassStub {
-
+ public static final String CL = "org.hibernate.tool.hbm2x.pojo.POJOClass"; //$NON-NLS-1$
+
protected POJOClass pojoClass;
protected POJOClassStub(Object pojoClass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PersistentClassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -9,6 +9,8 @@
import org.hibernate.mediator.Messages;
public abstract class PersistentClassStub {
+ public static final String CL = "org.hibernate.mapping.PersistentClass"; //$NON-NLS-1$
+
protected PersistentClass persistentClass;
protected PersistentClassStub(Object persistentClass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimaryKeyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -9,6 +9,8 @@
import org.hibernate.mediator.Messages;
public class PrimaryKeyStub {
+ public static final String CL = "org.hibernate.mapping.PrimaryKey"; //$NON-NLS-1$
+
protected PrimaryKey primaryKey;
protected PrimaryKeyStub(Object primaryKey) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveArrayStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class PrimitiveArrayStub extends ArrayStub {
+ public static final String CL = "org.hibernate.mapping.PrimitiveArray"; //$NON-NLS-1$
+
protected PrimitiveArray primitiveArray;
protected PrimitiveArrayStub(Object primitiveArray) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PrimitiveTypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.type.PrimitiveType;
public class PrimitiveTypeStub extends ImmutableTypeStub {
-
+ public static final String CL = "org.hibernate.type.PrimitiveType"; //$NON-NLS-1$
+
protected PrimitiveType primitiveType;
protected PrimitiveTypeStub(Object primitiveType) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ProgressListenerStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -3,7 +3,8 @@
import org.hibernate.cfg.reveng.ProgressListener;
public abstract class ProgressListenerStub {
-
+ public static final String CL = "org.hibernate.cfg.reveng.ProgressListener"; //$NON-NLS-1$
+
protected ProgressListener progressListener = new ProgressListener() {
public void startSubTask(String name) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/PropertyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class PropertyStub {
+ public static final String CL = "org.hibernate.mapping.Property"; //$NON-NLS-1$
+
protected Property property;
protected PropertyStub(Object property) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringSettingsStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class ReverseEngineeringSettingsStub {
-
+ public static final String CL = "org.hibernate.cfg.reveng.ReverseEngineeringSettings"; //$NON-NLS-1$
+
protected ReverseEngineeringSettings reverseEngineeringSettings;
protected ReverseEngineeringSettingsStub(Object reverseEngineeringSettings) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ReverseEngineeringStrategyStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class ReverseEngineeringStrategyStub {
-
+ public static final String CL = "org.hibernate.cfg.reveng.ReverseEngineeringStrategy"; //$NON-NLS-1$
+
protected ReverseEngineeringStrategy reverseEngineeringStrategy;
protected ReverseEngineeringStrategyStub(Object reverseEngineeringStrategy) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/RootClassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -8,6 +8,8 @@
import org.hibernate.mediator.Messages;
public class RootClassStub extends PersistentClassStub {
+ public static final String CL = "org.hibernate.mapping.RootClass"; //$NON-NLS-1$
+
protected RootClass rootClass;
protected RootClassStub(Object rootClass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SQLTypeMappingStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -3,5 +3,7 @@
import org.hibernate.cfg.reveng.SQLTypeMapping;
public class SQLTypeMappingStub {
+ public static final String CL = "org.hibernate.cfg.reveng.SQLTypeMapping"; //$NON-NLS-1$
+
public static final Boolean UNKNOWN_NULLABLE = SQLTypeMapping.UNKNOWN_NULLABLE;
}
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SelectableStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class SelectableStub {
-
+ public static final String CL = "org.hibernate.mapping.Selectable"; //$NON-NLS-1$
+
protected Selectable selectable;
protected SelectableStub(Object selectable) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionFactoryStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -19,6 +19,7 @@
import org.hibernate.type.Type;
public class SessionFactoryStub {
+ public static final String CL = "org.hibernate.SessionFactory"; //$NON-NLS-1$
protected SessionFactory sessionFactory;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SessionStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -30,6 +30,7 @@
import bsh.Interpreter;
public class SessionStub {
+ public static final String CL = "org.hibernate.Session"; //$NON-NLS-1$
protected Session session;
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SetStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class SetStub extends CollectionStub {
+ public static final String CL = "org.hibernate.mapping.Set"; //$NON-NLS-1$
+
protected Set set;
protected SetStub(Object set) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SettingsStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class SettingsStub {
+ public static final String CL = "org.hibernate.cfg.Settings"; //$NON-NLS-1$
+
protected Settings settings;
protected SettingsStub(Object settings) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SimpleValueStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -6,7 +6,8 @@
import org.hibernate.mediator.Messages;
public class SimpleValueStub extends KeyValueStub {
-
+ public static final String CL = "org.hibernate.mapping.SimpleValue"; //$NON-NLS-1$
+
protected SimpleValue simpleValue;
protected SimpleValueStub(Object simpleValue) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SingleTableSubclassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class SingleTableSubclassStub extends SubclassStub {
+ public static final String CL = "org.hibernate.mapping.SingleTableSubclass"; //$NON-NLS-1$
+
protected SingleTableSubclass singleTableSubclass;
protected SingleTableSubclassStub(Object singleTableSubclass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/SubclassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class SubclassStub extends PersistentClassStub {
-
+ public static final String CL = "org.hibernate.mapping.Subclass"; //$NON-NLS-1$
+
protected Subclass subclass;
protected SubclassStub(Object subclass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableFilterStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,7 +4,8 @@
import org.hibernate.mediator.Messages;
public class TableFilterStub {
-
+ public static final String CL = "org.hibernate.cfg.reveng.TableFilter"; //$NON-NLS-1$
+
protected TableFilter tableFilter;
protected TableFilterStub(Object tableFilter) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableIdentifierStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class TableIdentifierStub {
+ public static final String CL = "org.hibernate.cfg.reveng.TableIdentifier"; //$NON-NLS-1$
+
protected TableIdentifier tableIdentifier;
protected TableIdentifierStub(Object tableIdentifier) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TableStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -9,6 +9,8 @@
import org.hibernate.mediator.Messages;
public class TableStub {
+ public static final String CL = "org.hibernate.mapping.Table"; //$NON-NLS-1$
+
protected Table table;
protected TableStub(Object table) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ToOneStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -5,6 +5,8 @@
import org.hibernate.mediator.Messages;
public class ToOneStub extends SimpleValueStub {
+ public static final String CL = "org.hibernate.mapping.ToOne"; //$NON-NLS-1$
+
protected ToOne toOne;
protected ToOneStub(Object toOne) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.type.Type;
public abstract class TypeStub {
+ public static final String CL = "org.hibernate.type.Type"; //$NON-NLS-1$
+
protected Type type;
protected TypeStub(Object type) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/TypeStubFactory.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -1,7 +1,5 @@
package org.hibernate.mediator.stubs;
-import java.lang.reflect.Type;
-
import org.hibernate.mediator.stubs.util.ClassHelper;
public class TypeStubFactory {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/UnionSubclassStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -4,6 +4,8 @@
import org.hibernate.mediator.Messages;
public class UnionSubclassStub extends SubclassStub {
+ public static final String CL = "org.hibernate.mapping.UnionSubclass"; //$NON-NLS-1$
+
protected UnionSubclass unionSubclass;
protected UnionSubclassStub(Object unionSubclass) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/ValueStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -3,12 +3,13 @@
import java.util.ArrayList;
import java.util.Iterator;
-import org.hibernate.mapping.Column;
import org.hibernate.mapping.Selectable;
import org.hibernate.mapping.Value;
import org.hibernate.mediator.Messages;
public abstract class ValueStub {
+ public static final String CL = "org.hibernate.mapping.Value"; //$NON-NLS-1$
+
protected Value value;
protected ValueStub(Object value) {
Modified: branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java
===================================================================
--- branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java 2010-04-02 11:33:48 UTC (rev 21236)
+++ branches/hibernatetools-multiversion/hibernatetools/plugins/org.hibernate.mediator/src/org/hibernate/mediator/stubs/XMLPrettyPrinterStub.java 2010-04-02 12:26:08 UTC (rev 21237)
@@ -7,6 +7,7 @@
import org.hibernate.tool.hbm2x.XMLPrettyPrinter;
public class XMLPrettyPrinterStub {
+ public static final String CL = "org.hibernate.tool.hbm2x.XMLPrettyPrinter"; //$NON-NLS-1$
public static void prettyPrint(InputStream in, OutputStream writer) throws IOException {
XMLPrettyPrinter.prettyPrint(in, writer);
14 years, 9 months
JBoss Tools SVN: r21236 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-04-02 07:33:48 -0400 (Fri, 02 Apr 2010)
New Revision: 21236
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5042
Enhance DnD support in VPE
VPE Refactoring in progress.
- Some Drag&Drop related methods have been moved from VpeVisualDomBuilder to VpeDnD.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-04-02 01:17:15 UTC (rev 21235)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-04-02 11:33:48 UTC (rev 21236)
@@ -16,6 +16,7 @@
import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.wst.xml.core.internal.document.NodeImpl;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
import org.jboss.tools.common.model.ui.dnd.ModelTransfer;
@@ -39,16 +40,20 @@
import org.jboss.tools.vpe.editor.VpeVisualDomBuilder;
import org.jboss.tools.vpe.editor.VpeVisualInnerDragInfo;
import org.jboss.tools.vpe.editor.VpeVisualInnerDropInfo;
+import org.jboss.tools.vpe.editor.mapping.VpeElementMapping;
+import org.jboss.tools.vpe.editor.mapping.VpeNodeMapping;
import org.jboss.tools.vpe.editor.mozilla.MozillaDropInfo;
import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
import org.jboss.tools.vpe.editor.mozilla.listener.MozillaDndListener;
import org.jboss.tools.vpe.editor.selection.VpeSelectionController;
import org.jboss.tools.vpe.editor.template.VpePseudoContentCreator;
import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.editor.util.TextUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
import org.jboss.tools.vpe.xulrunner.XPCOM;
import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerVpeUtils;
import org.mozilla.interfaces.nsIComponentManager;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
@@ -71,6 +76,7 @@
import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
/**
@@ -124,12 +130,6 @@
}
}
- private Point getMousePosition(nsIDOMEvent domEvent) {
- nsIDOMNSUIEvent nsuiEvent = (nsIDOMNSUIEvent)
- domEvent.queryInterface(nsIDOMNSUIEvent.NS_IDOMNSUIEVENT_IID);
- return new Point(nsuiEvent.getPageX(), nsuiEvent.getPageY());
- }
-
/**
* Calls when drag over event ocure
* @param event
@@ -229,12 +229,10 @@
if (getDragService().getCurrentSession().isDataFlavorSupported(VpeController.MODEL_FLAVOR)) {
MozillaDropInfo info;
- if(getDragService().getCurrentSession().getSourceNode()==null){
- //external drag
- info = canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
+ if(isInnerDragSession()){
+ info = canInnerDrop(mouseEvent);
} else {
- //internal drag
- info = canInnerDrop(mouseEvent);
+ info = canExternalDrop(mouseEvent, VpeController.MODEL_FLAVOR, ""); //$NON-NLS-1$
}
if (info != null) {
canDrop = info.canDrop();
@@ -407,8 +405,8 @@
}
VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
.getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ VpeSourceInnerDropInfo sourceDropInfo
+ = getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
@@ -416,7 +414,7 @@
.getInnerDropInfo(sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
+ correctVisualDropPosition(
newVisualDropInfo, visualDropInfo);
caretParent = newVisualDropInfo.getDropContainer();
caretOffset = newVisualDropInfo.getDropOffset();
@@ -451,15 +449,15 @@
VpeSourceInnerDragInfo sourceInnerDragInfo = vpeController.getVisualBuilder()
.getSourceInnerDragInfo(innerDragInfo);
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
+ VpeSourceInnerDropInfo sourceDropInfo
+ = getSourceInnerDropInfo(sourceInnerDragInfo.getNode(),
visualDropInfo, true);
if (sourceDropInfo.canDrop()) {
VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
.getInnerDropInfo(sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
+ correctVisualDropPosition(
newVisualDropInfo, visualDropInfo);
sourceDropInfo.setTop(visualDropInfo.getMouseY());
sourceDropInfo.setLeft(visualDropInfo.getMouseX());
@@ -478,6 +476,171 @@
}
}
+ private void correctVisualDropPosition(VpeVisualInnerDropInfo newVisualDropInfo,
+ VpeVisualInnerDropInfo oldVisualDropInfo) {
+ nsIDOMNode newVisualDropContainer = newVisualDropInfo
+ .getDropContainer();
+ nsIDOMNode oldVisualDropContainer = oldVisualDropInfo
+ .getDropContainer();
+
+ if (newVisualDropContainer.equals(oldVisualDropContainer)) {
+ newVisualDropInfo.setDropOffset(oldVisualDropInfo.getDropOffset());
+ return;
+ }
+
+ nsIDOMNode child = oldVisualDropContainer;
+ while (child != null && child.getNodeType() != Node.DOCUMENT_NODE) {
+ nsIDOMNode parent = child.getParentNode();
+ if (newVisualDropContainer.equals(parent)) {
+ long offset = VisualDomUtil.getOffset(child);
+ Rectangle rect = XulRunnerVpeUtils.getElementBounds(child);
+ if (canInsertAfter(oldVisualDropInfo.getMouseX(),
+ oldVisualDropInfo.getMouseY(), rect)) {
+ offset++;
+ }
+ newVisualDropInfo.setDropOffset(offset);
+ }
+ child = parent;
+ }
+ }
+
+ private VpeSourceInnerDropInfo getSourceInnerDropInfo(Node sourceDragNode,
+ VpeVisualInnerDropInfo visualDropInfo, boolean checkParentTemplates) {
+ nsIDOMNode visualDropContainer = visualDropInfo.getDropContainer();
+ long visualDropOffset = visualDropInfo.getDropOffset();
+ Node sourceDropContainer = null;
+ int sourceDropOffset = 0;
+
+ switch (visualDropContainer.getNodeType()) {
+ case nsIDOMNode.ELEMENT_NODE:
+ nsIDOMNode visualOffsetNode = null;
+ boolean afterFlag = false;
+ long visualChildCount = VisualDomUtil
+ .getChildCount(visualDropContainer);
+ if (visualDropOffset < visualChildCount) {
+ visualOffsetNode = VisualDomUtil.getChildNode(
+ visualDropContainer, visualDropOffset);
+ if (VpeVisualDomBuilder.isPseudoElement(visualOffsetNode)
+ || VpeVisualDomBuilder.isAnonElement(visualOffsetNode)) {
+ visualOffsetNode = VpeVisualDomBuilder
+ .getLastAppreciableVisualChild(visualDropContainer);
+ afterFlag = true;
+ }
+ } else {
+ visualOffsetNode = VpeVisualDomBuilder.getLastAppreciableVisualChild(visualDropContainer);
+ afterFlag = visualChildCount != 0;
+ }
+ if (visualOffsetNode != null) {
+ Node sourceOffsetNode = vpeController.getDomMapping()
+ .getSourceNode(visualOffsetNode);
+ if (sourceOffsetNode != null) {
+ sourceDropContainer = sourceOffsetNode.getParentNode();
+ sourceDropOffset = ((NodeImpl) sourceOffsetNode).getIndex();
+ if (afterFlag) {
+ sourceDropOffset++;
+ }
+ }
+ }
+ if (sourceDropContainer == null) {
+ sourceDropContainer = vpeController.getDomMapping()
+ .getNearSourceNode(visualDropContainer);
+ if (sourceDropContainer != null) {
+ sourceDropOffset = sourceDropContainer.getChildNodes()
+ .getLength();
+ }
+ }
+ if (sourceDropContainer == null) {
+ sourceDropContainer = vpeController.getDomMapping()
+ .getNearSourceNode(
+ vpeController.getVisualBuilder().getContentArea());
+ sourceDropOffset = sourceDropContainer.getChildNodes()
+ .getLength();
+ }
+ break;
+ case nsIDOMNode.TEXT_NODE:
+ VpeNodeMapping nodeMapping = vpeController.getDomMapping()
+ .getNearNodeMapping(visualDropContainer);
+ // switch (nodeMapping.getType()) {
+ // case VpeNodeMapping.TEXT_MAPPING:
+ sourceDropContainer = nodeMapping.getSourceNode();
+ sourceDropOffset = TextUtil.sourceInnerPosition(sourceDropContainer
+ .getNodeValue(), visualDropOffset);
+ // break;
+ // case VpeNodeMapping.ELEMENT_MAPPING:
+ // it's attribute
+ if (VpeVisualDomBuilder.isTextEditable(visualDropContainer)) {
+ String[] atributeNames = ((VpeElementMapping) nodeMapping)
+ .getTemplate().getOutputAttributeNames();
+ if (atributeNames != null && atributeNames.length > 0) {
+ Element sourceElement = (Element) nodeMapping
+ .getSourceNode();
+ sourceDropContainer = sourceElement
+ .getAttributeNode(atributeNames[0]);
+ sourceDropOffset = TextUtil.sourceInnerPosition(
+ sourceDropContainer.getNodeValue(),
+ visualDropOffset);
+ }
+ }
+ nodeMapping.getVisualNode();
+ // }
+ // break;
+ }
+ if (sourceDropContainer != null) {
+ return getSourceInnerDropInfo(sourceDragNode, sourceDropContainer,
+ sourceDropOffset, checkParentTemplates);
+ } else {
+ return new VpeSourceInnerDropInfo(null, 0, false);
+ }
+ }
+
+ private VpeSourceInnerDropInfo getSourceInnerDropInfo(Node dragNode,
+ Node container, int offset, boolean checkParentsTemplates) {
+ // Thread.dumpStack();
+ boolean canDrop = false;
+ switch (container.getNodeType()) {
+ case Node.ELEMENT_NODE:
+ VpeNodeMapping nodeMapping = vpeController.getDomMapping()
+ .getNodeMapping(container);
+ if (nodeMapping != null && nodeMapping instanceof VpeElementMapping) {
+ canDrop = ((VpeElementMapping) nodeMapping).getTemplate()
+ .canInnerDrop(vpeController.getPageContext(), container, dragNode);
+ }
+ if (!canDrop) {
+ if (!checkParentsTemplates)
+ return new VpeSourceInnerDropInfo(container, offset,
+ canDrop);
+ // offset = ((NodeImpl)container).getIndex();
+ // container = container.getParentNode();
+ // TODO Max Areshkau unclear logic , if we can drop on element
+ // why we trying to drop
+ // this on parent
+ // return getSourceInnerDropInfo(dragNode, container, offset,
+ // false);
+ return new VpeSourceInnerDropInfo(container, offset, canDrop);
+ }
+ break;
+ case Node.TEXT_NODE:
+ case Node.DOCUMENT_NODE:
+ canDrop = true;
+ break;
+ case Node.ATTRIBUTE_NODE:
+ canDrop = true;
+ break;
+ }
+ if (canDrop) {
+ return new VpeSourceInnerDropInfo(container, offset, canDrop);
+ } else {
+ return new VpeSourceInnerDropInfo(null, 0, canDrop);
+ }
+ }
+
+ private boolean canInsertAfter(int x, int y, Rectangle rect) {
+ if (y > (rect.y + rect.height) || x > (rect.x + rect.width)) {
+ return true;
+ }
+ return y >= rect.x && x > (rect.x + rect.width / 2);
+ }
+
private void externalDrop(nsIDOMMouseEvent mouseEvent, String flavor, String data) {
vpeController.onHideTooltip();
@@ -615,9 +778,9 @@
Document.class)).createElement(tagname);
VpeVisualInnerDropInfo visualDropInfo = getInnerDropInfo(mouseEvent);
if (visualDropInfo.getDropContainer() != null) {
- VpeSourceInnerDropInfo sourceDropInfo = vpeController.getVisualBuilder()
- .getSourceInnerDropInfo(sourceDragNode,
- visualDropInfo, true);
+ VpeSourceInnerDropInfo sourceDropInfo
+ = getSourceInnerDropInfo(
+ sourceDragNode, visualDropInfo, true);
canDrop = sourceDropInfo.canDrop();
if (canDrop) {
VpeVisualInnerDropInfo newVisualDropInfo = vpeController.getVisualBuilder()
@@ -625,7 +788,7 @@
sourceDropInfo.getContainer(),
sourceDropInfo.getOffset());
if (newVisualDropInfo != null) {
- vpeController.getVisualBuilder().correctVisualDropPosition(
+ correctVisualDropPosition(
newVisualDropInfo, visualDropInfo);
caretParent = newVisualDropInfo.getDropContainer();
caretOffset = newVisualDropInfo.getDropOffset();
@@ -655,6 +818,13 @@
}
+
+ private Point getMousePosition(nsIDOMEvent domEvent) {
+ nsIDOMNSUIEvent nsuiEvent = (nsIDOMNSUIEvent)
+ domEvent.queryInterface(nsIDOMNSUIEvent.NS_IDOMNSUIEVENT_IID);
+ return new Point(nsuiEvent.getPageX(), nsuiEvent.getPageY());
+ }
+
/**
* @return the componentManager
*/
@@ -815,7 +985,7 @@
|| VpeVisualDomBuilder.isAnonElement(child)) {
continue;
}
- Rectangle rect = vpeController.getVisualBuilder().getNodeBounds(child);
+ Rectangle rect = XulRunnerVpeUtils.getElementBounds(child);
int fromTop = mouseY - rect.y;
int fromBottom = mouseY - rect.y - rect.height;
@@ -877,8 +1047,8 @@
} else {
dropContainer = closestNode.getParentNode();
dropOffset = (int)VisualDomUtil.getOffset(closestNode);
- Rectangle rect = vpeController.getVisualBuilder().getNodeBounds(closestNode);
- if (VpeVisualDomBuilder.canInsertAfter(mouseX, mouseY, rect)) {
+ Rectangle rect = XulRunnerVpeUtils.getElementBounds(closestNode);
+ if (canInsertAfter(mouseX, mouseY, rect)) {
dropOffset++;
}
}
@@ -899,7 +1069,7 @@
if (VpeVisualDomBuilder.isPseudoElement(child) || VpeVisualDomBuilder.isAnonElement(child)) {
continue;
}
- Rectangle rect = vpeController.getVisualBuilder().getNodeBounds(child);
+ Rectangle rect = XulRunnerVpeUtils.getElementBounds(child);
int fromTop = y - rect.y;
int fromBottom = y - rect.y - rect.height;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-04-02 01:17:15 UTC (rev 21235)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-04-02 11:33:48 UTC (rev 21236)
@@ -1584,133 +1584,6 @@
return false;
}
- public VpeSourceInnerDropInfo getSourceInnerDropInfo(Node sourceDragNode,
- VpeVisualInnerDropInfo visualDropInfo, boolean checkParentTemplates) {
- nsIDOMNode visualDropContainer = visualDropInfo.getDropContainer();
- long visualDropOffset = visualDropInfo.getDropOffset();
- Node sourceDropContainer = null;
- int sourceDropOffset = 0;
-
- switch (visualDropContainer.getNodeType()) {
- case nsIDOMNode.ELEMENT_NODE:
- nsIDOMNode visualOffsetNode = null;
- boolean afterFlag = false;
- long visualChildCount = VisualDomUtil
- .getChildCount(visualDropContainer);
- if (visualDropOffset < visualChildCount) {
- visualOffsetNode = VisualDomUtil.getChildNode(
- visualDropContainer, visualDropOffset);
- if (isPseudoElement(visualOffsetNode)
- || isAnonElement(visualOffsetNode)) {
- visualOffsetNode = getLastAppreciableVisualChild(visualDropContainer);
- afterFlag = true;
- }
- } else {
- visualOffsetNode = getLastAppreciableVisualChild(visualDropContainer);
- afterFlag = visualChildCount != 0;
- }
- if (visualOffsetNode != null) {
- Node sourceOffsetNode = domMapping
- .getSourceNode(visualOffsetNode);
- if (sourceOffsetNode != null) {
- sourceDropContainer = sourceOffsetNode.getParentNode();
- sourceDropOffset = ((NodeImpl) sourceOffsetNode).getIndex();
- if (afterFlag) {
- sourceDropOffset++;
- }
- }
- }
- if (sourceDropContainer == null) {
- sourceDropContainer = domMapping
- .getNearSourceNode(visualDropContainer);
- if (sourceDropContainer != null) {
- sourceDropOffset = sourceDropContainer.getChildNodes()
- .getLength();
- }
- }
- if (sourceDropContainer == null) {
- sourceDropContainer = domMapping
- .getNearSourceNode(getContentArea());
- sourceDropOffset = sourceDropContainer.getChildNodes()
- .getLength();
- }
- break;
- case nsIDOMNode.TEXT_NODE:
- VpeNodeMapping nodeMapping = domMapping
- .getNearNodeMapping(visualDropContainer);
- // switch (nodeMapping.getType()) {
- // case VpeNodeMapping.TEXT_MAPPING:
- sourceDropContainer = nodeMapping.getSourceNode();
- sourceDropOffset = TextUtil.sourceInnerPosition(sourceDropContainer
- .getNodeValue(), visualDropOffset);
- // break;
- // case VpeNodeMapping.ELEMENT_MAPPING:
- // it's attribute
- if (isTextEditable(visualDropContainer)) {
- String[] atributeNames = ((VpeElementMapping) nodeMapping)
- .getTemplate().getOutputAttributeNames();
- if (atributeNames != null && atributeNames.length > 0) {
- Element sourceElement = (Element) nodeMapping
- .getSourceNode();
- sourceDropContainer = sourceElement
- .getAttributeNode(atributeNames[0]);
- sourceDropOffset = TextUtil.sourceInnerPosition(
- sourceDropContainer.getNodeValue(),
- visualDropOffset);
- }
- }
- nodeMapping.getVisualNode();
- // }
- // break;
- }
- if (sourceDropContainer != null) {
- return getSourceInnerDropInfo(sourceDragNode, sourceDropContainer,
- sourceDropOffset, checkParentTemplates);
- } else {
- return new VpeSourceInnerDropInfo(null, 0, false);
- }
- }
-
- public VpeSourceInnerDropInfo getSourceInnerDropInfo(Node dragNode,
- Node container, int offset, boolean checkParentsTemplates) {
- // Thread.dumpStack();
- boolean canDrop = false;
- switch (container.getNodeType()) {
- case Node.ELEMENT_NODE:
- VpeNodeMapping nodeMapping = domMapping.getNodeMapping(container);
- if (nodeMapping != null && nodeMapping instanceof VpeElementMapping) {
- canDrop = ((VpeElementMapping) nodeMapping).getTemplate()
- .canInnerDrop(pageContext, container, dragNode);
- }
- if (!canDrop) {
- if (!checkParentsTemplates)
- return new VpeSourceInnerDropInfo(container, offset,
- canDrop);
- // offset = ((NodeImpl)container).getIndex();
- // container = container.getParentNode();
- // TODO Max Areshkau unclear logic , if we can drop on element
- // why we trying to drop
- // this on parent
- // return getSourceInnerDropInfo(dragNode, container, offset,
- // false);
- return new VpeSourceInnerDropInfo(container, offset, canDrop);
- }
- break;
- case Node.TEXT_NODE:
- case Node.DOCUMENT_NODE:
- canDrop = true;
- break;
- case Node.ATTRIBUTE_NODE:
- canDrop = true;
- break;
- }
- if (canDrop) {
- return new VpeSourceInnerDropInfo(container, offset, canDrop);
- } else {
- return new VpeSourceInnerDropInfo(null, 0, canDrop);
- }
- }
-
public void innerDrop(Node dragNode, Node container, int offset) {
VpeNodeMapping mapping = domMapping.getNearNodeMapping(container);
if (mapping != null) {
@@ -1776,7 +1649,7 @@
return null;
}
- public boolean isTextEditable(nsIDOMNode visualNode) {
+ public static boolean isTextEditable(nsIDOMNode visualNode) {
if (visualNode != null) {
nsIDOMNode parent = visualNode.getParentNode();
@@ -1940,19 +1813,7 @@
return buffer.toString();
}
- public Rectangle getNodeBounds(nsIDOMNode visualNode) {
-
- return XulRunnerVpeUtils.getElementBounds(visualNode);
- }
-
- public static boolean canInsertAfter(int x, int y, Rectangle rect) {
- if (y > (rect.y + rect.height) || x > (rect.x + rect.width)) {
- return true;
- }
- return y >= rect.x && x > (rect.x + rect.width / 2);
- }
-
- static nsIDOMNode getLastAppreciableVisualChild(nsIDOMNode visualParent) {
+ public static nsIDOMNode getLastAppreciableVisualChild(nsIDOMNode visualParent) {
nsIDOMNode visualLastChild = null;
nsIDOMNodeList visualChildren = visualParent.getChildNodes();
long len = visualChildren.getLength();
@@ -1966,34 +1827,6 @@
return visualLastChild;
}
- public void correctVisualDropPosition(VpeVisualInnerDropInfo newVisualDropInfo,
- VpeVisualInnerDropInfo oldVisualDropInfo) {
- nsIDOMNode newVisualDropContainer = newVisualDropInfo
- .getDropContainer();
- nsIDOMNode oldVisualDropContainer = oldVisualDropInfo
- .getDropContainer();
-
- if (newVisualDropContainer.equals(oldVisualDropContainer)) {
- newVisualDropInfo.setDropOffset(oldVisualDropInfo.getDropOffset());
- return;
- }
-
- nsIDOMNode child = oldVisualDropContainer;
- while (child != null && child.getNodeType() != Node.DOCUMENT_NODE) {
- nsIDOMNode parent = child.getParentNode();
- if (newVisualDropContainer.equals(parent)) {
- long offset = VisualDomUtil.getOffset(child);
- Rectangle rect = getNodeBounds(child);
- if (canInsertAfter(oldVisualDropInfo.getMouseX(),
- oldVisualDropInfo.getMouseY(), rect)) {
- offset++;
- }
- newVisualDropInfo.setDropOffset(offset);
- }
- child = parent;
- }
- }
-
public nsIDOMRange createDOMRange() {
return xulRunnerEditor.createDOMRange();
}
14 years, 9 months