JBoss Tools SVN: r17796 - in trunk/common/plugins/org.jboss.tools.common.model.ui: schema and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-09-29 11:11:15 -0400 (Tue, 29 Sep 2009)
New Revision: 17796
Added:
trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/AbstractPropertiesContentAssistProcessor.java
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesSourceViewerConfiguration.java
Modified:
trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesTextEditorStub.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4916
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2009-09-29 14:50:14 UTC (rev 17795)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/plugin.xml 2009-09-29 15:11:15 UTC (rev 17796)
@@ -10,6 +10,7 @@
<extension-point id="InsertTagWizard" name="%ExtensionName_InsertTagWizard" schema="schema/InsertTagWizard.exsd"/>
<extension-point id="labelDecorator" name="%ExtensionName_labelDecorator" schema="schema/labelDecorator.exsd"/>
<extension-point id="attributeContentProposalProviders" name="%ExtensionName_attributeContentProposalProviders" schema="schema/attributeContentProposalProviders.exsd"/>
+ <extension-point id="propertiesFileContentAssist" name="Properties File Content Assist" schema="schema/propertiesFileContentAssist.exsd"/>
<extension point="org.eclipse.ui.elementFactories">
<factory class="org.jboss.tools.common.core.resources.XModelObjectEditorInputFactory" id="org.jboss.tools.common.core.resources.XModelObjectEditorInputFactory">
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd 2009-09-29 15:11:15 UTC (rev 17796)
@@ -0,0 +1,109 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.jboss.tools.common.model.ui" xmlns="http://www.w3.org/2001/XMLSchema">
+<annotation>
+ <appInfo>
+ <meta.schema plugin="org.jboss.tools.common.model.ui" id="propertiesFileContentAssist" name="Properties File Content Assist"/>
+ </appInfo>
+ <documentation>
+ [Enter description of this extension point.]
+ </documentation>
+ </annotation>
+
+ <element name="extension">
+ <annotation>
+ <appInfo>
+ <meta.element />
+ </appInfo>
+ </annotation>
+ <complexType>
+ <sequence>
+ <element ref="propertiesFileContentAssist" minOccurs="1" maxOccurs="unbounded"/>
+ </sequence>
+ <attribute name="point" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="id" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ <attribute name="name" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute translatable="true"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <element name="propertiesFileContentAssist">
+ <complexType>
+ <attribute name="processor" type="string" use="required">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ <appInfo>
+ <meta.attribute kind="java"/>
+ </appInfo>
+ </annotation>
+ </attribute>
+ <attribute name="fileName" type="string">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
+ </complexType>
+ </element>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="since"/>
+ </appInfo>
+ <documentation>
+ [Enter the first release in which this extension point appears.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="examples"/>
+ </appInfo>
+ <documentation>
+ [Enter extension point usage example here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="apiinfo"/>
+ </appInfo>
+ <documentation>
+ [Enter API information here.]
+ </documentation>
+ </annotation>
+
+ <annotation>
+ <appInfo>
+ <meta.section type="implementation"/>
+ </appInfo>
+ <documentation>
+ [Enter information about supplied implementation of this extension point.]
+ </documentation>
+ </annotation>
+
+
+</schema>
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/schema/propertiesFileContentAssist.exsd
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/AbstractPropertiesContentAssistProcessor.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/AbstractPropertiesContentAssistProcessor.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/AbstractPropertiesContentAssistProcessor.java 2009-09-29 15:11:15 UTC (rev 17796)
@@ -0,0 +1,162 @@
+package org.jboss.tools.common.model.ui.texteditors.propertyeditor;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
+import org.eclipse.jface.text.contentassist.IContextInformation;
+import org.eclipse.jface.text.contentassist.IContextInformationValidator;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.XModelObjectConstants;
+import org.jboss.tools.common.model.loaders.impl.PropertiesLoader;
+
+public class AbstractPropertiesContentAssistProcessor implements IContentAssistProcessor {
+ protected XModelObject object;
+
+ public AbstractPropertiesContentAssistProcessor() {}
+
+ public void setModelObject(XModelObject object) {
+ this.object = object;
+ }
+
+ public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer,
+ int offset) {
+ return null;
+ }
+
+ public IContextInformation[] computeContextInformation(ITextViewer viewer,
+ int offset) {
+ return null;
+ }
+
+ public char[] getCompletionProposalAutoActivationCharacters() {
+ return null;
+ }
+
+ public char[] getContextInformationAutoActivationCharacters() {
+ return null;
+ }
+
+ public IContextInformationValidator getContextInformationValidator() {
+ return null;
+ }
+
+ public String getErrorMessage() {
+ return null;
+ }
+
+ protected class Context {
+ boolean inComment = false;
+ int offset;
+ int nameOffset;
+ int nameLength;
+ boolean inPropertyName = false;
+ String propertyName;
+
+ int valueOffset;
+ int valueLength;
+ String propertyValue;
+ Set<String> allProperties = new HashSet<String>();
+
+ public boolean isInComment() {
+ return inComment;
+ }
+
+ public boolean isInPropertyName() {
+ return inPropertyName;
+ }
+
+ public int getNameOffset() {
+ return nameOffset;
+ }
+
+ public int getNameLength() {
+ return nameLength;
+ }
+
+ public int getValueOffset() {
+ return valueOffset;
+ }
+
+ public int getValueLength() {
+ return valueLength;
+ }
+
+ public String getPropertyName() {
+ return propertyName;
+ }
+
+ public boolean hasProperty(String property) {
+ return allProperties.contains(property) && !property.equals(propertyName);
+ }
+
+ public boolean isInValue() {
+ return !isInPropertyName() && offset >= valueOffset;
+ }
+ }
+
+ public Context getContext(ITextViewer viewer, int offset) {
+ Context context = new Context();
+ context.offset = offset;
+ XModelObject[] ps = object.getChildren();
+ for (int i = 0; i < ps.length; i++) {
+ String name = ps[i].getAttributeValue(XModelObjectConstants.ATTR_NAME);
+ context.allProperties.add(name);
+ }
+ int lineOffset = getNameOffset(viewer, offset);
+ context.nameOffset = lineOffset;
+ int valueEnd = getValueEnd(viewer, offset);
+ String line = viewer.getDocument().get().substring(context.nameOffset, valueEnd);
+ if(line.trim().startsWith("#")) {
+ context.inComment = true;
+ return context;
+ }
+ int si = PropertiesLoader.getSeparatorIndex(line);
+ if(si < 0) si = line.length();
+ if(si == line.length()) {
+ context.inPropertyName = true;
+ }
+ String name = line.substring(0, si).trim();
+ context.propertyName = name;
+ context.nameLength = name.length();
+ if(name.length() > 0) {
+ int b = line.indexOf(name);
+ if(b >= 0) {
+ context.nameOffset += b;
+ }
+ }
+ if(offset >= context.nameOffset && offset <= context.nameOffset + context.nameLength) {
+ context.inPropertyName = true;
+ }
+ String value = (si >= line.length()) ? "" : line.substring(si + 1, line.length());
+ context.valueLength = value.length();
+ context.propertyValue = value;
+ if(si < line.length()) {
+ context.valueOffset = lineOffset + si + 1;
+ int b = line.indexOf(value, si + 1);
+ if(b > 0) {
+ context.valueOffset = lineOffset + b;
+ }
+ }
+ return context;
+ }
+
+ int getNameOffset(ITextViewer viewer, int offset) {
+ String body = viewer.getDocument().get();
+ for (int i = offset - 1; i >= 0; i--) {
+ char c = body.charAt(i);
+ if(c == '\n' || c == '\r') return i + 1;
+ }
+ return 0;
+ }
+ int getValueEnd(ITextViewer viewer, int offset) {
+ String body = viewer.getDocument().get();
+ for (int i = offset; i < body.length(); i++) {
+ char c = body.charAt(i);
+ if(c == '\n' || c == '\r') return i;
+ }
+ return body.length();
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/AbstractPropertiesContentAssistProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesSourceViewerConfiguration.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesSourceViewerConfiguration.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesSourceViewerConfiguration.java 2009-09-29 15:11:15 UTC (rev 17796)
@@ -0,0 +1,82 @@
+package org.jboss.tools.common.model.ui.texteditors.propertyeditor;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
+import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileSourceViewerConfiguration;
+import org.eclipse.jdt.ui.text.IColorManager;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.text.DefaultInformationControl;
+import org.eclipse.jface.text.IInformationControl;
+import org.eclipse.jface.text.IInformationControlCreator;
+import org.eclipse.jface.text.contentassist.ContentAssistant;
+import org.eclipse.jface.text.contentassist.IContentAssistant;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IFileEditorInput;
+import org.eclipse.ui.texteditor.ITextEditor;
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.ModelUIPlugin;
+import org.jboss.tools.common.model.ui.editor.IModelObjectEditorInput;
+
+public class PropertiesSourceViewerConfiguration extends PropertiesFileSourceViewerConfiguration {
+
+ ContentAssistant fContentAssistant;
+
+ public PropertiesSourceViewerConfiguration(IColorManager colorManager,
+ IPreferenceStore preferenceStore, ITextEditor editor,
+ String partitioning) {
+ super(colorManager, preferenceStore, editor, partitioning);
+
+ }
+
+ public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
+ if(fContentAssistant == null) {
+ fContentAssistant = new ContentAssistant();
+ IEditorInput input = getEditor().getEditorInput();
+ if(input instanceof IFileEditorInput && input instanceof IModelObjectEditorInput) {
+ IFile f = ((IFileEditorInput)input).getFile();
+ String name = f.getName();
+ AbstractPropertiesContentAssistProcessor p = createProcessorByFileName(name);
+ if(p != null) {
+ XModelObject o = ((IModelObjectEditorInput)input).getXModelObject();
+ p.setModelObject(o);
+ fContentAssistant.setContentAssistProcessor(p, "__dftl_partition_content_type");
+ }
+ fContentAssistant.setInformationControlCreator(new IInformationControlCreator() {
+ public IInformationControl createInformationControl(Shell parent) {
+ return new DefaultInformationControl(parent, JavaPlugin.getAdditionalInfoAffordanceString());
+ }
+ });
+ }
+ }
+ return fContentAssistant;
+ }
+
+ static String EXTENSION_POINT = "org.jboss.tools.common.model.ui.propertiesFileContentAssist";
+
+ private AbstractPropertiesContentAssistProcessor createProcessorByFileName(String fileName) {
+ IExtensionPoint point = Platform.getExtensionRegistry().getExtensionPoint(EXTENSION_POINT);
+ if(point == null) return null;
+ IConfigurationElement[] cs = point.getConfigurationElements();
+ for (IConfigurationElement c: cs) {
+ if(fileName.equals(c.getAttribute("fileName"))) {
+ try {
+ AbstractPropertiesContentAssistProcessor p = (AbstractPropertiesContentAssistProcessor)c.createExecutableExtension("processor");
+ return p;
+ } catch (CoreException e) {
+ ModelUIPlugin.getPluginLog().logError(e);
+ } catch (ClassCastException e2) {
+ ModelUIPlugin.getPluginLog().logError(e2);
+ }
+ }
+ }
+
+ return null;
+ }
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesSourceViewerConfiguration.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesTextEditorStub.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesTextEditorStub.java 2009-09-29 14:50:14 UTC (rev 17795)
+++ trunk/common/plugins/org.jboss.tools.common.model.ui/src/org/jboss/tools/common/model/ui/texteditors/propertyeditor/PropertiesTextEditorStub.java 2009-09-29 15:11:15 UTC (rev 17796)
@@ -18,7 +18,12 @@
import org.eclipse.core.resources.IResource;
import org.jboss.tools.common.model.ui.texteditors.dnd.TextEditorDrop;
import org.jboss.tools.common.model.ui.texteditors.dnd.TextEditorDropProvider;
+import org.eclipse.jdt.internal.ui.JavaPlugin;
+import org.eclipse.jdt.internal.ui.propertiesfileeditor.IPropertiesFilePartitions;
import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileEditor;
+import org.eclipse.jdt.internal.ui.propertiesfileeditor.PropertiesFileSourceViewerConfiguration;
+import org.eclipse.jdt.ui.text.JavaTextTools;
+import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.jface.text.DocumentEvent;
import org.eclipse.jface.text.IDocumentListener;
import org.eclipse.jface.text.source.ISourceViewer;
@@ -92,4 +97,11 @@
}
}
+
+ protected void initializeEditor() {
+ super.initializeEditor();
+ IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
+ JavaTextTools textTools= JavaPlugin.getDefault().getJavaTextTools();
+ setSourceViewerConfiguration(new PropertiesSourceViewerConfiguration(textTools.getColorManager(), store, this, IPropertiesFilePartitions.PROPERTIES_FILE_PARTITIONING));
+ }
}
15 years, 3 months
JBoss Tools SVN: r17795 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-09-29 10:50:14 -0400 (Tue, 29 Sep 2009)
New Revision: 17795
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4958 - fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2009-09-29 14:33:55 UTC (rev 17794)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2009-09-29 14:50:14 UTC (rev 17795)
@@ -78,7 +78,7 @@
if (clazz instanceof RootClass) {
RootClass rootClass = (RootClass)clazz;
s = getOrCreatePersistentClass(rootClass, null);
- if (!isConnectionExist(shape, s)) {
+ if (shouldCreateConnection(shape, s)) {
connections.add(new Connection(shape, s));
}
} else if (clazz instanceof Subclass) {
@@ -87,7 +87,7 @@
}
} else {
s = getOrCreatePersistentClass(new SpecialRootClass(property), null);
- if (!isConnectionExist(shape, s)) {
+ if (shouldCreateConnection(shape, s)) {
connections.add(new Connection(shape, s));
}
createConnections(s, getOrCreateDatabaseTable(property.getValue().getTable()));
@@ -118,63 +118,67 @@
}
SimpleValue value = (SimpleValue)csChild0.getOrmElement();
OrmShape tableShape = getOrCreateDatabaseTable(value.getTable());
- Iterator it = value.getColumnIterator();
- while (it.hasNext()) {
- Object el = it.next();
- if (el instanceof Column) {
- Column col = (Column)el;
- Shape shape = tableShape.getChild(col);
- if (shape != null && !isConnectionExist(csChild0, shape)) {
- connections.add(new Connection(csChild0, shape));
+ if (tableShape != null) {
+ Iterator it = value.getColumnIterator();
+ while (it.hasNext()) {
+ Object el = it.next();
+ if (el instanceof Column) {
+ Column col = (Column)el;
+ Shape shape = tableShape.getChild(col);
+ if (shouldCreateConnection(csChild0, shape)) {
+ connections.add(new Connection(csChild0, shape));
+ }
}
}
}
- if (!isConnectionExist(csChild1, childShape)) {
+ if (shouldCreateConnection(csChild1, childShape)) {
connections.add(new Connection(csChild1, childShape));
}
} else if (collection.isOneToMany()) {
childShape = getOrCreateAssociationClass(property);
- if (childShape == null) {
- return;
- }
- if (!isConnectionExist(csChild1, childShape)) {
- connections.add(new Connection(csChild1, childShape));
- }
- OrmShape keyTableShape = getOrCreateDatabaseTable(collection.getKey().getTable());
- Iterator it = collection.getKey().getColumnIterator();
- while (it.hasNext()) {
- Object el = it.next();
- if (el instanceof Column) {
- Column col = (Column)el;
- Shape shape = keyTableShape.getChild(col);
- if (shape != null && !isConnectionExist(csChild0, shape)) {
- connections.add(new Connection(csChild0, shape));
+ if (childShape != null) {
+ if (shouldCreateConnection(csChild1, childShape)) {
+ connections.add(new Connection(csChild1, childShape));
+ }
+ OrmShape keyTableShape = getOrCreateDatabaseTable(collection.getKey().getTable());
+ Iterator it = collection.getKey().getColumnIterator();
+ while (it.hasNext()) {
+ Object el = it.next();
+ if (el instanceof Column) {
+ Column col = (Column)el;
+ Shape shape = keyTableShape.getChild(col);
+ if (shouldCreateConnection(csChild0, shape)) {
+ connections.add(new Connection(csChild0, shape));
+ }
}
}
}
-
- } else /* if (collection.isMap() || collection.isSet()) */ {
+
+ } else {
+ // this is case: if (collection.isMap() || collection.isSet())
childShape = getOrCreateDatabaseTable(collection.getCollectionTable());
- Iterator it = ((DependantValue)csChild0.getOrmElement()).getColumnIterator();
- while (it.hasNext()) {
- Object el = it.next();
- if (el instanceof Column) {
- Column col = (Column)el;
- Shape shape = childShape.getChild(col);
- if (shape != null && !isConnectionExist(csChild0, shape)) {
- connections.add(new Connection(csChild0, shape));
+ if (childShape != null) {
+ Iterator it = ((DependantValue)csChild0.getOrmElement()).getColumnIterator();
+ while (it.hasNext()) {
+ Object el = it.next();
+ if (el instanceof Column) {
+ Column col = (Column)el;
+ Shape shape = childShape.getChild(col);
+ if (shouldCreateConnection(csChild0, shape)) {
+ connections.add(new Connection(csChild0, shape));
+ }
}
}
- }
- it = ((SimpleValue)csChild1.getOrmElement()).getColumnIterator();
- while (it.hasNext()) {
- Object el = it.next();
- if (el instanceof Column) {
- Column col = (Column)el;
- Shape shape = childShape.getChild(col);
- if (shape != null && !isConnectionExist(csChild1, shape)) {
- connections.add(new Connection(csChild1, shape));
+ it = ((SimpleValue)csChild1.getOrmElement()).getColumnIterator();
+ while (it.hasNext()) {
+ Object el = it.next();
+ if (el instanceof Column) {
+ Column col = (Column)el;
+ Shape shape = childShape.getChild(col);
+ if (shouldCreateConnection(csChild1, shape)) {
+ connections.add(new Connection(csChild1, shape));
+ }
}
}
}
@@ -193,7 +197,11 @@
Object clazz = iterator.next();
if (clazz instanceof RootClass) {
RootClass cls = (RootClass)clazz;
- getOrCreatePersistentClass(cls, null);
+ if (databaseTable.equals(cls.getTable())) {
+ // create persistent class shape only for RootClass,
+ // which has same table reference
+ getOrCreatePersistentClass(cls, null);
+ }
}
}
}
@@ -202,7 +210,8 @@
}
@SuppressWarnings("unchecked")
- protected OrmShape getOrCreatePersistentClass(PersistentClass persistentClass, Table componentClassDatabaseTable) {
+ protected OrmShape getOrCreatePersistentClass(PersistentClass persistentClass,
+ Table componentClassDatabaseTable) {
OrmShape classShape = null;
if (persistentClass == null) {
return classShape;
@@ -221,7 +230,7 @@
shape = getOrCreateDatabaseTable(componentClassDatabaseTable);
}
createConnections(classShape, shape);
- if (!isConnectionExist(classShape, shape)) {
+ if (shouldCreateConnection(classShape, shape)) {
connections.add(new Connection(classShape, shape));
}
}
@@ -239,12 +248,12 @@
Table jcTable = ((Subclass)element).getTable();
OrmShape jcTableShape = getOrCreateDatabaseTable(jcTable);
createConnections(subclassShape, jcTableShape);
- if (!isConnectionExist(subclassShape, jcTableShape)) {
+ if (shouldCreateConnection(subclassShape, jcTableShape)) {
connections.add(new Connection(subclassShape, jcTableShape));
}
} else {
createConnections(subclassShape, shape);
- if (!isConnectionExist(subclassShape, shape)) {
+ if (shouldCreateConnection(subclassShape, shape)) {
connections.add(new Connection(subclassShape, shape));
}
}
@@ -272,7 +281,7 @@
componentClassShape = getOrCreateComponentClass(((RootClass)persistentClass).getIdentifierProperty());
Shape idPropertyShape = classShape.getChild(persistentClass.getIdentifierProperty());
- if (idPropertyShape != null && !isConnectionExist(idPropertyShape, componentClassShape)) {
+ if (shouldCreateConnection(idPropertyShape, componentClassShape)) {
connections.add(new Connection(idPropertyShape, componentClassShape));
}
@@ -290,7 +299,7 @@
Iterator<Property> iterator = join.getPropertyIterator();
while (iterator.hasNext()) {
Property property = iterator.next();
- OrmShape tableShape = getOrCreateDatabaseTable(property.getValue().getTable());
+ OrmShape tableShape = getOrCreateDatabaseTable(property.getValue().getTable());
createConnections(classShape, tableShape);
}
}
@@ -311,13 +320,14 @@
tableShape = getOrCreateDatabaseTable(component.getTable());
}
createConnections(classShape, tableShape);
- if (!isConnectionExist(classShape, tableShape)) {
+ if (shouldCreateConnection(classShape, tableShape)) {
connections.add(new Connection(classShape, tableShape));
}
Shape parentShape = ((SpecialOrmShape)classShape).getParentShape();
if (parentShape != null) {
- OrmShape parentClassShape = elements.get(Utils.getName(((Property)parentShape.getOrmElement()).getPersistentClass().getEntityName()));
- if (!isConnectionExist(parentShape, parentClassShape)) {
+ OrmShape parentClassShape = elements.get(
+ Utils.getName(((Property)parentShape.getOrmElement()).getPersistentClass().getEntityName()));
+ if (shouldCreateConnection(parentShape, parentClassShape)) {
connections.add(new Connection(parentShape, parentClassShape));
}
}
@@ -347,7 +357,7 @@
tableShape = getOrCreateDatabaseTable(component.getAssociatedClass().getTable());
}
createConnections(classShape, tableShape);
- if (!isConnectionExist(classShape, tableShape)) {
+ if (shouldCreateConnection(classShape, tableShape)) {
connections.add(new Connection(classShape, tableShape));
}
}
@@ -381,7 +391,11 @@
@SuppressWarnings("unchecked")
- private void createConnections(ExpandableShape persistentClass, ExpandableShape dbTable) {
+ private boolean createConnections(ExpandableShape persistentClass, ExpandableShape dbTable) {
+ boolean res = false;
+ if (persistentClass == null || dbTable == null) {
+ return res;
+ }
Property parentProperty = null;
if (persistentClass.getOrmElement() instanceof SpecialRootClass) {
parentProperty = ((SpecialRootClass)persistentClass.getOrmElement()).getParentProperty();
@@ -421,14 +435,16 @@
name2 = property2.getName();
}
if (dbColumn.getName().equals(name2)) {
- if (!isConnectionExist(shape, shapeCol)) {
+ if (shouldCreateConnection(shape, shapeCol)) {
connections.add(new Connection(shape, shapeCol));
+ res = true;
}
processed.add(shapeCol);
}
}
}
}
+ return res;
}
@@ -447,4 +463,14 @@
private boolean isConnectionExist(Shape source, Shape target) {
return Utils.isConnectionExist(source, target);
}
+
+ private boolean shouldCreateConnection(Shape source, Shape target) {
+ if (source == null || target == null || source == target) {
+ return false;
+ }
+ if (isConnectionExist(source, target)) {
+ return false;
+ }
+ return true;
+ }
}
15 years, 3 months
JBoss Tools SVN: r17794 - trunk/hibernatetools/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2009-09-29 10:33:55 -0400 (Tue, 29 Sep 2009)
New Revision: 17794
Modified:
trunk/hibernatetools/docs/reference/en/modules/plugins.xml
Log:
https://jira.jboss.org/jira/browse/JBDS-685
Modified: trunk/hibernatetools/docs/reference/en/modules/plugins.xml
===================================================================
--- trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2009-09-29 13:34:22 UTC (rev 17793)
+++ trunk/hibernatetools/docs/reference/en/modules/plugins.xml 2009-09-29 14:33:55 UTC (rev 17794)
@@ -76,11 +76,13 @@
</emphasis> file if you do not already have such one.</para>
<para>Start the wizard by clicking <emphasis>
- <property>New > Other (Ctrl+N)</property> or on a web Seam project in Web Projects view <property> WebContent -> New -> File -> Hibernate Configuration 3.0</property>
- </emphasis>, then <emphasis>
+ <property>New > Other (Ctrl+N)</property></emphasis>, then <emphasis>
<property>Hibernate > Hibernate Configuration File (cfg.xml)</property>
</emphasis> and press <emphasis>
<property>Next</property>
+ </emphasis>
+ or on a web Seam project in the <property>Web Projects</property> view
+ <emphasis><property> WebContent -> New -> File -> Hibernate Configuration 3.0</property>
</emphasis>. After selecting the wanted location for the <emphasis>
<property>hibernate.cfg.xml</property>
</emphasis> file, you will see the following page:</para>
15 years, 3 months
JBoss Tools SVN: r17793 - in trunk/jsf/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: chukhutsina
Date: 2009-09-29 09:34:22 -0400 (Tue, 29 Sep 2009)
New Revision: 17793
Added:
trunk/jsf/docs/userguide/en/images/editors_features/editors_features_8e.png
Modified:
trunk/jsf/docs/userguide/en/modules/richfaces_support.xml
Log:
<html><head><meta name="qrichtext" content="1" /></head><body style="font-size:9pt;font-family:Sans Serif">
<p>https://jira.jboss.org/jira/browse/JBDS-790 -Added the info about supported OpenOn in "ForID"-like attributes. </p>
</body></html>
Added: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_8e.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/editors_features/editors_features_8e.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/docs/userguide/en/modules/richfaces_support.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/richfaces_support.xml 2009-09-29 12:32:40 UTC (rev 17792)
+++ trunk/jsf/docs/userguide/en/modules/richfaces_support.xml 2009-09-29 13:34:22 UTC (rev 17793)
@@ -92,6 +92,16 @@
</imageobject>
</mediaobject>
</figure>
+ <para>OpenOn is also supported in <property>"ForID"</property>-like attributes
+ (the attributes, where the value should be <property>ID</property> or the list of <property>IDs</property>) in RichFaces.</para>
+ <figure>
+ <title>OpenOn With "ForID"-like attributes</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/editors_features/editors_features_8e.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
</section>
<section id="RF_in_palette">
15 years, 3 months
JBoss Tools SVN: r17792 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui: diagram/editors/model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2009-09-29 08:32:40 -0400 (Tue, 29 Sep 2009)
New Revision: 17792
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/ObjectEditorInput.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4865 - fixed
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-09-29 12:00:36 UTC (rev 17791)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/DiagramViewer.java 2009-09-29 12:32:40 UTC (rev 17792)
@@ -13,7 +13,6 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
@@ -275,64 +274,30 @@
public boolean isDirty() {
return ormDiagram.isDirty();
}
-
- protected String getItemName(RootClass rootClass) {
- String res = rootClass.getEntityName();
- if (res == null) {
- res = rootClass.getClassName();
- }
- if (res == null) {
- res = rootClass.getNodeName();
- }
- res = res.substring(res.lastIndexOf(".") + 1); //$NON-NLS-1$
- return res;
- }
protected void setInput(IEditorInput input) {
ObjectEditorInput objectEditorInput = (ObjectEditorInput)input;
ConsoleConfiguration configuration = objectEditorInput.getConfiguration();
- Object obj = objectEditorInput.getObject();
- setPartName(DiagramViewerMessages.DiagramViewer_diagram_for + " " + getDiagramName(obj)); //$NON-NLS-1$
- if (obj instanceof RootClass) {
- RootClass rootClass = (RootClass)obj;
+ ArrayList<RootClass> roots = objectEditorInput.getRootClasses();
+ setPartName(DiagramViewerMessages.DiagramViewer_diagram_for + " " + objectEditorInput.getName()); //$NON-NLS-1$
+ if (roots.size() == 1) {
+ RootClass rootClass = roots.get(0);
ormDiagram = new OrmDiagram(configuration, rootClass);
- } else if (obj instanceof RootClass[]) {
- RootClass[] rootClasses = (RootClass[])obj;
+ } else if (roots.size() > 1) {
+ RootClass[] rootClasses = roots.toArray(new RootClass[0]);
ormDiagram = new OrmDiagram(configuration, rootClasses);
}
super.setInput(input);
loadProperties();
}
- protected String getDiagramName(Object obj) {
- String name = ""; //$NON-NLS-1$
- if (obj instanceof RootClass) {
- RootClass rootClass = (RootClass)obj;
- name = getItemName(rootClass);
- } else if (obj instanceof RootClass[]) {
- RootClass[] rootClasses = (RootClass[])obj;
- ArrayList<String> names = new ArrayList<String>();
- for (int i = 0; i < rootClasses.length; i++) {
- names.add(getItemName(rootClasses[i]));
- }
- // sort to get same name for same combinations of entities
- Collections.sort(names);
- name = names.size() > 0 ? names.get(0) : ""; //$NON-NLS-1$
- for (int i = 1; i < rootClasses.length; i++) {
- name += " & " + names.get(i); //$NON-NLS-1$
- }
- }
- return name;
- }
-
public String getDiagramName() {
IEditorInput input = getEditorInput();
- Object obj = null;
if (input instanceof ObjectEditorInput) {
ObjectEditorInput objectEditorInput = (ObjectEditorInput)input;
- obj = objectEditorInput.getObject();
+ return objectEditorInput.getName();
}
- return getDiagramName(obj);
+ return ""; //$NON-NLS-1$
}
/**
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2009-09-29 12:00:36 UTC (rev 17791)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/diagram/editors/model/ElementsFactory.java 2009-09-29 12:32:40 UTC (rev 17792)
@@ -58,7 +58,8 @@
}
Iterator<Shape> it = element.getChildrenList().iterator();
while (it.hasNext()) {
- createChildren(it.next());
+ final Shape shape = it.next();
+ createChildren(shape);
}
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/ObjectEditorInput.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/ObjectEditorInput.java 2009-09-29 12:00:36 UTC (rev 17791)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui/src/org/jboss/tools/hibernate/ui/view/ObjectEditorInput.java 2009-09-29 12:32:40 UTC (rev 17792)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
+ * Copyright (c) 2007-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,
@@ -10,43 +10,89 @@
******************************************************************************/
package org.jboss.tools.hibernate.ui.view;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IPersistableElement;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.mapping.RootClass;
/**
*
+ * author: ?
+ * author: Vitali Yemialyanchyk
*/
public class ObjectEditorInput implements IEditorInput{
- protected Object fObject;
+ protected ArrayList<RootClass> roots;
protected ConsoleConfiguration configuration;
- public ObjectEditorInput(ConsoleConfiguration configuration, Object object) {
- fObject = object;
+ public ObjectEditorInput(ConsoleConfiguration configuration, RootClass rc) {
+ roots = new ArrayList<RootClass>();
+ roots.add(rc);
this.configuration = configuration;
}
- public Object getObject() {
- return fObject;
+ public ObjectEditorInput(ConsoleConfiguration configuration, RootClass[] rcs) {
+ roots = new ArrayList<RootClass>();
+ for (int i = 0; i < rcs.length; i++) {
+ roots.add(rcs[i]);
+ }
+ Collections.sort(roots, new RootClassComparator());
+ this.configuration = configuration;
}
+
+ public class RootClassComparator implements Comparator<RootClass> {
+ public int compare(RootClass o1, RootClass o2) {
+ return getItemName(o1).compareTo(getItemName(o2));
+ }
+ }
-
public boolean exists() {
return false;
}
+ public ArrayList<RootClass> getRootClasses() {
+ return roots;
+ }
public ImageDescriptor getImageDescriptor() {
return ImageDescriptor.getMissingImageDescriptor();
}
-
public String getName() {
- return ""; //$NON-NLS-1$
+ return getDiagramName();
}
+ public String getDiagramName() {
+ String name = ""; //$NON-NLS-1$
+ ArrayList<String> names = new ArrayList<String>();
+ for (int i = 0; i < roots.size(); i++) {
+ names.add(getItemName(roots.get(i)));
+ }
+ // sort to get same name for same combinations of entities
+ Collections.sort(names);
+ name = names.size() > 0 ? names.get(0) : ""; //$NON-NLS-1$
+ for (int i = 1; i < names.size(); i++) {
+ name += " & " + names.get(i); //$NON-NLS-1$
+ }
+ return name;
+ }
+
+ protected String getItemName(RootClass rootClass) {
+ String res = rootClass.getEntityName();
+ if (res == null) {
+ res = rootClass.getClassName();
+ }
+ if (res == null) {
+ res = rootClass.getNodeName();
+ }
+ res = res.substring(res.lastIndexOf(".") + 1); //$NON-NLS-1$
+ return res;
+ }
public IPersistableElement getPersistable() {
return null;
@@ -68,10 +114,29 @@
}
public boolean equals(Object obj) {
- return (obj instanceof ObjectEditorInput && ((ObjectEditorInput)obj).fObject == fObject);
+ boolean res = false;
+ if (!(obj instanceof ObjectEditorInput)) {
+ return res;
+ }
+ final ObjectEditorInput oei = (ObjectEditorInput)obj;
+ if (!configuration.equals(oei.getConfiguration())) {
+ return res;
+ }
+ final ArrayList<RootClass> rootsOei = oei.getRootClasses();
+ if (roots.size() != rootsOei.size()) {
+ return res;
+ }
+ res = true;
+ for (int i = 0; i < roots.size(); i++) {
+ if (!roots.get(i).equals(rootsOei.get(i))) {
+ res = false;
+ break;
+ }
+ }
+ return res;
}
public int hashCode() {
- return fObject.hashCode();
+ return roots.hashCode() + configuration.hashCode();
}
}
15 years, 3 months
JBoss Tools SVN: r17791 - trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-09-29 08:00:36 -0400 (Tue, 29 Sep 2009)
New Revision: 17791
Modified:
trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
Log:
Modified: trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2009-09-29 11:46:19 UTC (rev 17790)
+++ trunk/common/plugins/org.jboss.tools.common.model/src/org/jboss/tools/common/model/loaders/impl/PropertiesLoader.java 2009-09-29 12:00:36 UTC (rev 17791)
@@ -311,7 +311,7 @@
if(ch || mod) o1.setModified(true);
}
- private static int getSeparatorIndex(String s) {
+ public static int getSeparatorIndex(String s) {
String tr = s.trim();
if(tr.length() == 0 || tr.charAt(0) == '#' || tr.charAt(0) == '!') return -1;
boolean n = false;
15 years, 3 months
JBoss Tools SVN: r17790 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-09-29 07:46:19 -0400 (Tue, 29 Sep 2009)
New Revision: 17790
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4879
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java 2009-09-29 11:28:00 UTC (rev 17789)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/NamingStrategyMappingTools.java 2009-09-29 11:46:19 UTC (rev 17790)
@@ -108,8 +108,7 @@
}
}
String name = owningTable.getName() + '_' + targetTable.getName();
- //return owningTable.getDatabase().convertNameToIdentifier(name);
- return name;
+ return owningTable.getDatabase().convertNameToIdentifier(name);
}
public static String buildJoinColumnDefaultName(HibernateJoinColumn joinColumn) {
15 years, 3 months
JBoss Tools SVN: r17789 - in trunk/jst/tests/org.jboss.tools.jst.css.test: resources/cssTest/WebContent/pages/JBIDE/4940 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-09-29 07:28:00 -0400 (Tue, 29 Sep 2009)
New Revision: 17789
Added:
trunk/jst/tests/org.jboss.tools.jst.css.test/resources/cssTest/WebContent/pages/JBIDE/4940/
trunk/jst/tests/org.jboss.tools.jst.css.test/resources/cssTest/WebContent/pages/JBIDE/4940/caseSensitiveTest.css
trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/CaseSensitiveTest_JBIDE4940.java
Modified:
trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/CSSAllTests.java
trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/IncorrectPageAfterSelectionTest_JBIDE4849.java
trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/NotCompletedCSS_JBIDE4677.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4940
Added: trunk/jst/tests/org.jboss.tools.jst.css.test/resources/cssTest/WebContent/pages/JBIDE/4940/caseSensitiveTest.css
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.css.test/resources/cssTest/WebContent/pages/JBIDE/4940/caseSensitiveTest.css (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.css.test/resources/cssTest/WebContent/pages/JBIDE/4940/caseSensitiveTest.css 2009-09-29 11:28:00 UTC (rev 17789)
@@ -0,0 +1,3 @@
+.test {
+ COLOR: red;
+}
\ No newline at end of file
Property changes on: trunk/jst/tests/org.jboss.tools.jst.css.test/resources/cssTest/WebContent/pages/JBIDE/4940/caseSensitiveTest.css
___________________________________________________________________
Name: svn:mime-type
+ text/css
Name: svn:eol-style
+ native
Modified: trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/CSSAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/CSSAllTests.java 2009-09-29 11:02:02 UTC (rev 17788)
+++ trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/CSSAllTests.java 2009-09-29 11:28:00 UTC (rev 17789)
@@ -14,6 +14,7 @@
import junit.framework.Test;
import junit.framework.TestSuite;
+import org.jboss.tools.jst.css.test.jbide.CaseSensitiveTest_JBIDE4940;
import org.jboss.tools.jst.css.test.jbide.ExtendingCSSViewTest_JBIDE4850;
import org.jboss.tools.jst.css.test.jbide.IncorrectPageAfterSelectionTest_JBIDE4849;
import org.jboss.tools.jst.css.test.jbide.InputFractionalValueTest_JBIDE4790;
@@ -41,6 +42,7 @@
suite.addTestSuite(ExtendingCSSViewTest_JBIDE4850.class);
suite.addTestSuite(NotCompletedCSS_JBIDE4677.class);
suite.addTestSuite(IncorrectPageAfterSelectionTest_JBIDE4849.class);
+ suite.addTestSuite(CaseSensitiveTest_JBIDE4940.class);
// $JUnit-END$
return new ProjectImportTestSetup(
Added: trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/CaseSensitiveTest_JBIDE4940.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/CaseSensitiveTest_JBIDE4940.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/CaseSensitiveTest_JBIDE4940.java 2009-09-29 11:28:00 UTC (rev 17789)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.css.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.ui.part.IPage;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.jboss.tools.jst.css.properties.CSSPropertyPage;
+import org.jboss.tools.jst.css.test.AbstractCSSViewTest;
+import org.jboss.tools.jst.css.view.CSSEditorView;
+import org.jboss.tools.test.util.JobUtils;
+
+/**
+ * @author Sergey Dzmitrovich
+ *
+ */
+public class CaseSensitiveTest_JBIDE4940 extends AbstractCSSViewTest {
+
+ public static final String TEST_PAGE_NAME = "/JBIDE/4940/caseSensitiveTest.css"; //$NON-NLS-1$
+
+ public static final String TESTED_ATTRIBUTE = "color"; //$NON-NLS-1$
+
+ public void testCaseSensitive() throws CoreException,
+ SecurityException, IllegalArgumentException, NoSuchFieldException,
+ IllegalAccessException {
+
+ IFile pageFile = getComponentPath(TEST_PAGE_NAME, getProjectName());
+
+ assertNotNull(pageFile);
+
+ StructuredTextEditor editor = (StructuredTextEditor) openEditor(
+ pageFile, CSS_EDITOR_ID);
+
+ JobUtils.waitForIdle();
+
+ assertNotNull(editor);
+
+ CSSEditorView view = (CSSEditorView) openView(CSS_EDITOR_VIEW);
+
+ assertNotNull(view);
+
+ IPage page = view.getCurrentPage();
+
+ assertNotNull(page);
+
+ assertTrue(page instanceof CSSPropertyPage);
+
+ assertNotNull(((CSSPropertyPage) page).getStyleAttributes().get(
+ TESTED_ATTRIBUTE));
+
+ }
+
+}
Property changes on: trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/CaseSensitiveTest_JBIDE4940.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/IncorrectPageAfterSelectionTest_JBIDE4849.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/IncorrectPageAfterSelectionTest_JBIDE4849.java 2009-09-29 11:02:02 UTC (rev 17788)
+++ trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/IncorrectPageAfterSelectionTest_JBIDE4849.java 2009-09-29 11:28:00 UTC (rev 17789)
@@ -28,7 +28,7 @@
public static final String TEST_PAGE_NAME = "JBIDE/4849/incorrectPageTest.css"; //$NON-NLS-1$
- public void testInlineStyleEditing() throws CoreException,
+ public void testIncorrectPageAfterSelection() throws CoreException,
SecurityException, IllegalArgumentException, NoSuchFieldException,
IllegalAccessException {
Modified: trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/NotCompletedCSS_JBIDE4677.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/NotCompletedCSS_JBIDE4677.java 2009-09-29 11:02:02 UTC (rev 17788)
+++ trunk/jst/tests/org.jboss.tools.jst.css.test/src/org/jboss/tools/jst/css/test/jbide/NotCompletedCSS_JBIDE4677.java 2009-09-29 11:28:00 UTC (rev 17789)
@@ -28,7 +28,7 @@
public static final String TEST_PAGE_NAME = "JBIDE/4677/notCompletedCss.css"; //$NON-NLS-1$
- public void testInlineStyleEditing() throws CoreException,
+ public void testNotCompletedCSS() throws CoreException,
SecurityException, IllegalArgumentException, NoSuchFieldException,
IllegalAccessException {
15 years, 3 months
JBoss Tools SVN: r17788 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-09-29 07:02:02 -0400 (Tue, 29 Sep 2009)
New Revision: 17788
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4733
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java 2009-09-29 10:56:42 UTC (rev 17787)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizard.java 2009-09-29 11:02:02 UTC (rev 17788)
@@ -62,7 +62,7 @@
prop.put("outputFileName", initPage.getFilename()); //$NON-NLS-1$
prop.put("format", "true"); //$NON-NLS-1$ //$NON-NLS-2$
prop.put("scriptToConsole", "false"); //$NON-NLS-1$ //$NON-NLS-2$
- prop.put("exportToDatabase", "false");//$NON-NLS-1$ //$NON-NLS-2$
+ prop.put("exportToDatabase", Boolean.toString(initPage.isExportToDB()));//$NON-NLS-1$
wc.setAttribute(HibernateJpaPlatformUi.full_exporter_id + ".properties", prop); //$NON-NLS-1$
wc.setAttribute(HibernateJpaPlatformUi.full_exporter_id + ".extension_id", HibernateLaunchConstants.ATTR_PREFIX + "hbm2ddl"); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2009-09-29 10:56:42 UTC (rev 17787)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateDdlWizardPage.java 2009-09-29 11:02:02 UTC (rev 17788)
@@ -14,6 +14,9 @@
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringDialogField;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.hibernate.util.StringHelper;
import org.jboss.tools.hibernate.jpt.core.internal.HibernateJpaProject;
@@ -26,13 +29,12 @@
private StringDialogField filename;
+ private Button exportToDB;
+
protected GenerateDdlWizardPage(HibernateJpaProject jpaProject) {
super(jpaProject);
}
- /* (non-Javadoc)
- * @see org.jboss.tools.hibernate.jpt.ui.wizard.GenerateInitWizardPage#createChildControls(org.eclipse.swt.widgets.Composite)
- */
@Override
protected void createChildControls(Composite container) {
filename = new StringDialogField();
@@ -40,6 +42,13 @@
filename.setText("schema.ddl"); //$NON-NLS-1$
filename.setDialogFieldListener(fieldlistener);
filename.doFillIntoGrid(container, numColumns);
+
+ exportToDB = new Button(container, SWT.CHECK);
+ exportToDB.setText(Messages.GenerateInitWizardPage_export_to_db);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = numColumns;
+ exportToDB.setLayoutData(gd);
+
}
protected void dialogChanged() {
@@ -65,7 +74,8 @@
return filename.getText();
}
+ public boolean isExportToDB(){
+ return exportToDB.getSelection();
+ }
-
-
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java 2009-09-29 10:56:42 UTC (rev 17787)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/Messages.java 2009-09-29 11:02:02 UTC (rev 17788)
@@ -20,6 +20,7 @@
private static final String BUNDLE_NAME = "org.jboss.tools.hibernate.jpt.ui.wizard.messages"; //$NON-NLS-1$
public static String GenerateInitWizardPage_title;
+ public static String GenerateInitWizardPage_export_to_db;
public static String GenerateInitWizardPage_autodetect;
public static String GenerateInitWizardPage_use_console_configuration;
public static String GenerateInitWizardPage_refresh;
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties 2009-09-29 10:56:42 UTC (rev 17787)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/messages.properties 2009-09-29 11:02:02 UTC (rev 17788)
@@ -1,4 +1,5 @@
GenerateInitWizardPage_title=Use existing console configuration or connection profile for database connection
+GenerateInitWizardPage_export_to_db=Export to Database
GenerateInitWizardPage_use_console_configuration=Use Console Configuration
GenerateInitWizardPage_refresh=Refresh
GenerateInitWizardPage_autodetect=[Autodetect]
15 years, 3 months
JBoss Tools SVN: r17787 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2009-09-29 06:56:42 -0400 (Tue, 29 Sep 2009)
New Revision: 17787
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4954
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp 2009-09-29 10:56:42 UTC (rev 17787)
@@ -0,0 +1,14 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<html>
+ <body>
+
+ <f:view>
+ <h:form id="greetingForm">
+ <h1>Test for JBIDE-4954</h1>
+ <h:graphicImage value="#{resource['']}" />
+ </h:form>
+ </f:view>
+ </body>
+</html>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsf2test/WebContent/pages/JBIDE/4954/inputUserName.jsp.xml 2009-09-29 10:56:42 UTC (rev 17787)
@@ -0,0 +1,13 @@
+<tests>
+ <test id="greetingForm">
+<FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+<H1 STYLE="-moz-user-modify: read-write;">
+<SPAN CLASS="vpe-text">
+Test for JBIDE-4954
+</SPAN>
+</H1>
+<IMG SRC="/.*jsf2test/WebContent/resources/" STYLE="-moz-user-modify: read-write;"/>
+
+</FORM>
+ </test>
+</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java 2009-09-29 10:24:21 UTC (rev 17786)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2550Test.java 2009-09-29 10:56:42 UTC (rev 17787)
@@ -27,6 +27,10 @@
performContentTest("JBIDE/2550/jbide2550.xhtml"); //$NON-NLS-1$
}
+ public void testOfJSF2ResourceForEmptyString() throws Throwable{
+ performContentTest("JBIDE/4954/inputUserName.jsp"); //$NON-NLS-1$
+ }
+
@Override
protected String getTestProjectName() {
return JsfAllTests.IMPORT_JSF_20_PROJECT_NAME;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-09-29 10:24:21 UTC (rev 17786)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/expression/VpeFunctionSrc.java 2009-09-29 10:56:42 UTC (rev 17787)
@@ -326,8 +326,13 @@
if(zipEntry!=null){
InputStream inputStream = jarPackageFragmentRoot.getJar().getInputStream(zipEntry);
IPath stateLocation = VpePlugin.getDefault().getStateLocation();
- String fileName = classPathResource.substring(classPathResource.lastIndexOf("/")+1,classPathResource.lastIndexOf(".")); //$NON-NLS-1$ //$NON-NLS-2$
- String fileExtension = classPathResource.substring(classPathResource.lastIndexOf("."),classPathResource.length()); //$NON-NLS-1$
+
+ String fileName = null;
+ String fileExtension = null;
+ if(classPathResource.lastIndexOf(".")!=-1) { //$NON-NLS-1$ //added by mareshkau, fix for JBIDE-4954
+ fileName = classPathResource.substring(classPathResource.lastIndexOf("/")+1,classPathResource.lastIndexOf(".")); //$NON-NLS-1$ //$NON-NLS-2$
+ fileExtension = classPathResource.substring(classPathResource.lastIndexOf("."),classPathResource.length()); //$NON-NLS-1$
+ }
if(fileName!=null && fileName.length()>0
&& fileExtension!=null && fileExtension.length()>0) {
File temporaryFile =File.createTempFile(
15 years, 3 months