JBoss Tools SVN: r18810 - in trunk/common/plugins: org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-11-24 12:48:49 -0500 (Tue, 24 Nov 2009)
New Revision: 18810
Added:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELRenameProcessor.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableProcessor.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableRefactoring.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameELVariableWizard.java
Removed:
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Messages.java
Modified:
trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java
trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java
trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELRefactorContributionFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4990
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/META-INF/MANIFEST.MF 2009-11-24 17:48:49 UTC (rev 18810)
@@ -21,5 +21,6 @@
org.jboss.tools.common.model,
org.jboss.tools.common.resref.core;visibility:=reexport,
org.eclipse.ui,
- org.eclipse.jdt.ui;bundle-version="3.5.0"
+ org.eclipse.jdt.ui;bundle-version="3.5.0",
+ org.eclipse.ltk.core.refactoring;bundle-version="3.5.0"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Copied: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java (from rev 18564, trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Messages.java)
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/ElCoreMessages.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -0,0 +1,40 @@
+package org.jboss.tools.common.el.core;
+
+import org.eclipse.osgi.util.NLS;
+
+public class ElCoreMessages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.common.el.core.messages"; //$NON-NLS-1$
+ public static String CallRule_ExpectingCommaOrRParen;
+ public static String CallRule_ExpectingRBrace;
+ public static String CallRule_ExpectingRBracket;
+ public static String CallRule_ExpectingRParen;
+ public static String CallRule_UnexpectedLParen;
+ public static String ExpressionRule_CannotStartWithBinaryOp;
+ public static String ExpressionRule_CannotStartWithInstanceof;
+ public static String ExpressionRule_ExpectingExpression;
+ public static String ExpressionRule_ExpectingJavaName;
+ public static String JavaNameTokenDescription_Name;
+ public static String OperationRule_ExpectingRBrace;
+ public static String OperationRule_ExpectingRBracket;
+ public static String OperationRule_ExpectingRParen;
+ public static String OperationTokenDescription_Name;
+ public static String PrimitiveValueTokenDescription_ArgMustResolveToIntegerOrString;
+ public static String PrimitiveValueTokenDescription_Name;
+ public static String StringTokenDescription_Name;
+ public static String WhiteSpaceTokenDescription_Name;
+
+ public static String EL_RENAME_PROCESSOR_LOCATION_NOT_FOUND;
+ public static String EL_RENAME_PROCESSOR_OUT_OF_SYNC_FILE;
+ public static String EL_RENAME_PROCESSOR_ERROR_PHANTOM_FILE;
+ public static String EL_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE;
+ public static String RENAME_EL_VARIABLE_PROCESSOR_TITLE;
+ public static String RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_CONTEXT_VARIABLE;
+
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, ElCoreMessages.class);
+ }
+
+ private ElCoreMessages() {
+ }
+}
Deleted: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Messages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Messages.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/Messages.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -1,32 +0,0 @@
-package org.jboss.tools.common.el.core;
-
-import org.eclipse.osgi.util.NLS;
-
-public class Messages extends NLS {
- private static final String BUNDLE_NAME = "org.jboss.tools.common.el.core.messages"; //$NON-NLS-1$
- public static String CallRule_ExpectingCommaOrRParen;
- public static String CallRule_ExpectingRBrace;
- public static String CallRule_ExpectingRBracket;
- public static String CallRule_ExpectingRParen;
- public static String CallRule_UnexpectedLParen;
- public static String ExpressionRule_CannotStartWithBinaryOp;
- public static String ExpressionRule_CannotStartWithInstanceof;
- public static String ExpressionRule_ExpectingExpression;
- public static String ExpressionRule_ExpectingJavaName;
- public static String JavaNameTokenDescription_Name;
- public static String OperationRule_ExpectingRBrace;
- public static String OperationRule_ExpectingRBracket;
- public static String OperationRule_ExpectingRParen;
- public static String OperationTokenDescription_Name;
- public static String PrimitiveValueTokenDescription_ArgMustResolveToIntegerOrString;
- public static String PrimitiveValueTokenDescription_Name;
- public static String StringTokenDescription_Name;
- public static String WhiteSpaceTokenDescription_Name;
- static {
- // initialize resource bundle
- NLS.initializeMessages(BUNDLE_NAME, Messages.class);
- }
-
- private Messages() {
- }
-}
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELRenameProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELRenameProcessor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELRenameProcessor.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -0,0 +1,268 @@
+/*******************************************************************************
+ * 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.common.el.core.refactoring;
+
+import java.util.ArrayList;
+
+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.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.common.el.core.ELCorePlugin;
+import org.jboss.tools.common.el.core.ElCoreMessages;
+import org.jboss.tools.common.text.ITextSourceReference;
+import org.jboss.tools.common.util.FileUtil;
+
+/**
+ * @author Daniel Azarov
+ */
+public abstract class ELRenameProcessor 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 static final String SEAM_PROPERTIES_FILE = "seam.properties"; //$NON-NLS-1$
+
+ protected RefactoringStatus status;
+
+ protected CompositeChange rootChange;
+ protected TextFileChange lastChange;
+ protected IFile declarationFile=null;
+
+ private ArrayList<String> keys = new ArrayList<String>();
+
+ private String newName;
+ private String oldName;
+
+ private ELSearcher searcher = null;
+
+
+ protected RefactorSearcher getSearcher(){
+ 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;
+ }
+
+ private boolean isBadLocation(ITextSourceReference location, IFile file){
+ boolean flag;
+ if(location == null)
+ flag = true;
+ else
+ flag = location.getStartPosition() == 0 && location.getLength() == 0;
+
+ if(flag)
+ status.addFatalError(Messages.format(ElCoreMessages.EL_RENAME_PROCESSOR_LOCATION_NOT_FOUND, file.getFullPath().toString()));
+ 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) {
+ ELCorePlugin.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) {
+ ELCorePlugin.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 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);
+ }
+ }
+
+ protected boolean isFileCorrect(IFile file){
+ if(!file.isSynchronized(IResource.DEPTH_ZERO)){
+ status.addFatalError(Messages.format(ElCoreMessages.EL_RENAME_PROCESSOR_OUT_OF_SYNC_FILE, file.getFullPath().toString()));
+ return false;
+ }else if(file.isPhantom()){
+ status.addFatalError(Messages.format(ElCoreMessages.EL_RENAME_PROCESSOR_ERROR_PHANTOM_FILE, file.getFullPath().toString()));
+ return false;
+ }else if(file.isReadOnly()){
+ status.addFatalError(Messages.format(ElCoreMessages.EL_RENAME_PROCESSOR_ERROR_READ_ONLY_FILE, file.getFullPath().toString()));
+ return false;
+ }
+ return true;
+ }
+
+
+ public class ELSearcher extends RefactorSearcher{
+
+ public ELSearcher(IFile file, String oldName){
+ super(file, oldName);
+ }
+
+
+ private boolean checkFolder(IResource resource, IResource[] sources, IPath output){
+ for(IResource folder : sources){
+ if(resource.equals(folder))
+ return false;
+ }
+
+ if(resource.getFullPath().equals(output))
+ return false;
+
+ return true;
+ }
+
+
+ ArrayList<String> keys = new ArrayList<String>();
+
+ @Override
+ protected IProject[] getProjects() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ protected IContainer getViewFolder(IProject project) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ @Override
+ protected void match(IFile file, int offset, int length) {
+ // TODO Auto-generated method stub
+
+ }
+
+
+ @Override
+ protected boolean isFileCorrect(IFile file) {
+ return isFileCorrect(file);
+ }
+
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/ELRenameProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableProcessor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableProcessor.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -0,0 +1,143 @@
+ /*******************************************************************************
+ * 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.common.el.core.refactoring;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+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.SharableParticipants;
+import org.eclipse.ltk.internal.core.refactoring.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameELVariableProcessor extends ELRenameProcessor {
+ IFile file;
+
+ /**
+ * @param file where refactor was called
+ */
+ public RenameELVariableProcessor(IFile file, String oldName) {
+ super();
+ this.file = file;
+ setOldName(oldName);
+ }
+
+ /*
+ * (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();
+
+ rootChange = new CompositeChange(ElCoreMessages.RENAME_EL_VARIABLE_PROCESSOR_TITLE);
+
+ //renameELContextVariable(pm, file);
+
+ 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();
+ boolean status = false;
+
+ status = checkELContextVariable();
+
+ if(!status)
+ result.addFatalError(Messages.format(ElCoreMessages.RENAME_EL_VARIABLE_PROCESSOR_CAN_NOT_FIND_CONTEXT_VARIABLE, getOldName()));
+ 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;
+ }
+
+
+ private boolean checkELContextVariable(){
+ boolean status = false;
+
+ IProject[] projects = getSearcher().getProjects();
+ for (IProject project : projects) {
+ // TODO:
+ }
+ return status;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#getElements()
+ */
+ @Override
+ public Object[] getElements() {
+ return new String[]{getNewName()};
+ }
+
+ /*
+ * (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 ElCoreMessages.RENAME_EL_VARIABLE_PROCESSOR_TITLE;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.eclipse.ltk.core.refactoring.participants.RefactoringProcessor#isApplicable()
+ */
+ @Override
+ public boolean isApplicable() throws CoreException {
+ return getNewName()!=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/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableRefactoring.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableRefactoring.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableRefactoring.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -0,0 +1,24 @@
+ /*******************************************************************************
+ * 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.common.el.core.refactoring;
+
+import org.eclipse.ltk.core.refactoring.participants.RenameProcessor;
+import org.eclipse.ltk.core.refactoring.participants.RenameRefactoring;
+
+/**
+ * @author Alexey Kazakov
+ */
+public class RenameELVariableRefactoring extends RenameRefactoring {
+
+ public RenameELVariableRefactoring(RenameProcessor processor) {
+ super(processor);
+ }
+}
\ No newline at end of file
Property changes on: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/core/refactoring/RenameELVariableRefactoring.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/CallRule.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.rule;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.IRule;
import org.jboss.tools.common.el.core.parser.Tokenizer;
import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
@@ -99,18 +99,18 @@
public String getProblem(int state, Tokenizer tokenizer) {
if(ParamUtil.isMethodParamContext(tokenizer.getContext())) {
- return Messages.CallRule_ExpectingCommaOrRParen;
+ return ElCoreMessages.CallRule_ExpectingCommaOrRParen;
} else if(ParamUtil.isComplexExpressionContext(tokenizer.getContext())) {
- return Messages.CallRule_ExpectingRParen;
+ return ElCoreMessages.CallRule_ExpectingRParen;
} else if(ParamUtil.isArgContext(tokenizer.getContext())) {
- return Messages.CallRule_ExpectingRBracket;
+ return ElCoreMessages.CallRule_ExpectingRBracket;
}
if(state == STATE_EXPECTING_CALL_AFTER_METHOD) {
if(ParamStartTokenDescription.INSTANCE.isStart(tokenizer, tokenizer.getCurrentIndex())) {
- return Messages.CallRule_UnexpectedLParen;
+ return ElCoreMessages.CallRule_UnexpectedLParen;
}
}
- return Messages.CallRule_ExpectingRBrace;
+ return ElCoreMessages.CallRule_ExpectingRBrace;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/ExpressionRule.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.rule;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.IRule;
import org.jboss.tools.common.el.core.parser.Tokenizer;
import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
@@ -128,15 +128,15 @@
public String getProblem(int state, Tokenizer tokenizer) {
if(state == STATE_EXPECTING_NAME) {
- return Messages.ExpressionRule_ExpectingJavaName;
+ return ElCoreMessages.ExpressionRule_ExpectingJavaName;
} else {
if(OperationTokenDescription.INSTANCE.isStart(tokenizer, tokenizer.getCurrentIndex())) {
- return Messages.ExpressionRule_CannotStartWithBinaryOp;
+ return ElCoreMessages.ExpressionRule_CannotStartWithBinaryOp;
}
if(JavaNameTokenDescription.INSTANCEOF_INSTANCE.isStart(tokenizer, tokenizer.getCurrentIndex())) {
- return Messages.ExpressionRule_CannotStartWithInstanceof;
+ return ElCoreMessages.ExpressionRule_CannotStartWithInstanceof;
}
- return Messages.ExpressionRule_ExpectingExpression;
+ return ElCoreMessages.ExpressionRule_ExpectingExpression;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/rule/OperationRule.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.rule;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.IRule;
import org.jboss.tools.common.el.core.parser.Tokenizer;
import org.jboss.tools.common.el.internal.core.parser.token.ArgEndTokenDescription;
@@ -73,13 +73,13 @@
public String getProblem(int state, Tokenizer tokenizer) {
if(ParamUtil.isMethodParamContext(tokenizer.getContext())) {
- return Messages.OperationRule_ExpectingRParen;
+ return ElCoreMessages.OperationRule_ExpectingRParen;
} else if(ParamUtil.isComplexExpressionContext(tokenizer.getContext())) {
- return Messages.OperationRule_ExpectingRParen;
+ return ElCoreMessages.OperationRule_ExpectingRParen;
} else if(ParamUtil.isArgContext(tokenizer.getContext())) {
- return Messages.OperationRule_ExpectingRBracket;
+ return ElCoreMessages.OperationRule_ExpectingRBracket;
}
- return Messages.OperationRule_ExpectingRBrace;
+ return ElCoreMessages.OperationRule_ExpectingRBrace;
}
}
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/JavaNameTokenDescription.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.ITokenDescription;
import org.jboss.tools.common.el.core.parser.Tokenizer;
@@ -27,7 +27,7 @@
public static ConstantTokenDescription INSTANCEOF_INSTANCE = InstanceofTokenDescription.INSTANCE;
public String getName() {
- return Messages.JavaNameTokenDescription_Name;
+ return ElCoreMessages.JavaNameTokenDescription_Name;
}
public int getType() {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/OperationTokenDescription.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.ITokenDescription;
import org.jboss.tools.common.el.core.parser.Tokenizer;
@@ -34,7 +34,7 @@
public static OperationTokenDescription INSTANCE = new OperationTokenDescription();
public String getName() {
- return Messages.OperationTokenDescription_Name;
+ return ElCoreMessages.OperationTokenDescription_Name;
}
public int getType() {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/PrimitiveValueTokenDescription.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.ITokenDescription;
import org.jboss.tools.common.el.core.parser.SyntaxError;
import org.jboss.tools.common.el.core.parser.Tokenizer;
@@ -30,7 +30,7 @@
"null", "true", "false", //$NON-NLS-1$//$NON-NLS-2$//$NON-NLS-3$
};
public String getName() {
- return Messages.PrimitiveValueTokenDescription_Name;
+ return ElCoreMessages.PrimitiveValueTokenDescription_Name;
}
public int getType() {
@@ -141,7 +141,7 @@
&& tokenizer.getLastToken().getType() == ArgStartTokenDescription.ARG_START
&& dotCount < 1) {
SyntaxError error = new SyntaxError(dotOffset, BasicStates.STATE_EXPECTING_ARG);
- error.setProblem(Messages.PrimitiveValueTokenDescription_ArgMustResolveToIntegerOrString);
+ error.setProblem(ElCoreMessages.PrimitiveValueTokenDescription_ArgMustResolveToIntegerOrString);
tokenizer.addSyntaxError(error);
}
tokenizer.addToken(getType(), offset, i);
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/StringTokenDescription.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.ITokenDescription;
import org.jboss.tools.common.el.core.parser.Tokenizer;
@@ -25,7 +25,7 @@
public static StringTokenDescription INSTANCE = new StringTokenDescription();
public String getName() {
- return Messages.StringTokenDescription_Name;
+ return ElCoreMessages.StringTokenDescription_Name;
}
public int getType() {
Modified: trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.core/src/org/jboss/tools/common/el/internal/core/parser/token/WhiteSpaceTokenDescription.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -10,7 +10,7 @@
******************************************************************************/
package org.jboss.tools.common.el.internal.core.parser.token;
-import org.jboss.tools.common.el.core.Messages;
+import org.jboss.tools.common.el.core.ElCoreMessages;
import org.jboss.tools.common.el.core.parser.ITokenDescription;
import org.jboss.tools.common.el.core.parser.Tokenizer;
@@ -25,7 +25,7 @@
public static WhiteSpaceTokenDescription INSTANCE = new WhiteSpaceTokenDescription();
public String getName() {
- return Messages.WhiteSpaceTokenDescription_Name;
+ return ElCoreMessages.WhiteSpaceTokenDescription_Name;
}
public int getType() {
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/plugin.xml 2009-11-24 17:48:49 UTC (rev 18810)
@@ -33,5 +33,14 @@
</enablement>
</renameParticipant>
</extension>
+
+ <!-- Refactorng -->
+ <!--extension
+ point="org.eclipse.ui.menus">
+ <menuContribution
+ class="org.jboss.tools.common.el.ui.refactoring.ELRefactorContributionFactory"
+ locationURI="popup:org.eclipse.ui.popup.any?after=save">
+ </menuContribution>
+ </extension-->
</plugin>
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/ElUIMessages.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -19,4 +19,5 @@
public static String REFACTOR_CONTRIBUTOR_MAIN_MENU;
public static String REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE;
+ public static String EL_REFACTOR_RENAME_HANDLER_ERROR;
}
\ No newline at end of file
Modified: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELRefactorContributionFactory.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELRefactorContributionFactory.java 2009-11-24 17:22:25 UTC (rev 18809)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/ELRefactorContributionFactory.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -19,12 +19,10 @@
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.IMethod;
-import org.eclipse.jdt.core.IType;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.internal.ui.text.FastJavaPartitionScanner;
import org.eclipse.jdt.ui.text.IJavaPartitions;
@@ -38,6 +36,7 @@
import org.eclipse.jface.text.rules.Token;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
+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;
@@ -61,10 +60,11 @@
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.ui.ElUiPlugin;
+import org.jboss.tools.common.el.core.refactoring.RenameELVariableProcessor;
+import org.jboss.tools.common.el.core.refactoring.RenameELVariableRefactoring;
import org.jboss.tools.common.el.ui.ElUIMessages;
+import org.jboss.tools.common.el.ui.ElUiPlugin;
import org.jboss.tools.common.model.ui.editor.EditorPartWrapper;
-import org.jboss.tools.common.model.util.EclipseJavaUtil;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.propertieseditor.PropertiesCompoundEditor;
import org.jboss.tools.common.util.FileUtil;
@@ -76,7 +76,7 @@
* @author Daniel Azarov
*/
public class ELRefactorContributionFactory extends AbstractContributionFactory {
- private static final String ANNOTATION_NAME = "org.jboss.seam.annotations.Name"; //$NON-NLS-1$
+ //private static final String ANNOTATION_NAME = "org.jboss.seam.annotations.Name"; //$NON-NLS-1$
private static final String JAVA_EXT = "java"; //$NON-NLS-1$
private static final String XML_EXT = "xml"; //$NON-NLS-1$
private static final String XHTML_EXT = "xhtml"; //$NON-NLS-1$
@@ -168,7 +168,7 @@
status = checkContextVariableInProperties(editorFile, fileContent, selection);
if(status){
- mm.add(new RenameSeamContextVariableAction());
+ mm.add(new RenameELVariableAction());
if(!separatorIsAdded)
additions.addContributionItem(new Separator(), null);
@@ -210,7 +210,7 @@
ELModel model = parser.parse(string);
for (ELInstance instance : model.getInstances()) {
for(ELInvocationExpression ie : instance.getExpression().getInvocations()){
- ELPropertyInvocation pi = findSeamContextVariable(ie);
+ ELPropertyInvocation pi = findELVariable(ie);
if(pi != null){
if(offset+pi.getStartPosition() == selection.getOffset() && pi.getLength() == selection.getLength())
return true;
@@ -221,7 +221,7 @@
return false;
}
- private ELPropertyInvocation findSeamContextVariable(ELInvocationExpression invocationExpression){
+ private ELPropertyInvocation findELVariable(ELInvocationExpression invocationExpression){
ELInvocationExpression invExp = invocationExpression;
while(invExp != null){
if(invExp instanceof ELPropertyInvocation){
@@ -305,36 +305,6 @@
return scanString(file, content, 0, selection);
}
- private IAnnotation getNameAnnotation(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_NAME))
- return annotation;
- }
- }
- }catch(CoreException ex){
- ElUiPlugin.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 String getPropertyName(IMethod method){
String name = method.getElementName();
@@ -358,29 +328,29 @@
}
}
- public static void invokeRenameSeamContextVariableWizard(String oldName, Shell activeShell) {
-// saveAndBuild();
-//
-// RenameSeamContextVariableProcessor processor = new RenameSeamContextVariableProcessor(editorFile, selectedText);
-// RenameComponentRefactoring refactoring = new RenameComponentRefactoring(processor);
-// RenameSeamContextVariableWizard wizard = new RenameSeamContextVariableWizard(refactoring, editorFile);
+ public static void invokeRenameELVariableWizard(String oldName, Shell activeShell) {
+ saveAndBuild();
+
+ RenameELVariableProcessor processor = new RenameELVariableProcessor(editorFile, selectedText);
+ RenameELVariableRefactoring refactoring = new RenameELVariableRefactoring(processor);
+ //RenameELVariableWizard wizard = new RenameELVariableWizard(refactoring, editorFile);
// RefactoringWizardOpenOperation op = new RefactoringWizardOpenOperation(wizard);
// try {
-// String titleForFailedChecks = ElUIMessages.SEAM_COMPONENT_RENAME_HANDLER_ERROR;
+// String titleForFailedChecks = ElUIMessages.EL_REFACTOR_RENAME_HANDLER_ERROR;
// op.run(activeShell, titleForFailedChecks);
// } catch (final InterruptedException irex) {
// // operation was canceled
// }
}
- class RenameSeamContextVariableAction extends Action{
- public RenameSeamContextVariableAction(){
+ class RenameELVariableAction extends Action{
+ public RenameELVariableAction(){
super(ElUIMessages.REFACTOR_CONTRIBUTOR_RENAME_EL_VARIABLE);
}
public void run(){
saveAndBuild();
- invokeRenameSeamContextVariableWizard(selectedText, shell);
+ invokeRenameELVariableWizard(selectedText, shell);
}
}
Added: trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameELVariableWizard.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameELVariableWizard.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameELVariableWizard.java 2009-11-24 17:48:49 UTC (rev 18810)
@@ -0,0 +1,109 @@
+ /*******************************************************************************
+ * 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.common.el.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.common.el.core.refactoring.RenameELVariableProcessor;
+import org.jboss.tools.common.model.ui.attribute.editor.IFieldEditor;
+
+/**
+ * @author Daniel Azarov
+ */
+public class RenameELVariableWizard extends RefactoringWizard {
+
+ private String componentName;
+ private IFieldEditor editor;
+
+ public RenameELVariableWizard(Refactoring refactoring) {
+ super(refactoring, WIZARD_BASED_USER_INTERFACE);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ltk.ui.refactoring.RefactoringWizard#addUserInputPages()
+ */
+ @Override
+ protected void addUserInputPages() {
+ setDefaultPageTitle(getRefactoring().getName());
+ RenameELVariableProcessor processor= (RenameELVariableProcessor) getRefactoring().getAdapter(RenameELVariableProcessor.class);
+ addPage(new RenameELVariableWizardPage(processor));
+ }
+
+ class RenameELVariableWizardPage extends UserInputWizardPage{
+ private RenameELVariableProcessor processor;
+
+ public RenameELVariableWizardPage(RenameELVariableProcessor 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 = component.getName();
+// editor = IFieldEditorFactory.INSTANCE.createTextEditor(componentName, SeamUIMessages.SEAM_WIZARD_FACTORY_SEAM_COMPONENT_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/common/plugins/org.jboss.tools.common.el.ui/src/org/jboss/tools/common/el/ui/refactoring/RenameELVariableWizard.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 1 month
JBoss Tools SVN: r18809 - trunk/jsf/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2009-11-24 12:22:25 -0500 (Tue, 24 Nov 2009)
New Revision: 18809
Modified:
trunk/jsf/docs/userguide/en/modules/editors.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-951 Support for tag libs - section on taglibs - updated
Modified: trunk/jsf/docs/userguide/en/modules/editors.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/editors.xml 2009-11-24 16:24:05 UTC (rev 18808)
+++ trunk/jsf/docs/userguide/en/modules/editors.xml 2009-11-24 17:22:25 UTC (rev 18809)
@@ -205,10 +205,9 @@
</imageobject>
</mediaobject>
</figure>
-
+
</section>
-
-
+
</section>
<section id="CodeAssistAndDynamicCodeAssist42BasedOnProjectData">
@@ -1077,9 +1076,10 @@
</section>
<section id="taglib_versions_support">
- <title>Support for Taglib versions</title>
+ <title>Support for custom TagLibs and Taglib versions</title>
+ <para>VPE templates support custom tag libs, e.g. Seam Mail facelet taglib, RichFaces taglibs or any other created by you.</para>
- <para>VPE templates now support various versions of tag libraries. It means that the
+ <para>VPE templates also provide a support for various versions of tag libraries. It means that the
<property>VPE</property> takes control over those components which have
different parameters or preview according to the framework version (like seam
1.2 and seam 2.0, or JSF 1.1 and JSF 1.2).</para>
15 years, 1 month
JBoss Tools SVN: r18808 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring.
by jbosstools-commits@lists.jboss.org
Author: dazarov
Date: 2009-11-24 11:24:05 -0500 (Tue, 24 Nov 2009)
New Revision: 18808
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4990
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-11-24 16:14:36 UTC (rev 18807)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/refactoring/SeamRefactorContributionFactory.java 2009-11-24 16:24:05 UTC (rev 18808)
@@ -135,6 +135,10 @@
&& !PROPERTIES_EXT.equalsIgnoreCase(ext))
return;
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(editorFile.getProject(), true);
+ if(seamProject == null)
+ return;
+
MenuManager mm = new MenuManager(SeamUIMessages.SEAM_REFACTOR);
mm.setVisible(true);
15 years, 1 month
JBoss Tools SVN: r18807 - trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-11-24 11:14:36 -0500 (Tue, 24 Nov 2009)
New Revision: 18807
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch
trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch
Log:
https://jira.jboss.org/jira/browse/JBIDE-4899
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch 2009-11-24 16:04:51 UTC (rev 18806)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch 2009-11-24 16:14:36 UTC (rev 18807)
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Hibernate Console launch configuration -->
-<launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType">
+<launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType">
+<stringAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS" value="\@projectName@">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName@"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME" value="@connectionProfile@"/>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch 2009-11-24 16:04:51 UTC (rev 18806)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch 2009-11-24 16:14:36 UTC (rev 18807)
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Hibernate Console launch configuration -->
-<launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType">
+<launchConfiguration type="org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType">
+<stringAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS" value="\@projectName@">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName@"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
<stringAttribute key="org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE" value="true"/>
15 years, 1 month
JBoss Tools SVN: r18806 - in trunk/hibernatetools/plugins: org.hibernate.eclipse.console/src/org/hibernate/eclipse/console and 9 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-11-24 11:04:51 -0500 (Tue, 24 Nov 2009)
New Revision: 18806
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5222
Support filtering console configurations in closed or deleted projects.
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/plugin.xml 2009-11-24 16:04:51 UTC (rev 18806)
@@ -723,7 +723,7 @@
</moveParticipant>
</extension>
- <extension
+ <!-- extension
point="org.eclipse.ltk.core.refactoring.deleteParticipants">
<deleteParticipant
class="org.hibernate.eclipse.console.DeleteProjectParticipant"
@@ -737,7 +737,7 @@
</instanceof>
</with></enablement>
</deleteParticipant>
- </extension>
+ </extension -->
<extension
point="org.eclipse.ui.popupMenus">
<!--<objectContribution
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ConfigurationCombo.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -13,6 +13,7 @@
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.KnownConfigurationsAdapter;
import org.hibernate.console.KnownConfigurationsListener;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
final class ConfigurationCombo extends ComboContribution {
@@ -65,8 +66,7 @@
}
protected void populateComboBox() {
- ConsoleConfiguration[] configurations = KnownConfigurations
- .getInstance().getConfigurationsSortedByName();
+ ConsoleConfiguration[] configurations = LaunchHelper.findFilteredSortedConsoleConfigs();
final String[] names = new String[configurations.length];
for (int i = 0; i < configurations.length; i++) {
names[i] = configurations[i].getName();
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/properties/HibernatePropertyPage.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -65,6 +65,7 @@
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.utils.ProjectUtils;
import org.osgi.service.prefs.BackingStoreException;
import org.osgi.service.prefs.Preferences;
@@ -196,7 +197,7 @@
selectedConfiguration.setLayoutData(gd);
// Populate owner text field
- ConsoleConfiguration[] configurations = KnownConfigurations.getInstance().getConfigurationsSortedByName();
+ ConsoleConfiguration[] configurations = LaunchHelper.findFilteredSortedConsoleConfigs();
for (int i = 0; i < configurations.length; i++) {
ConsoleConfiguration configuration = configurations[i];
selectedConfiguration.add(configuration.getName() );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/utils/LaunchHelper.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -1,5 +1,8 @@
package org.hibernate.eclipse.console.utils;
+import java.util.ArrayList;
+import java.util.List;
+
import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.Platform;
@@ -7,12 +10,17 @@
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.osgi.util.NLS;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.actions.AddConfigurationAction;
import org.hibernate.eclipse.launch.ICodeGenerationLaunchConstants;
+@SuppressWarnings("restriction")
public class LaunchHelper {
public static ILaunchConfiguration findHibernateLaunchConfig(String name) throws CoreException {
@@ -20,6 +28,48 @@
ICodeGenerationLaunchConstants.CONSOLE_CONFIGURATION_LAUNCH_TYPE_ID, name);
}
+ /**
+ * UI elements should use this method as it does filtering of launch configuration related
+ * to deleted or closed projects if the settings are set.
+ * @return
+ * @throws CoreException
+ */
+ public static ILaunchConfiguration[] findFilteredHibernateLaunchConfigs() throws CoreException{
+ ILaunchConfiguration[] allHibernateLaunchConfigurations = findHibernateLaunchConfigs();
+ List<ILaunchConfiguration> launchConfigurations = new ArrayList<ILaunchConfiguration>();
+ for (ILaunchConfiguration config : allHibernateLaunchConfigurations) {
+ if (DebugUIPlugin.doLaunchConfigurationFiltering(config)) launchConfigurations.add(config);
+ }
+ return launchConfigurations.toArray(new ILaunchConfiguration[launchConfigurations.size()]);
+ }
+
+ /**
+ * UI elements should use this method as it does filtering of console configuration related
+ * to deleted or closed projects if the settings are set.
+ * @return
+ * @throws CoreException
+ */
+ public static ConsoleConfiguration[] findFilteredSortedConsoleConfigs() {
+ ConsoleConfiguration[] ccs = KnownConfigurations.getInstance().getConfigurationsSortedByName();
+ List<ConsoleConfiguration> consoleConfigurations = new ArrayList<ConsoleConfiguration>();
+ for (ConsoleConfiguration cc : ccs) {
+ boolean isAccepted = true;
+ try {
+ ILaunchConfiguration config = LaunchHelper.findHibernateLaunchConfig(cc.getName());
+ if (config != null){
+ isAccepted = DebugUIPlugin.doLaunchConfigurationFiltering(config);
+ }
+ } catch (CoreException e) {
+ HibernateConsolePlugin.getDefault().showError(null, e.getLocalizedMessage(), e);
+ }
+ if (isAccepted){
+ consoleConfigurations .add(cc);
+ }
+ }
+ return consoleConfigurations.toArray(new ConsoleConfiguration[consoleConfigurations.size()]);
+
+ }
+
public static ILaunchConfigurationType getHibernateLaunchConfigsType(){
ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
return launchManager.getLaunchConfigurationType(
@@ -53,6 +103,17 @@
return null;
}
+ public static ILaunchConfiguration[] findProjectRelatedHibernateLaunchConfigs(String projectName) throws CoreException {
+ ILaunchManager launchManager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfiguration[] configs = launchManager.getLaunchConfigurations(getHibernateLaunchConfigsType());
+ List<ILaunchConfiguration> list = new ArrayList<ILaunchConfiguration>();
+ for(int i = 0; i < configs.length && configs[i].exists(); i++) {
+ String project = configs[i].getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
+ if (projectName.equals(project)) list.add(configs[i]);
+ }
+ return list.toArray(new ILaunchConfiguration[list.size()]);
+ }
+
public static String verifyConfigurationName(String currentName) {
if (currentName == null || currentName.length() < 1) {
return HibernateConsoleMessages.ConsoleConfigurationWizardPage_name_must_specified;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConsoleConfigurationPropertySource.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -23,15 +23,18 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.Collections;
import java.util.List;
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.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.internal.core.LaunchConfiguration;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.viewers.ICellEditorValidator;
import org.eclipse.jface.viewers.LabelProvider;
@@ -50,6 +53,7 @@
import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.launch.IConsoleConfigurationLaunchConstants;
+@SuppressWarnings("restriction")
public class ConsoleConfigurationPropertySource implements IPropertySource {
private ConsoleConfiguration cfg;
@@ -220,7 +224,16 @@
ILaunchConfiguration lc = HibernateConsolePlugin.getDefault().findLaunchConfig(cfg.getName());
if (lc != null){
ILaunchConfigurationWorkingCopy wc = lc.getWorkingCopy();
- wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, getSortedProjectNames()[index]);
+ String projectName = getSortedProjectNames()[index];
+ wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
+ if (projectName != null){
+ wc.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS,
+ Collections.singletonList(projectName));
+ wc.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, Collections.singletonList(Integer.toString(IResource.PROJECT)));
+ } else {
+ wc.removeAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS);
+ wc.removeAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES);
+ }
wc.doSave();
} else {
HibernateConsolePlugin.getDefault().log("Can't find Console Configuration \"" + cfg.getName() + "\"");//$NON-NLS-1$//$NON-NLS-2$
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -21,8 +21,20 @@
*/
package org.hibernate.eclipse.console.views;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+import org.eclipse.core.resources.IResourceDelta;
+import org.eclipse.core.resources.IResourceDeltaVisitor;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.Platform;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
@@ -32,13 +44,18 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
import org.hibernate.console.KnownConfigurationsListener;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.workbench.DeferredContentProvider;
-public class KnownConfigurationsProvider extends DeferredContentProvider implements KnownConfigurationsListener {
+@SuppressWarnings("restriction")
+public class KnownConfigurationsProvider extends DeferredContentProvider implements KnownConfigurationsListener,
+ IResourceChangeListener, IPropertyChangeListener {
private TreeViewer tv;
public KnownConfigurationsProvider() {
+ ResourcesPlugin.getWorkspace().addResourceChangeListener(this, IResourceChangeEvent.POST_CHANGE | IResourceChangeEvent.PRE_DELETE);
+
}
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
@@ -108,4 +125,68 @@
public void configurationBuilt(ConsoleConfiguration ccfg) {
//TODO refresh tree?
}
+
+ public void resourceChanged(IResourceChangeEvent event) {
+ IResourceDelta delta = event.getDelta();
+ if (delta != null) {
+ try {
+ delta.accept(new KnownConfigurationsVisitor());
+ } catch (CoreException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ class KnownConfigurationsVisitor implements IResourceDeltaVisitor {
+
+ /**
+ * @see IResourceDeltaVisitor#visit(IResourceDelta)
+ */
+ public boolean visit(IResourceDelta delta) {
+ if (delta == null) {
+ return false;
+ }
+ if (0 != (delta.getFlags() & IResourceDelta.OPEN)) {
+ if (delta.getResource() instanceof IProject) {
+ IProject project = (IProject)delta.getResource();
+ if (project.isOpen()) {
+ try {
+ ILaunchConfiguration[] configs = LaunchHelper.findProjectRelatedHibernateLaunchConfigs(project.getName());
+ if (configs.length > 0) refreshTree();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ refreshTree();
+ }
+ }
+ }
+ return false;
+ }
+ IResource resource = delta.getResource();
+ if (resource instanceof IProject) {
+ IProject project = (IProject)resource;
+ switch (delta.getKind()) {
+ case IResourceDelta.ADDED:
+ case IResourceDelta.REMOVED :
+ try {
+ ILaunchConfiguration[] configs = LaunchHelper.findProjectRelatedHibernateLaunchConfigs(project.getName());
+ if (configs.length > 0) refreshTree();
+ } catch (CoreException e) {
+ e.printStackTrace();
+ refreshTree();
+ }
+ }
+ return false;
+ }
+ return true;
+ }
+ }
+
+ public void propertyChange(PropertyChangeEvent event) {
+ if(event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_CLOSED) ||
+ event.getProperty().equals(IInternalDebugUIConstants.PREF_FILTER_LAUNCH_DELETED)) {
+ refreshTree();
+ }
+ }
+
+
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsView.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -24,6 +24,7 @@
import java.io.FileNotFoundException;
+import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuListener;
@@ -38,6 +39,8 @@
import org.eclipse.jface.viewers.TreeSelection;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.ui.IActionBars;
@@ -64,6 +67,7 @@
* @author max
*
*/
+@SuppressWarnings("restriction")
public class KnownConfigurationsView extends ViewPart {
public static final String ID = "org.hibernate.eclipse.console.views.KnownConfigurationsView"; //$NON-NLS-1$
@@ -88,8 +92,17 @@
viewer.setLabelProvider(new AnyAdaptableLabelProvider());
- viewer.setContentProvider(new KnownConfigurationsProvider());
+ final KnownConfigurationsProvider cp = new KnownConfigurationsProvider();
+ viewer.setContentProvider(cp);
+ DebugUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(cp);
+ viewer.getTree().addDisposeListener(new DisposeListener() {
+
+ public void widgetDisposed(DisposeEvent e) {
+ DebugUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(cp);
+ }
+ });
+
//viewer.setInput(KnownConfigurations.getInstance().getRootNode() );
viewer.setInput( KnownConfigurations.getInstance() );
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/ConsoleConfigurationWizardPage.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -23,6 +23,7 @@
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import org.eclipse.core.resources.IContainer;
@@ -31,9 +32,11 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.core.LaunchConfiguration;
import org.eclipse.debug.ui.ILaunchConfigurationDialog;
import org.eclipse.debug.ui.ILaunchConfigurationTab;
import org.eclipse.jdt.core.IJavaElement;
@@ -81,6 +84,7 @@
*
* @author max
*/
+@SuppressWarnings("restriction")
public class ConsoleConfigurationWizardPage extends WizardPage implements
ILaunchConfigurationDialog {
@@ -421,9 +425,14 @@
static protected void setProjAttribute(ILaunchConfigurationWorkingCopy currentLaunchConfig, String attr, IJavaProject proj) {
if (proj != null) {
currentLaunchConfig.setAttribute(attr, nonEmptyTrimOrNull(proj.getElementName()));
+ currentLaunchConfig.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS,
+ Collections.singletonList(new Path(nonEmptyTrimOrNull(proj.getElementName())).makeAbsolute().toString()));
+ currentLaunchConfig.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, Collections.singletonList(Integer.toString(IResource.PROJECT)));
}
else {
currentLaunchConfig.setAttribute(attr, (String)null);
+ currentLaunchConfig.removeAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS);
+ currentLaunchConfig.removeAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES);
}
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/wizards/TableFilterWizardPage.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -35,13 +35,14 @@
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
import org.hibernate.eclipse.console.model.ITableFilter;
import org.hibernate.eclipse.console.model.impl.ReverseEngineeringDefinitionImpl;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
+@SuppressWarnings("restriction")
public class TableFilterWizardPage extends WizardPage {
// TODO: clean this up to use a shared wizard model
@@ -75,7 +76,7 @@
consoleConfigurationName = new ComboDialogField(SWT.READ_ONLY);
consoleConfigurationName.setLabelText(HibernateConsoleMessages.TableFilterWizardPage_console_configuration);
- ConsoleConfiguration[] cfg = KnownConfigurations.getInstance().getConfigurationsSortedByName();
+ ConsoleConfiguration[] cfg = LaunchHelper.findFilteredSortedConsoleConfigs();
String[] names = new String[cfg.length];
for (int i = 0; i < cfg.length; i++) {
ConsoleConfiguration configuration = cfg[i];
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/KnownConfigurationsWorkbenchAdapter.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -26,14 +26,13 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
import org.eclipse.ui.progress.IElementCollector;
-import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
public class KnownConfigurationsWorkbenchAdapter implements IDeferredWorkbenchAdapter {
public Object[] getChildren(Object o) {
- KnownConfigurations kc = (KnownConfigurations) o;
- return kc.getConfigurationsSortedByName();
+ return LaunchHelper.findFilteredSortedConsoleConfigs();
}
public ImageDescriptor getImageDescriptor(Object object) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/CodeGenerationSettingsTab.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -58,11 +58,11 @@
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.ImageConstants;
-import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.HibernateConsoleMessages;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.hibernate.eclipse.console.utils.DialogSelectionHelper;
import org.hibernate.eclipse.console.utils.EclipseImages;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.console.wizards.NewReverseEngineeringFileWizard;
@SuppressWarnings("restriction")
@@ -113,7 +113,7 @@
consoleConfigurationName = new ComboDialogField(SWT.READ_ONLY);
consoleConfigurationName.setLabelText(HibernateConsoleMessages.CodeGenerationSettingsTab_console_configuration);
- ConsoleConfiguration[] cfg = KnownConfigurations.getInstance().getConfigurationsSortedByName();
+ ConsoleConfiguration[] cfg = LaunchHelper.findFilteredSortedConsoleConfigs();
String[] names = new String[cfg.length];
for (int i = 0; i < cfg.length; i++) {
ConsoleConfiguration configuration = cfg[i];
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/launch/ConsoleConfigurationMainTab.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -3,6 +3,8 @@
*/
package org.hibernate.eclipse.launch;
+import java.util.Collections;
+
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
@@ -10,6 +12,7 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
+import org.eclipse.debug.internal.core.LaunchConfiguration;
import org.eclipse.debug.internal.ui.SWTFactory;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
@@ -165,9 +168,17 @@
public void performApply(ILaunchConfigurationWorkingCopy configuration) {
-
+ String projectName = nonEmptyTrimOrNull( projectNameText );
configuration.setAttribute(IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, getConfigurationMode().toString());
- configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, nonEmptyTrimOrNull( projectNameText ));
+ configuration.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, projectName);
+ if (projectName != null){
+ configuration.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS,
+ Collections.singletonList(nonEmptyTrimOrNull( projectName )));
+ configuration.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, Collections.singletonList(Integer.toString(IResource.PROJECT)));
+ } else {
+ configuration.removeAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS);
+ configuration.removeAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES);
+ }
configuration.setAttribute(IConsoleConfigurationLaunchConstants.PROPERTY_FILE, nonEmptyTrimOrNull(propertyFileText));
configuration.setAttribute(IConsoleConfigurationLaunchConstants.CFG_XML_FILE, nonEmptyTrimOrNull(configurationFileText));
configuration.setAttribute(IConsoleConfigurationLaunchConstants.PERSISTENCE_UNIT_NAME, nonEmptyTrimOrNull(persistenceUnitNameText));
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/ChooseConsoleConfigurationDialog.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -16,7 +16,7 @@
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.mapper.MapperMessages;
public class ChooseConsoleConfigurationDialog extends TitleAreaDialog {
@@ -103,7 +103,7 @@
}
private void setInitialTextValues(Combo text) {
- ConsoleConfiguration[] recentWorkspaces = KnownConfigurations.getInstance().getConfigurationsSortedByName();
+ ConsoleConfiguration[] recentWorkspaces = LaunchHelper.findFilteredSortedConsoleConfigs();
for (int i = 0; i < recentWorkspaces.length; ++i) {
text.add(recentWorkspaces[i].getName());
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.mapper/src/org/hibernate/eclipse/mapper/editors/reveng/ConsoleConfigNamePart.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -30,8 +30,8 @@
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.KnownConfigurations;
import org.hibernate.eclipse.console.model.IReverseEngineeringDefinition;
+import org.hibernate.eclipse.console.utils.LaunchHelper;
import org.hibernate.eclipse.mapper.MapperMessages;
import org.hibernate.eclipse.mapper.MapperPlugin;
import org.hibernate.eclipse.mapper.editors.ReverseEngineeringEditor;
@@ -76,7 +76,7 @@
text.setEditable(false);
adaptRecursively(toolkit, text);
- ConsoleConfiguration[] cfg = KnownConfigurations.getInstance().getConfigurationsSortedByName();
+ ConsoleConfiguration[] cfg = LaunchHelper.findFilteredSortedConsoleConfigs();
String[] names = new String[cfg.length];
for (int i = 0; i < cfg.length; i++) {
ConsoleConfiguration configuration = cfg[i];
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java 2009-11-24 15:56:52 UTC (rev 18805)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/JPAPostInstallFasetListener.java 2009-11-24 16:04:51 UTC (rev 18806)
@@ -11,16 +11,20 @@
package org.jboss.tools.hibernate.jpt.core.internal;
import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.Path;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.internal.core.LaunchConfiguration;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jpt.core.JptCorePlugin;
import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
@@ -75,7 +79,7 @@
for (int i = 0; i < lcs.length; i++){
ILaunchConfiguration lc = lcs[i];
if (project.getName().equals(
- lc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, ""))){//lc uses this project //$NON-NLS-1$
+ lc.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null))){//lc uses this project //$NON-NLS-1$
if (project.getName().equals(lc.getName())) return lc;
configs.add(lc);
}
@@ -96,11 +100,14 @@
ILaunchConfigurationWorkingCopy wc;
try {
wc = lct.newInstance(null, launchName);
+ wc.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_PATHS,
+ Collections.singletonList(new Path(project.getName()).makeAbsolute().toString()));
+ wc.setAttribute(LaunchConfiguration.ATTR_MAPPED_RESOURCE_TYPES, Collections.singletonList(Integer.toString(IResource.PROJECT)));
wc.setAttribute(IConsoleConfigurationLaunchConstants.CONFIGURATION_FACTORY, ConfigurationMode.JPA.toString());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, project.getName());
wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH, true );
wc.setAttribute(IConsoleConfigurationLaunchConstants.FILE_MAPPINGS, (List<String>)null);
- wc.setAttribute(IConsoleConfigurationLaunchConstants.USE_JPA_PROJECT_PROFILE, "true");//$NON-NLS-1$
+ wc.setAttribute(IConsoleConfigurationLaunchConstants.USE_JPA_PROJECT_PROFILE, Boolean.toString(true));
wc.doSave();
ProjectUtils.toggleHibernateOnProject(project, true, launchName);
15 years, 1 month
JBoss Tools SVN: r18805 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-24 10:56:52 -0500 (Tue, 24 Nov 2009)
New Revision: 18805
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
Log:
JBIDE-5119
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-11-24 15:54:51 UTC (rev 18804)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/outline/ValueHelper.java 2009-11-24 15:56:52 UTC (rev 18805)
@@ -47,7 +47,7 @@
import org.jboss.tools.jst.web.kb.PageProcessor;
import org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType;
import org.jboss.tools.jst.web.kb.internal.taglib.CustomTagLibAttribute;
-import org.jboss.tools.jst.web.kb.internal.taglib.ExtendedProposalType;
+import org.jboss.tools.jst.web.kb.internal.taglib.EmptyProposalType;
import org.jboss.tools.jst.web.kb.taglib.IAttribute;
import org.jboss.tools.jst.web.tld.TaglibData;
import org.jboss.tools.jst.web.tld.VpeTaglibManager;
@@ -156,7 +156,7 @@
if(hasJSFNature) {
for (String type : TYPES) {
if(proposalTypes.contains(type)) continue;
- ExtendedProposalType pt = new ExtendedProposalType();
+ EmptyProposalType pt = new EmptyProposalType();
pt.setType(type);
proposals.add(pt);
}
15 years, 1 month
JBoss Tools SVN: r18804 - trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-11-24 10:54:51 -0500 (Tue, 24 Nov 2009)
New Revision: 18804
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
Log:
removed unnecessary code
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2009-11-24 15:54:45 UTC (rev 18803)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2009-11-24 15:54:51 UTC (rev 18804)
@@ -59,12 +59,7 @@
protected void checkChildren() {
if(!childrenCreated) {
- ConsoleConfiguration[] configurations = kc.getConfigurations();
- Arrays.sort(configurations, new Comparator<ConsoleConfiguration>() {
- public int compare(ConsoleConfiguration o1, ConsoleConfiguration o2) {
- return o1.getName().compareTo(o2.getName());
- }
- });
+ ConsoleConfiguration[] configurations = kc.getConfigurationsSortedByName();
for (int i = 0; i < configurations.length; i++) {
children.add(new ConfigurationNode(this, configurations[i]) );
}
15 years, 1 month
JBoss Tools SVN: r18803 - in trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb: internal/taglib and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2009-11-24 10:54:45 -0500 (Tue, 24 Nov 2009)
New Revision: 18803
Added:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java
Removed:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpace.java
trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java
Log:
JBIDE-5119
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IPageContext.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -43,13 +43,6 @@
IDocument getDocument();
/**
- * Returns "var" attributes which are available in particular offset.
- * @param offset
- * @return
- */
-// Var[] getVars(int offset);
-
- /**
* Returns map of name spaces which are set in particular offset.
* Key is URI of name space.
* @return
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/IProposalProcessor.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -10,7 +10,6 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
/**
@@ -22,6 +21,5 @@
/**
* @return proposals
*/
- public TextProposal[] getProposals(KbQuery query, ELContext context);
-
+ public TextProposal[] getProposals(KbQuery query, IPageContext context);
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/PageProcessor.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -29,7 +29,7 @@
/**
* @author Alexey Kazakov
*/
-public class PageProcessor implements IProposalProcessor {
+public class PageProcessor {
private static final PageProcessor INSTANCE = new PageProcessor();
private ICustomTagLibrary[] customTagLibs;
@@ -47,9 +47,11 @@
componentExtensions = CustomTagLibManager.getInstance().getComponentExtensions();
}
- /*
- * (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.ProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
+ /**
+ *
+ * @param query
+ * @param context
+ * @return
*/
public TextProposal[] getProposals(KbQuery query, ELContext context) {
ArrayList<TextProposal> proposals = new ArrayList<TextProposal>();
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractAttribute.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -13,12 +13,12 @@
import java.util.List;
import java.util.Properties;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.ext.IValueInfo;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.internal.KbObject;
import org.jboss.tools.jst.web.kb.internal.KbXMLStoreConstants;
@@ -111,10 +111,11 @@
return (IComponent)parent;
}
- /* (non-Javadoc)
- * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.ELContext)
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
- public TextProposal[] getProposals(KbQuery query, ELContext context) {
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
return EMPTY_PROPOSAL_LIST;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractComponent.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -18,7 +18,6 @@
import java.util.Properties;
import java.util.Set;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.model.project.ext.IValueInfo;
import org.jboss.tools.common.model.project.ext.event.Change;
import org.jboss.tools.common.model.project.ext.store.XMLStoreConstants;
@@ -331,11 +330,8 @@
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
- public TextProposal[] getProposals(KbQuery query, ELContext context) {
- if (!(context instanceof IPageContext))
- return EMPTY_PROPOSAL_LIST;
-
- IAttribute[] attributes = getAttributes(query, (IPageContext)context);
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
+ IAttribute[] attributes = getAttributes(query, context);
if(attributes == null || attributes.length == 0) {
return EMPTY_PROPOSAL_LIST;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/AbstractTagLib.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -22,7 +22,6 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IPath;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.project.ext.IValueInfo;
import org.jboss.tools.common.model.project.ext.event.Change;
@@ -390,13 +389,10 @@
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.ProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.PageContext)
*/
- public TextProposal[] getProposals(KbQuery query, ELContext context) {
- if (!(context instanceof IPageContext))
- return EMPTY_PROPOSAL_LIST;
-
- List<String> prefixes = getPrefixes(query, (IPageContext)context);
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
+ List<String> prefixes = getPrefixes(query, context);
List<TextProposal> proposals = new ArrayList<TextProposal>();
- IComponent[] components = getComponentsByPrefixes(query, prefixes, (IPageContext)context);
+ IComponent[] components = getComponentsByPrefixes(query, prefixes, context);
if(query.getType() == KbQuery.Type.TAG_NAME || query.getType() == KbQuery.Type.TEXT) {
for (int i = 0; i < components.length; i++) {
if(!(components[i] instanceof CustomComponentExtension)) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CSSClassProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -18,9 +18,9 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.css.core.internal.provisional.document.ICSSStyleRule;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.ICSSContainerSupport;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
import org.jboss.tools.jst.web.kb.PageContextFactory.CSSStyleSheetDescriptor;
@@ -45,7 +45,7 @@
Set<String> idList = new TreeSet<String>();
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
idList.clear();
if (context instanceof ICSSContainerSupport) {
ICSSContainerSupport cssSource = (ICSSContainerSupport)context;
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -10,8 +10,8 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.taglib;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.IProposalProcessor;
import org.jboss.tools.jst.web.kb.KbQuery;
@@ -22,9 +22,9 @@
protected Param[] params;
protected String type;
- protected ELContext context;
+ protected IPageContext context;
- protected abstract void init(ELContext context);
+ protected abstract void init(IPageContext context);
/**
* @return the type
@@ -60,7 +60,7 @@
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.IProposalProcessor#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
- public TextProposal[] getProposals(KbQuery query, ELContext context) {
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
this.context = context;
init(context);
return getProposals(query);
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomProposalTypeFactory.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -79,7 +79,7 @@
//WebKbPlugin.getDefault().logError("Unknown proposal type: " + type); //$NON-NLS-1$
//ExtendedProposalType will report if necessary
- ExtendedProposalType proposalType = new ExtendedProposalType();
+ EmptyProposalType proposalType = new EmptyProposalType();
return proposalType;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/CustomTagLibAttribute.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -13,8 +13,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.taglib.IComponent;
@@ -65,7 +65,7 @@
* @see org.jboss.tools.jst.web.kb.internal.taglib.AbstractAttribute#getProposals(org.jboss.tools.jst.web.kb.KbQuery, org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
- public TextProposal[] getProposals(KbQuery query, ELContext context) {
+ public TextProposal[] getProposals(KbQuery query, IPageContext context) {
CustomProposalType[] types = getProposals();
if(types.length==0) {
return EMPTY_PROPOSAL_LIST;
Copied: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java (from rev 18801, trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java)
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java (rev 0)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * 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.internal.taglib;
+
+import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
+import org.jboss.tools.jst.web.kb.KbQuery;
+
+public class EmptyProposalType extends CustomProposalType {
+
+ public EmptyProposalType() {}
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
+ */
+ @Override
+ public TextProposal[] getProposals(KbQuery query) {
+ return EMPTY_PROPOSAL_LIST;
+ }
+
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
+ */
+ @Override
+ protected void init(IPageContext context) {
+ }
+}
\ No newline at end of file
Property changes on: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EmptyProposalType.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/EnumerationProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -15,8 +15,8 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
@@ -59,6 +59,6 @@
* @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
}
}
\ No newline at end of file
Deleted: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ExtendedProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -1,20 +0,0 @@
-package org.jboss.tools.jst.web.kb.internal.taglib;
-
-import org.jboss.tools.common.el.core.resolver.ELContext;
-import org.jboss.tools.common.text.TextProposal;
-import org.jboss.tools.jst.web.kb.KbQuery;
-
-public class ExtendedProposalType extends CustomProposalType {
-
- public ExtendedProposalType() {}
-
- @Override
- public TextProposal[] getProposals(KbQuery query) {
- return new TextProposal[0];
- }
-
- @Override
- protected void init(ELContext context) {
- }
-
-}
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletTag.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -17,12 +17,21 @@
*/
public class FaceletTag extends AbstractComponent {
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.KbObject#getXMLClass()
+ */
+ @Override
public String getXMLClass() {
return KbXMLStoreConstants.CLS_FACELET_LIBRARY;
}
+ /*
+ * (non-Javadoc)
+ * @see org.jboss.tools.jst.web.kb.internal.taglib.AbstractComponent#clone()
+ */
+ @Override
public FaceletTag clone() throws CloneNotSupportedException {
return (FaceletTag)super.clone();
}
-
-}
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FaceletsJsfCProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -18,7 +18,6 @@
import org.eclipse.swt.graphics.Image;
import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImageHelper;
import org.eclipse.wst.xml.ui.internal.editor.XMLEditorPluginImages;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
@@ -41,9 +40,6 @@
*/
@Override
public TextProposal[] getProposals(KbQuery query) {
- if (!(context instanceof IPageContext))
- return EMPTY_PROPOSAL_LIST;
-
// trim first spaces
String value = query.getValue();
while(true) {
@@ -61,7 +57,7 @@
IComponent[] components = null;
List<TextProposal> proposals = null;
- components = PageProcessor.getInstance().getComponents(kbQuery, (IPageContext)context);
+ components = PageProcessor.getInstance().getComponents(kbQuery, context);
if(components.length==0) {
return EMPTY_PROPOSAL_LIST;
}
@@ -126,6 +122,6 @@
* @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
}
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/FacetNameProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -15,7 +15,6 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
@@ -32,16 +31,13 @@
private static final String IMAGE_NAME = "EnumerationProposal.gif"; //$NON-NLS-1$
private static Image ICON;
- private ELContext context;
+ private IPageContext context;
/* (non-Javadoc)
* @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#getProposals(org.jboss.tools.jst.web.kb.KbQuery)
*/
@Override
public TextProposal[] getProposals(KbQuery query) {
- if (!(context instanceof IPageContext))
- return EMPTY_PROPOSAL_LIST;
-
String[] parentTags = query.getParentTags();
if(parentTags.length>1) {
String parentTag = parentTags[parentTags.length-2];
@@ -50,8 +46,8 @@
newQuery.setMask(false);
newQuery.setType(KbQuery.Type.TAG_NAME);
newQuery.setValue(parentTag);
- PageProcessor.getInstance().getComponents(query, (IPageContext)context);
- ITagLibrary[] libs = ((IPageContext)context).getLibraries();
+ PageProcessor.getInstance().getComponents(query, context);
+ ITagLibrary[] libs = context.getLibraries();
for (ITagLibrary l : libs) {
if(l instanceof IFaceletTagLibrary) {
//TODO
@@ -80,7 +76,7 @@
* @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
this.context = context;
}
}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/IDProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -21,7 +21,6 @@
import org.eclipse.wst.sse.core.StructuredModelManager;
import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.text.TextProposal;
import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
@@ -42,12 +41,10 @@
Set<String> idList = new TreeSet<String>();
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
idList.clear();
- if (!(context instanceof IPageContext))
- return;
- IDocument document = ((IPageContext)context).getDocument();
+ IDocument document = context.getDocument();
IStructuredModel sModel = StructuredModelManager.getModelManager().getExistingModelForRead(document);
try {
if (sModel != null) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ModelProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -10,10 +10,10 @@
******************************************************************************/
package org.jboss.tools.jst.web.kb.internal.taglib;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.project.IModelNature;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.project.list.WebPromptingProvider;
/**
@@ -28,7 +28,7 @@
* @see org.jboss.tools.jst.web.kb.internal.taglib.CustomProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
provider = WebPromptingProvider.getInstance();
IModelNature nature = EclipseResourceUtil.getModelNature(context.getResource().getProject());
if(nature!=null) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpace.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpace.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/NameSpace.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -92,4 +92,4 @@
}
return false;
}
-}
+}
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java 2009-11-24 15:47:34 UTC (rev 18802)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.kb/src/org/jboss/tools/jst/web/kb/internal/taglib/ResourcePathProposalType.java 2009-11-24 15:54:45 UTC (rev 18803)
@@ -24,11 +24,11 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.swt.graphics.Image;
-import org.jboss.tools.common.el.core.resolver.ELContext;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.FileSystemsHelper;
import org.jboss.tools.common.model.util.EclipseResourceUtil;
import org.jboss.tools.common.text.TextProposal;
+import org.jboss.tools.jst.web.kb.IPageContext;
import org.jboss.tools.jst.web.kb.KbQuery;
import org.jboss.tools.jst.web.kb.WebKbPlugin;
@@ -61,7 +61,7 @@
* @see org.jboss.tools.jst.web.kb.internal.taglib.ModelProposalType#init(org.jboss.tools.jst.web.kb.IPageContext)
*/
@Override
- protected void init(ELContext context) {
+ protected void init(IPageContext context) {
super.init(context);
if(xModel != null) {
XModelObject webInf = FileSystemsHelper.getWebInf(xModel);
15 years, 1 month
JBoss Tools SVN: r18802 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2009-11-24 10:47:34 -0500 (Tue, 24 Nov 2009)
New Revision: 18802
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4345
Workaround for https://bugs.eclipse.org/278370 reverted since the bug is fixed in Eclipse 3.5.1.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-11-24 15:23:48 UTC (rev 18801)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2009-11-24 15:47:34 UTC (rev 18802)
@@ -594,39 +594,10 @@
protected void setInitialContent() {
final String html = DocTypeUtil.prepareInitFile(
INIT_FILE, getEditorInput());
-
- // Workaround of JBIDE-4345.
- // Due to a bug in org.eclipse.swt.browser.Mozilla we cannot simply
- // set initial html code as xulRunnerEditor.setText(html).
- // Instead of it we create a temporary file containing
- // the html code and set it to the Mozilla browser as URL.
- File tmp = null;
- Writer out = null;
- try {
- tmp = File.createTempFile(
- "temp", ".html"); //$NON-NLS-1$//$NON-NLS-2$
- tmp.deleteOnExit();
- out = new FileWriter(tmp);
- out.write(html);
- } catch (IOException e) {
- VpePlugin.getPluginLog().logError(e);
- } finally {
- try {
- if (out != null) {
- out.close();
- if (tmp != null) {
- xulRunnerEditor.setURL("file://" //$NON-NLS-1$
- + tmp.getCanonicalPath());
- }
- }
- } catch (IOException e) {
- VpePlugin.getPluginLog().logError(e);
- } finally {
- if (tmp != null) {
- tmp.delete();
- }
- }
- }
+
+ // there was a problem with setText in eclipse 3.5.0 (JBIDE-4345),
+ // but since 3.5.1 it should work
+ xulRunnerEditor.setText(html);
}
/**
15 years, 1 month