JBoss Tools SVN: r4698 - trunk.
by jbosstools-commits@lists.jboss.org
Author: afedosik
Date: 2007-11-05 08:26:15 -0500 (Mon, 05 Nov 2007)
New Revision: 4698
Added:
trunk/jbpm/
Log:
17 years, 2 months
JBoss Tools SVN: r4697 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-11-05 08:23:56 -0500 (Mon, 05 Nov 2007)
New Revision: 4697
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1256 EL autcompletion and validation should be aware of ELResolvers
All public methods are added to the types (this covers proposals for java.util.Map and java.util.Collection objects)
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-05 12:14:47 UTC (rev 4696)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/TypeInfoCollector.java 2007-11-05 13:23:56 UTC (rev 4697)
@@ -446,18 +446,99 @@
return;
try {
fType.codeComplete("".toCharArray(), -1, 0, new char[0][0], new char[0][0], new int[0], false, fRequestor);
+
+ IType binType = fType;
+ while (binType != null) {
+ IMethod[] binMethods = binType.getMethods();
+ for (int i = 0; binMethods != null && i < binMethods.length; i++) {
+ if (binMethods[i].isConstructor()) continue;
+ MethodInfo[] infos = findMethodInfos(binMethods[i]);
+ if (infos == null || infos.length == 0) {
+ fMethods.add(new MethodInfo(binMethods[i]));
+ }
+ }
+ binType = getSuperclass(binType);
+ }
+
+ // !!!!!!!
+ // This inserts here methods "public int size()" and "public boolean isEmpty()" for javax.faces.model.DataModel
+ // as requested by Gavin in JBIDE-1256
+ // !!!!!!!
+// if (fType.)
+
+
+
} catch (JavaModelException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
}
- public MemberInfo[] getAllMethodInfos() {
- List<MemberInfo> methods = new ArrayList<MemberInfo>();
+ private static IType getSuperclass(IType type) throws JavaModelException {
+ String superclassName = type.getSuperclassName();
+ if(superclassName!=null) {
+ String fullySuperclassName = EclipseJavaUtil.resolveType(type, superclassName);
+ if(fullySuperclassName!=null&&!fullySuperclassName.equals("java.lang.Object")) { //$NON-NLS-1$
+ IType superType = type.getJavaProject().findType(fullySuperclassName);
+ return superType;
+ }
+ }
+ return null;
+ }
+
+
+ public MethodInfo[] findMethodInfos(IMethod iMethod) {
+ List<MethodInfo> methods = new ArrayList<MethodInfo>();
+
+ // filter methods by name
for (MethodInfo info : fMethods) {
- if (info.isPublic() && !info.isConstructor())
+ if (info.getName().equals(iMethod.getElementName())) {
methods.add(info);
+ }
}
- return methods.toArray(new MemberInfo[0]);
+ if (methods.isEmpty())
+ return new MethodInfo[0];
+
+ if (methods.size() == 1)
+ return methods.toArray(new MethodInfo[0]);
+
+ // filter methods by number of parameters
+ List<MethodInfo> filteredMethods = new ArrayList<MethodInfo>();
+ for (MethodInfo method : methods) {
+ if (method.getNumberOfParameters() == iMethod.getNumberOfParameters())
+ filteredMethods.add(method);
+ }
+ if (filteredMethods.isEmpty())
+ return new MethodInfo[0];
+ if (filteredMethods.size() == 1)
+ return filteredMethods.toArray(new MethodInfo[0]);
+
+ methods = filteredMethods;
+
+ // filter methods by parameter types
+ filteredMethods = new ArrayList<MethodInfo>();
+ for(MethodInfo method : methods) {
+ String[] methodParameterTypes =
+ resolveSignatures(iMethod.getDeclaringType(),
+ iMethod.getParameterTypes());
+ String[] parameterTypes = method.getParameterTypeQualifiedNames();
+
+ boolean equal = true;
+ for (int i = 0; parameterTypes != null && i < parameterTypes.length; i++) {
+ // simple types must be equal, but complex types may not
+ if (!parameterTypes[i].equals(methodParameterTypes[i])) {
+ // sure - it's Complex Type
+ if (! (parameterTypes[i].indexOf('.') != -1)
+ && (methodParameterTypes[i].indexOf('.') == -1)) {
+ equal = false;
+ break;
+ }
+ }
+ }
+ if (equal) {
+ filteredMethods.add(method);
+ }
+ }
+ return filteredMethods.toArray(new MethodInfo[0]);
}
/**
17 years, 2 months
JBoss Tools SVN: r4695 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-11-05 07:06:38 -0500 (Mon, 05 Nov 2007)
New Revision: 4695
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java
Log:
Ignore numbers in EL (for example: #{array[10]})
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java 2007-11-05 11:39:36 UTC (rev 4694)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/ELToken.java 2007-11-05 12:06:38 UTC (rev 4695)
@@ -18,11 +18,12 @@
*/
public class ELToken implements IToken {
public static final ELToken EOF = new ELToken(-1, -1, null, -1);
- public static final int EL_OPERAND_TOKEN = 1;
+ public static final int EL_VARIABLE_TOKEN = 1;
public static final int EL_OPERATOR_TOKEN = 2;
public static final int EL_RESERVED_WORD_TOKEN = 3;
public static final int EL_SEPARATOR_TOKEN = 4;
public static final int EL_STRING_TOKEN = 5;
+ public static final int EL_NUMBER_TOKEN = 6;
private int start;
private int length;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java 2007-11-05 11:39:36 UTC (rev 4694)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/el/SeamELTokenizer.java 2007-11-05 12:06:38 UTC (rev 4695)
@@ -69,10 +69,12 @@
fState = STATE_INITIAL;
while ((token = getNextToken()) != ELToken.EOF) {
- if (token.getType() == ELToken.EL_OPERAND_TOKEN ||
+ if (token.getType() == ELToken.EL_VARIABLE_TOKEN ||
token.getType() == ELToken.EL_OPERATOR_TOKEN ||
token.getType() == ELToken.EL_RESERVED_WORD_TOKEN ||
- token.getType() == ELToken.EL_SEPARATOR_TOKEN) {
+ token.getType() == ELToken.EL_SEPARATOR_TOKEN ||
+ token.getType() == ELToken.EL_STRING_TOKEN ||
+ token.getType() == ELToken.EL_NUMBER_TOKEN) {
fTokens.add(token);
}
@@ -253,10 +255,12 @@
releaseChar();
int length = index - startOfToken;
boolean reservedWord = isResorvedWord(startOfToken, length);
- int tokenType = ELToken.EL_OPERAND_TOKEN;
+ int tokenType = ELToken.EL_VARIABLE_TOKEN;
if(reservedWord) {
tokenType = ELToken.EL_RESERVED_WORD_TOKEN;
fState = STATE_RESERVED_WORD;
+ } else if(isNumber(startOfToken, length)) {
+ tokenType = ELToken.EL_NUMBER_TOKEN;
}
return (length > 0 ? new ELToken(startOfToken, length, getCharSequence(startOfToken, length), tokenType) : ELToken.EOF);
@@ -266,11 +270,31 @@
return RESERVED_WORDS.indexOf(" " + word.trim() + " ")>-1;
}
+ private boolean isNumber(String word) {
+ if(word.length()>0) {
+ char firstChar = word.charAt(0);
+ if(firstChar=='-' || (firstChar>='0' && firstChar<='9')) {
+ try {
+ Long.parseLong(word);
+ return true;
+ } catch (NumberFormatException e) {
+ return false;
+ }
+ }
+ }
+ return false;
+ }
+
private boolean isResorvedWord(int beginIndex, int length) {
String word = expression.substring(beginIndex, beginIndex + length);
return isResorvedWord(word);
}
+ private boolean isNumber(int beginIndex, int length) {
+ String word = expression.substring(beginIndex, beginIndex + length);
+ return isNumber(word);
+ }
+
/* Reads the next character
* @return
*/
17 years, 2 months
JBoss Tools SVN: r4692 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2007-11-05 03:38:37 -0500 (Mon, 05 Nov 2007)
New Revision: 4692
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1247
corrected view of calendar( sometimes shifted weeks )
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2007-11-04 19:09:11 UTC (rev 4691)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2007-11-05 08:38:37 UTC (rev 4692)
@@ -309,12 +309,15 @@
Calendar cal = Calendar.getInstance();
int month = cal.get(Calendar.MONTH);
- int day = cal.get(Calendar.DAY_OF_WEEK);
int dayN = cal.get(Calendar.DAY_OF_MONTH);
- int start = day - (dayN % NUM_DAYS_IN_WEEK + cal.getFirstDayOfWeek());
- cal.add(Calendar.DAY_OF_MONTH, -(start + dayN));
+ // shift 'cal' to month's start
+ cal.add(Calendar.DAY_OF_MONTH, -dayN);
+ // shift 'cal' to week's start
+ cal.add(Calendar.DAY_OF_MONTH, -(cal.get(Calendar.DAY_OF_WEEK) - cal
+ .getFirstDayOfWeek()));
+ //for number of week
for (int i = NUM_WEEK_ON_PAGE; i > 0; i--) {
nsIDOMElement tr = visualDocument
@@ -328,6 +331,8 @@
+ cal.get(Calendar.WEEK_OF_YEAR));
weekTD.appendChild(weekText);
tr.appendChild(weekTD);
+
+ //for number of days in week
for (int j = NUM_DAYS_IN_WEEK; j > 0; j--) {
nsIDOMElement td = visualDocument
@@ -337,6 +342,7 @@
int dayOfWeek = cal.get(Calendar.DAY_OF_WEEK);
+ // if 'cal' is a member of month
if (cal.get(Calendar.MONTH) == month) {
// if this is current day
@@ -344,13 +350,18 @@
&& cal.get(Calendar.MONTH) == month) {
currentAttr = TODAY_HTML_CLASS_ATTR;
- } else if (dayOfWeek == Calendar.SATURDAY
+ }
+ // if this is holiday
+ else if (dayOfWeek == Calendar.SATURDAY
|| dayOfWeek == Calendar.SUNDAY) {
currentAttr = HOL_CUR_MONTH_HTML_CLASS_ATTR;
} else {
currentAttr = CUR_MONTH_HTML_CLASS_ATTR;
}
- } else {
+ }
+ // if 'cal' isn't a member of month
+ else {
+ // if this is holiday
if (dayOfWeek == Calendar.SATURDAY
|| dayOfWeek == Calendar.SUNDAY) {
currentAttr = HOL_OTHER_MONTH_HTML_CLASS_ATTR;
17 years, 2 months
JBoss Tools SVN: r4691 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-11-04 14:09:11 -0500 (Sun, 04 Nov 2007)
New Revision: 4691
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java
Log:
trying to fix jbide-1254
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2007-11-04 18:41:42 UTC (rev 4690)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2007-11-04 19:09:11 UTC (rev 4691)
@@ -173,7 +173,7 @@
return control;
}
protected int getComboWidth() {
- return 30;
+ return 75;
}
protected String getLabelText() {
return "Max results:";
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java 2007-11-04 18:41:42 UTC (rev 4690)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/ComboContribution.java 2007-11-04 19:09:11 UTC (rev 4691)
@@ -39,15 +39,17 @@
gd.horizontalAlignment = GridData.END;
}
comboControl = new Combo( panel, SWT.DROP_DOWN | (isReadOnly()?SWT.READ_ONLY:SWT.NONE) );
-
+ populateComboBox();
+ comboControl.pack();
GridData gd = new GridData();
gd.grabExcessHorizontalSpace = true;
+ gd.verticalIndent = -8;
gd.widthHint = getComboWidth();
gd.verticalAlignment = GridData.CENTER;
gd.horizontalAlignment = GridData.END;
comboControl.setLayoutData( gd );
- populateComboBox();
+
if(getSelectionAdapter()!=null) {
comboControl.addSelectionListener( getSelectionAdapter() );
17 years, 2 months
JBoss Tools SVN: r4690 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-11-04 13:41:42 -0500 (Sun, 04 Nov 2007)
New Revision: 4690
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
Log:
fixed wrong print
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2007-11-04 18:27:58 UTC (rev 4689)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/DynamicSQLPreviewView.java 2007-11-04 18:41:42 UTC (rev 4690)
@@ -177,7 +177,7 @@
for (int i = 0; i < translators.length; i++) {
QueryTranslator translator = translators[i];
if(translator.isManipulationStatement()) {
- str.append(i + ":");
+ str.append("Manipulation of " + i + ":");
Iterator iterator = translator.getQuerySpaces().iterator();
while ( iterator.hasNext() ) {
Object qspace = iterator.next();
@@ -187,7 +187,7 @@
} else {
Type[] returnTypes = translator.getReturnTypes();
- str.append("Manipulation of " + i +": ");
+ str.append(i +": ");
for (int j = 0; j < returnTypes.length; j++) {
Type returnType = returnTypes[j];
str.append(returnType.getName());
17 years, 2 months
JBoss Tools SVN: r4689 - trunk/hibernatetools/plugins/org.hibernate.eclipse/lib/tools.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-11-04 13:27:58 -0500 (Sun, 04 Nov 2007)
New Revision: 4689
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/lib/tools/hibernate-tools.jar
Log:
latest changes for hibernatetools core
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/lib/tools/hibernate-tools.jar
===================================================================
(Binary files differ)
17 years, 2 months
JBoss Tools SVN: r4688 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-11-04 04:22:29 -0500 (Sun, 04 Nov 2007)
New Revision: 4688
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
Log:
HBX-774 ClassCastException by create/open/execute a *.hql file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2007-11-03 18:57:08 UTC (rev 4687)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/AbstractQueryEditor.java 2007-11-04 09:22:29 UTC (rev 4688)
@@ -36,6 +36,9 @@
private ToolBarManager tbm;
final private QueryInputModel queryInputModel;
+ // to enable execution of queries from files - hack for HBX-744
+ private String consoleConfigurationName;
+
public AbstractQueryEditor() {
queryInputModel = new QueryInputModel();
}
@@ -53,16 +56,24 @@
}
final public String getConsoleConfigurationName() {
- QueryEditorInput hei = (QueryEditorInput) getEditorInput();
- return hei.getConsoleConfigurationName();
+ //TODO: these should be stored as resource info
+ if(getEditorInput() instanceof QueryEditorInput) {
+ QueryEditorInput hei = (QueryEditorInput) getEditorInput();
+ return hei.getConsoleConfigurationName();
+ } else {
+ return consoleConfigurationName;
+ }
}
final public void setConsoleConfigurationName(String name) {
- QueryEditorInput hei = (QueryEditorInput) getEditorInput();
- hei.setConsoleConfigurationName( name );
- hei.setQuery( getQueryString() );
- hei.resetName();
- showEditorInput( hei );
+ if(getEditorInput() instanceof QueryEditorInput) {
+ QueryEditorInput hei = (QueryEditorInput) getEditorInput();
+ hei.setConsoleConfigurationName( name );
+ hei.setQuery( getQueryString() );
+ hei.resetName();
+ }
+ this.consoleConfigurationName = name;
+ showEditorInput( getEditorInput() );
}
public void showEditorInput(IEditorInput editorInput) {
@@ -78,10 +89,16 @@
final public void doSave(IProgressMonitor progressMonitor) {
// super.doSave(progressMonitor);
- QueryEditorInput hei = (QueryEditorInput) getEditorInput();
- hei.setQuery( getQueryString() );
+ if(getEditorInput() instanceof QueryEditorInput) {
+ QueryEditorInput hei = (QueryEditorInput) getEditorInput();
+ hei.setQuery( getQueryString() );
+ }
performSave( false, progressMonitor );
}
+
+ protected void doSetInput(IEditorInput input) throws CoreException {
+ super.doSetInput(input);
+ }
final public String getQueryString() {
IEditorInput editorInput = getEditorInput();
17 years, 2 months
JBoss Tools SVN: r4687 - trunk/as/tests/org.jboss.ide.eclipse.as.test.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-11-03 14:57:08 -0400 (Sat, 03 Nov 2007)
New Revision: 4687
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties
Log:
add in missing basicwebproject to binary build
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties 2007-11-03 18:55:39 UTC (rev 4686)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/build.properties 2007-11-03 18:57:08 UTC (rev 4687)
@@ -1,5 +1,6 @@
source.. = src/
output.archivestest.jar = bin/
bin.includes = META-INF/,\
- archivestest.jar
+ archivestest.jar,\
+ projects/
source.archivestest.jar = src/
17 years, 2 months
JBoss Tools SVN: r4686 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-11-03 14:55:39 -0400 (Sat, 03 Nov 2007)
New Revision: 4686
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java
Log:
fix broken label in test
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java 2007-11-03 18:53:25 UTC (rev 4685)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/PerspectiveTest.java 2007-11-03 18:55:39 UTC (rev 4686)
@@ -14,7 +14,7 @@
IPerspectiveDescriptor perspective = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage().getPerspective();
- assertEquals(perspective.getLabel(), "Hibernate Console");
+ assertEquals(perspective.getLabel(), "Hibernate");
}
}
17 years, 2 months