JBoss Tools SVN: r5807 - in trunk/as/docs/resources/styles/en: Images and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2008-01-18 10:46:37 -0500 (Fri, 18 Jan 2008)
New Revision: 5807
Added:
trunk/as/docs/resources/styles/en/Images/ico_tip.gif
Modified:
trunk/as/docs/resources/styles/en/Images/ico_important.gif
trunk/as/docs/resources/styles/en/html.css
Log:
http://jira.jboss.com/jira/browse/JBDS-224 - special boxes for tip, note, important + css styles
Modified: trunk/as/docs/resources/styles/en/Images/ico_important.gif
===================================================================
(Binary files differ)
Added: trunk/as/docs/resources/styles/en/Images/ico_tip.gif
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/resources/styles/en/Images/ico_tip.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/as/docs/resources/styles/en/html.css
===================================================================
--- trunk/as/docs/resources/styles/en/html.css 2008-01-18 14:19:10 UTC (rev 5806)
+++ trunk/as/docs/resources/styles/en/html.css 2008-01-18 15:46:37 UTC (rev 5807)
@@ -71,6 +71,10 @@
text-align: center;
}
+div.book .subtitle {
+ text-align: center;
+}
+
.mediaobject{
padding : 5px 10px 5px 35px;
}
@@ -99,7 +103,7 @@
div.book div.mediaobject{
-text-align:left;
+text-align:center;
}
div.mediaobject, div.mediaobject img *{
@@ -108,8 +112,8 @@
}
DIV.note{
- BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #FFFDD3;
- background-image : url('Images/ico_note.gif'); background-repeat : no-repeat; background-position :top left;
+ BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #cfe3ff;
+ background-image : url('../images/ico_note.gif'); background-repeat : no-repeat; background-position :top left;
}
DIV.note *{
@@ -123,8 +127,8 @@
MARGIN-TOP: 0px; MARGIN-BOTTOM: 1em; PADDING-BOTTOM: 0px; PADDING-TOP: 0px
}
DIV.important {
- BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #CFE3FF;
- background-image : url('Images/ico_important.gif'); background-repeat : no-repeat; background-position :top left;
+ BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #fee3d9;
+ background-image : url('../images/ico_important.gif'); background-repeat : no-repeat; background-position :top left;
}
DIV.important *{
@@ -136,7 +140,19 @@
}
+DIV.tip {
+ BORDER: #CECECE 1px solid; PADDING: 3px 10px 10px 50px; line-height : 14px; MARGIN: 10px 0px 10px 0px; FONT-SIZE: 11px; WIDTH: 500px; BACKGROUND-COLOR: #CFE3FF; background-repeat : no-repeat; background-position :top left; background-image : url('../images/ico_tip.gif');
+}
+DIV.tip *{
+ line-height : 14px;
+}
+
+.tip pre.XML {
+PADDING: 1px 1px 1px 10px;
+
+}
+
TABLE {
BORDER: #cccccc 1px solid; FONT-SIZE: 11px; BORDER-COLLAPSE: collapse; border-spacing: 0; empty-cells: hide; margin-bottom : 10px;
}
@@ -148,7 +164,7 @@
.table TH {
WHITE-SPACE: nowrap; BACKGROUND-COLOR: #EEF5FF; TEXT-ALIGN: center; BORDER-BOTTOM: #CAE1FF 2px solid; PADDING: 2px 8px 2px 8px;
- background-image : url('Images/bg_table.gif'); background-repeat : repeat-x; background-position :top left;
+ background-image : url('../images/bg_table.gif'); background-repeat : repeat-x; background-position :top left;
}
TD {
PADDING: 4px 8px 4px 8px; BORDER-BOTTOM: #cccccc 1px dotted; BORDER-right: #cccccc 1px dotted;
@@ -343,4 +359,51 @@
cursor: pointer;
}
-
+pre.CSS, pre.css {
+ line-height:0px;
+ margin-bottom:0em;
+}
+.css_normal {
+ line-height:0px;
+ color:#000000;
+}
+.css_colon {
+color:#000000;
+}
+.css_semi_colon {
+color:#000000;
+}
+.css_curly_brace {
+color:#000000;
+}
+.css_comment {
+color:#939393;
+}
+.css_error {
+color:#BF3F3F;
+}
+.css_selector {
+color:#008cca;
+}
+.css_null {
+color:#008cca;
+}
+.css_property_name {
+color:#000000;
+font-weight:bold;
+}
+.css_property_value {
+color:#ff6600;
+}
+.css_uri {
+color:#2A00FF;
+}
+.css_atmark_rule {
+color:#3F7F7F;
+}
+.css_media {
+color:#336699;
+}
+.css_string {
+color:#336699;
+}
\ No newline at end of file
16 years, 9 months
JBoss Tools SVN: r5806 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: workbench and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-18 09:19:10 -0500 (Fri, 18 Jan 2008)
New Revision: 5806
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/workbench/ConsoleConfigurationWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/DeferredContentProvider.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactory.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1422
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 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/KnownConfigurationsProvider.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -21,13 +21,10 @@
*/
package org.hibernate.eclipse.console.views;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.viewers.AbstractTreeViewer;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.model.IWorkbenchAdapter;
import org.hibernate.SessionFactory;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
@@ -66,25 +63,19 @@
}
private void refreshTree() {
+ tv.getTree().setRedraw(false);
Runnable runnable = new Runnable() {
public void run() {
tv.refresh();
}
};
- tv.getControl().getDisplay().syncExec(runnable);
+ tv.getControl().getDisplay().asyncExec(runnable);
+ tv.getTree().setRedraw(true);
}
public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
refreshTree();
}
-
- protected IWorkbenchAdapter getAdapter(Object o) {
- if (o instanceof IAdaptable) {
- return (IWorkbenchAdapter) ((IAdaptable) o).getAdapter(IWorkbenchAdapter.class);
- } else {
- return (IWorkbenchAdapter) Platform.getAdapterManager().getAdapter(o, IWorkbenchAdapter.class);
- }
- }
public void sessionFactoryBuilt(final ConsoleConfiguration ccfg, SessionFactory builtFactory) {
/*(Display.getDefault().syncExec(new Runnable() { Disabled as it will generate double entries in the child list
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/ConsoleConfigurationWorkbenchAdapter.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -75,7 +75,9 @@
o2 = sfError;
}*/
- return new Object[] { o1, new LazySessionFactory(ccfg), new LazyDatabaseSchema(ccfg) };
+ Object[] res = new Object[] { o1, new LazySessionFactory(ccfg), new LazyDatabaseSchema(ccfg) };
+ ccfg.setChildren(res);
+ return res;
}
private ConsoleConfiguration getConsoleConfiguration(Object o) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/DeferredContentProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/DeferredContentProvider.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/DeferredContentProvider.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -29,6 +29,7 @@
import org.eclipse.ui.model.IWorkbenchAdapter;
import org.eclipse.ui.progress.DeferredTreeContentManager;
import org.eclipse.ui.progress.IDeferredWorkbenchAdapter;
+import org.hibernate.console.model.IParentEl;
public class DeferredContentProvider extends BaseWorkbenchContentProvider {
@@ -55,6 +56,10 @@
* @see org.eclipse.jface.viewers.ITreeContentProvider#hasChildren(java.lang.Object)
*/
public boolean hasChildren(Object element) {
+ // if we could check simple check it without DeferredTreeContentManager
+ if (element instanceof IParentEl) {
+ return ((IParentEl)element).hasChildren();
+ }
// the + box will always appear, but then disappear
// if not needed after you first click on it.
if (manager != null) {
@@ -69,6 +74,13 @@
* @see org.eclipse.ui.model.WorkbenchContentProvider#getChildren(java.lang.Object)
*/
public Object[] getChildren(Object element) {
+ // if we could get children simple get it without DeferredTreeContentManager
+ if (element instanceof IParentEl) {
+ Object[] children = ((IParentEl)element).getChildren();
+ if (null != children) {
+ return children;
+ }
+ }
if (manager != null) {
Object[] children = manager.getChildren(element);
if(children != null) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchema.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -24,8 +24,9 @@
import org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy;
import org.hibernate.cfg.reveng.ReverseEngineeringStrategy;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.model.IParentElImpl;
-public class LazyDatabaseSchema {
+public class LazyDatabaseSchema extends IParentElImpl {
private final ConsoleConfiguration ccfg;
private final ReverseEngineeringStrategy res;
@@ -45,5 +46,4 @@
public ReverseEngineeringStrategy getReverseEngineeringStrategy() {
return res;
}
-
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazyDatabaseSchemaWorkbenchAdapter.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -64,7 +64,7 @@
Map.Entry entry = (Map.Entry) qualifierEntries.next();
result.add(new TableContainer((String) entry.getKey(),(List)entry.getValue()));
}
- return toArray(result.iterator(), TableContainer.class, new Comparator() {
+ Object[] res = toArray(result.iterator(), TableContainer.class, new Comparator() {
public int compare(Object arg0, Object arg1) {
@@ -72,6 +72,8 @@
}
});
+ dbs.setChildren(res);
+ return res;
}
private LazyDatabaseSchema getLazyDatabaseSchema(Object o) {
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactory.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactory.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -22,9 +22,10 @@
package org.hibernate.eclipse.console.workbench;
import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.model.IParentElImpl;
import org.hibernate.console.node.ConfigurationEntitiesNode;
-public class LazySessionFactory {
+public class LazySessionFactory extends IParentElImpl {
private final ConsoleConfiguration ccfg;
private ConfigurationEntitiesNode cfgNode;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/LazySessionFactoryAdapter.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -50,7 +50,9 @@
}
}
if(lazySessionFactory.getCfgNode()!=null) {
- return toArray(lazySessionFactory.getCfgNode().children(),BaseNode.class);
+ Object[] res = toArray(lazySessionFactory.getCfgNode().children(),BaseNode.class);
+ lazySessionFactory.setChildren(res);
+ return res;
} else {
return new Object[] { label };
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainer.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -23,8 +23,10 @@
import java.util.List;
-public class TableContainer {
+import org.hibernate.console.model.IParentElImpl;
+public class TableContainer extends IParentElImpl {
+
private final List tables;
private final String name;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java 2008-01-18 14:17:03 UTC (rev 5805)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/workbench/TableContainerWorkbenchAdapter.java 2008-01-18 14:19:10 UTC (rev 5806)
@@ -32,7 +32,7 @@
public Object[] getChildren(Object o) {
TableContainer tc = getTableContainer( o );
- return toArray(tc.getTables().iterator(), Table.class, new Comparator() {
+ Object[] res = toArray(tc.getTables().iterator(), Table.class, new Comparator() {
public int compare(Object arg0, Object arg1) {
@@ -40,6 +40,8 @@
}
});
+ tc.setChildren(res);
+ return res;
}
private TableContainer getTableContainer(Object o) {
16 years, 9 months
JBoss Tools SVN: r5805 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-01-18 09:17:03 -0500 (Fri, 18 Jan 2008)
New Revision: 5805
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1652
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-01-18 14:16:08 UTC (rev 5804)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamELValidator.java 2008-01-18 14:17:03 UTC (rev 5805)
@@ -111,7 +111,11 @@
Set<IFile> files = validationContext.getRegisteredFiles();
for (IFile file : files) {
if(!reporter.isCancelled()) {
- validateFile(file);
+ if(file.exists()) {
+ validateFile(file);
+ } else {
+ validationContext.removeUnnamedElResource(file.getFullPath());
+ }
}
}
return OK_STATUS;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2008-01-18 14:16:08 UTC (rev 5804)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidationContext.java 2008-01-18 14:17:03 UTC (rev 5805)
@@ -64,6 +64,14 @@
coreLinks.removeLinkedResources(resources);
}
+ /**
+ * Removes link between core resource and variable names.
+ * @param linkedResource
+ */
+ public void removeLinkedCoreResource(IPath resource) {
+ coreLinks.removeLinkedResource(resource);
+ }
+
public Set<IPath> getCoreResourcesByVariableName(String variableName) {
return coreLinks.getResourcesByVariableName(variableName);
}
@@ -145,6 +153,14 @@
}
/**
+ * Removes link between resource and variable names.
+ * @param linkedResource
+ */
+ public void removeLinkedElResource(IPath resource) {
+ elLinks.removeLinkedResource(resource);
+ }
+
+ /**
* @param changedFiles - files which were changed.
* @return Set of resources which we should validate during incremental EL validation.
*/
@@ -307,20 +323,28 @@
*/
public void removeLinkedResources(Set<IPath> resources) {
for (IPath resource : resources) {
- Set<String> resourceNames = variableNamesByResource.get(resource);
- if(resourceNames!=null) {
- for (String name : resourceNames) {
- Set<IPath> linkedResources = resourcesByVariableName.get(name);
- if(linkedResources!=null) {
- linkedResources.remove(resource);
- if(linkedResources.isEmpty()) {
- resourcesByVariableName.remove(name);
- }
+ removeLinkedResource(resource);
+ }
+ }
+
+ /**
+ * Removes link between resource and variable names.
+ * @param linkedResources
+ */
+ public void removeLinkedResource(IPath resource) {
+ Set<String> resourceNames = variableNamesByResource.get(resource);
+ if(resourceNames!=null) {
+ for (String name : resourceNames) {
+ Set<IPath> linkedResources = resourcesByVariableName.get(name);
+ if(linkedResources!=null) {
+ linkedResources.remove(resource);
+ if(linkedResources.isEmpty()) {
+ resourcesByVariableName.remove(name);
}
}
}
- variableNamesByResource.remove(resource);
}
+ variableNamesByResource.remove(resource);
}
public Set<IPath> getResourcesByVariableName(String variableName) {
16 years, 9 months
JBoss Tools SVN: r5804 - in trunk/hibernatetools/plugins/org.hibernate.eclipse: src/org/hibernate/console and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-18 09:16:08 -0500 (Fri, 18 Jan 2008)
New Revision: 5804
Added:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentEl.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentElImpl.java
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1422
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2008-01-18 14:10:35 UTC (rev 5803)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/META-INF/MANIFEST.MF 2008-01-18 14:16:08 UTC (rev 5804)
@@ -278,6 +278,7 @@
org.hibernate.connection,
org.hibernate.console,
org.hibernate.console.execution,
+ org.hibernate.console.model,
org.hibernate.console.node,
org.hibernate.console.preferences,
org.hibernate.context,
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2008-01-18 14:10:35 UTC (rev 5803)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2008-01-18 14:16:08 UTC (rev 5804)
@@ -55,6 +55,7 @@
import org.hibernate.console.execution.ExecutionContext;
import org.hibernate.console.execution.ExecutionContextHolder;
import org.hibernate.console.execution.ExecutionContext.Command;
+import org.hibernate.console.model.IParentElImpl;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences;
import org.hibernate.console.preferences.ConsoleConfigurationPreferences.ConfigurationMode;
import org.hibernate.util.ConfigHelper;
@@ -65,7 +66,7 @@
import org.xml.sax.EntityResolver;
import org.xml.sax.InputSource;
-public class ConsoleConfiguration implements ExecutionContextHolder {
+public class ConsoleConfiguration extends IParentElImpl implements ExecutionContextHolder {
private ExecutionContext executionContext;
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2008-01-18 14:10:35 UTC (rev 5803)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2008-01-18 14:16:08 UTC (rev 5804)
@@ -51,6 +51,7 @@
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
import org.hibernate.SessionFactory;
+import org.hibernate.console.model.IParentEl;
import org.hibernate.console.node.BaseNode;
import org.hibernate.console.node.ConfigurationListNode;
import org.hibernate.eclipse.HibernatePlugin;
@@ -62,7 +63,7 @@
* This class keeps track of the Hibernate Configurations that are known to
* the Hibernate Console plugin.
*/
-public class KnownConfigurations {
+public class KnownConfigurations implements IParentEl {
// TODO: is the best way for the querypage model ?
private QueryPageModel queryPages = new QueryPageModel();
@@ -345,7 +346,43 @@
public List getQueryParameterList() {
return queryParameters;
+ }
+
+ public Object[] getChildren() {
+ return getConfigurationsSortedByName();
+ }
+
+ public boolean hasChildren() {
+ if (null == configurations) {
+ return true;
+ }
+ return( configurations.size() > 0 );
}
+
+ public void setChildren(Object[] children) {
+ for (int i = 0; i < children.length; i++) {
+ if (!(children[i] instanceof ConsoleConfiguration)) {
+ continue;
+ }
+ ConsoleConfiguration configuration = (ConsoleConfiguration)children[i];
+ addConfiguration(configuration, true);
+ }
+ }
+
+ public void addChild(Object child) {
+ if (!(child instanceof ConsoleConfiguration)) {
+ return;
+ }
+ ConsoleConfiguration configuration = (ConsoleConfiguration)child;
+ addConfiguration(configuration, true);
+ }
+
+ public void removeChild(Object child) {
+ if (!(child instanceof ConsoleConfiguration)) {
+ return;
+ }
+ ConsoleConfiguration configuration = (ConsoleConfiguration)child;
+ removeConfiguration(configuration, true);
+ }
-
}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentEl.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentEl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentEl.java 2008-01-18 14:16:08 UTC (rev 5804)
@@ -0,0 +1,29 @@
+package org.hibernate.console.model;
+
+/**
+ * Common protocol for elements that contain other elements.
+ */
+public interface IParentEl {
+ /**
+ * Returns the immediate children of this element.
+ * Unless otherwise specified by the implementing element,
+ * the children are in no particular order.
+ *
+ * @return the immediate children of this element
+ */
+ Object[] getChildren();
+ /**
+ * Returns whether this element has one or more immediate children.
+ * This is a convenience method, and may be more efficient than
+ * testing whether <code>getChildren</code> is an empty array.
+ *
+ * @return true if the immediate children of this element, false otherwise
+ */
+ boolean hasChildren();
+ //
+ void setChildren(Object[] children);
+ //
+ void addChild(Object child);
+ //
+ void removeChild(Object child);
+}
Added: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentElImpl.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentElImpl.java (rev 0)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/model/IParentElImpl.java 2008-01-18 14:16:08 UTC (rev 5804)
@@ -0,0 +1,42 @@
+package org.hibernate.console.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class IParentElImpl implements IParentEl {
+
+ private List children = null;
+
+ public Object[] getChildren() {
+ if (null == children) {
+ return null;
+ }
+ return children.toArray();
+ }
+
+ public boolean hasChildren() {
+ if (null == children) {
+ return true;
+ }
+ return( children.size() > 0 );
+ }
+
+ public void setChildren(Object[] children) {
+ if (null == children || 0 == children.length) {
+ return;
+ }
+ this.children = new ArrayList(children.length);
+ for (int i = 0; i < children.length; i++) {
+ this.children.add(children[i]);
+ }
+ }
+
+ public void addChild(Object child) {
+ this.children.add(child);
+ }
+
+ public void removeChild(Object child) {
+ this.children.remove(child);
+ }
+
+}
16 years, 9 months
JBoss Tools SVN: r5803 - trunk/common/plugins/org.jboss.tools.common.model/resources/help.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-01-18 09:10:35 -0500 (Fri, 18 Jan 2008)
New Revision: 5803
Modified:
trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
Log:
JBIDE-1651
Modified: trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2008-01-18 14:05:32 UTC (rev 5802)
+++ trunk/common/plugins/org.jboss.tools.common.model/resources/help/keys-model.properties 2008-01-18 14:10:35 UTC (rev 5803)
@@ -146,10 +146,12 @@
FileFolder_CreateFileJSP=/model/CreateFile.html
FileFolder_CreateFileJSP.WindowTitle=New File JSP
FileFolder_CreateFileJSP.Title=File JSP
+FileFolder_CreateFileJSP_1.Title=Select Tag Libraries
FileSystemFolder_CreateFileJSP=/model/CreateFile.html
FileSystemFolder_CreateFileJSP.WindowTitle=New File JSP
FileSystemFolder_CreateFileJSP.Title=File JSP
+FileSystemFolder_CreateFileJSP_1.Title=Select Tag Libraries
##### File XHTML #####
@@ -163,10 +165,12 @@
FileFolder_CreateFileXHTML=/model/CreateFile.html
FileFolder_CreateFileXHTML.WindowTitle=New File XHTML
FileFolder_CreateFileXHTML.Title=File XHTML
+FileFolder_CreateFileXHTML_1.Title=Select Tag Libraries
FileSystemFolder_CreateFileXHTML=/model/CreateFile.html
FileSystemFolder_CreateFileXHTML.WindowTitle=New File XHTML
FileSystemFolder_CreateFileXHTML.Title=File XHTML
+FileSystemFolder_CreateFileXHTML_1.Title=Select Tag Libraries
##### File HTML #####
FileHTML=/model/FileHTML.html
16 years, 9 months
JBoss Tools SVN: r5802 - trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-01-18 09:05:32 -0500 (Fri, 18 Jan 2008)
New Revision: 5802
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
Log:
Fix http://jira.jboss.com/jira/browse/JBIDE-1653
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2008-01-18 13:09:48 UTC (rev 5801)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2008-01-18 14:05:32 UTC (rev 5802)
@@ -106,7 +106,7 @@
configuration = buildWith(null, true);
}
- private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties, String entityResolver) {
+ private Configuration buildJPAConfiguration(String persistenceUnit, Properties properties, String entityResolver, boolean includeMappings) {
if(StringHelper.isEmpty( persistenceUnit )) {
persistenceUnit = null;
}
@@ -118,6 +118,10 @@
if(StringHelper.isNotEmpty( prefs.getNamingStrategy())) {
overrides.put( "hibernate.ejb.naming_strategy", prefs.getNamingStrategy() );
}
+
+ if(!includeMappings) {
+ overrides.put( "hibernate.archive.autodetection", "none" );
+ }
Class clazz = ReflectHelper.classForName("org.hibernate.ejb.Ejb3Configuration", ConsoleConfiguration.class);
Object ejb3cfg = clazz.newInstance();
@@ -493,7 +497,7 @@
}
} else if(prefs.getConfigurationMode().equals( ConfigurationMode.JPA )) {
try {
- localCfg = buildJPAConfiguration( getPreferences().getPersistenceUnitName(), properties, prefs.getEntityResolverName() );
+ localCfg = buildJPAConfiguration( getPreferences().getPersistenceUnitName(), properties, prefs.getEntityResolverName(), includeMappings );
}
catch (Exception e) {
throw new HibernateConsoleRuntimeException("Could not load JPA Configuration",e);
16 years, 9 months
JBoss Tools SVN: r5801 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-01-18 08:09:48 -0500 (Fri, 18 Jan 2008)
New Revision: 5801
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1479, VpeController.notifyChanged was changed to start in UIJob and patch which prevent flooding JOB was also applied. The root problem was that when we trying notify DOM throw mozilla interfaces in no UI thread we have EXCEPTION_ACCESS_VIOLATION. Another way to fix EXCEPTION_ACCESS_VIOLATION except run (DOM changes) it in ui thread i haven't founded.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-01-18 13:05:20 UTC (rev 5800)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-01-18 13:09:48 UTC (rev 5801)
@@ -16,6 +16,9 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuListener;
@@ -52,6 +55,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.ui.actions.ActionFactory;
+import org.eclipse.ui.progress.UIJob;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
import org.eclipse.wst.sse.core.internal.model.ModelLifecycleEvent;
import org.eclipse.wst.sse.core.internal.provisional.IModelLifecycleListener;
@@ -184,6 +188,8 @@
private VpeVisualInnerDragInfo innerDragInfo = null;
private FormatControllerManager toolbarFormatControllerManager = null;
private SelectionBar selectionBar = null;
+ //Added by Max Areshkau Fix for JBIDE-1479
+ private UIJob job = null;
Shell tip;
public final static String MODEL_FLAVOR = ModelTransfer.MODEL; //$NON-NLS-1$
@@ -322,8 +328,29 @@
public boolean isAdapterForType(Object type) {
return type == this;
}
+ //FIX Fox JBIDE-1479 added by Max Areshkau
+ public void notifyChanged(final INodeNotifier notifier, final int eventType,final Object feature,final Object oldValue,final Object newValue, final int pos) {
- public void notifyChanged(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int pos) {
+ if(job!=null) {
+ job.cancel();
+ }
+
+ job = new UIJob("NotifyChangedJob"){
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+ //we checks is job was canceled and if is it true we cancel job
+ if(monitor.isCanceled()) {
+ return Status.CANCEL_STATUS;
+ } else {
+ notifyChangedInUiThread(notifier, eventType, feature, oldValue, newValue, pos);
+ }
+ return Status.OK_STATUS;
+ }};
+ job.setPriority(Job.LONG);
+ job.schedule(1000L);
+ }
+
+ public void notifyChangedInUiThread(INodeNotifier notifier, int eventType, Object feature, Object oldValue, Object newValue, int pos) {
if (!switcher.startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
return;
}
@@ -381,7 +408,6 @@
visualBuilder.setSelectionRectangle(null);
visualBuilder.updateNode((Node)notifier);
break;
-
case INodeNotifier.CONTENT_CHANGED:
if (!sourceChangeFlag) {
if (feature != null && ((Node)feature).getNodeType() == Node.TEXT_NODE) {
@@ -2262,7 +2288,7 @@
*/
public void onRefresh() {
//when we using separate thread to display selection rectangle
- //it's working more better than without
+ //it's working better than without
/*
* HACK
* We need wait some time while standart event will be handled
@@ -2270,13 +2296,14 @@
* and flasher are not repainted, so we should paint flasher
*/
- Display.getDefault().asyncExec(new Thread(){
- public void run(){
-
- getXulRunnerEditor().showSelectionRectangle();
- }
- });
+ Display.getDefault().asyncExec(new Thread(){
+ public void run(){
+
+ getXulRunnerEditor().showSelectionRectangle();
+ }
+ });
+
}
/**
16 years, 9 months
JBoss Tools SVN: r5800 - trunk/vpe/plugins/org.jboss.tools.vpe/templates.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-01-18 08:05:20 -0500 (Fri, 18 Jan 2008)
New Revision: 5800
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-myfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-1640
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-myfaces.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-myfaces.xml 2008-01-18 12:35:43 UTC (rev 5799)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/templates/vpe-templates-myfaces.xml 2008-01-18 13:05:20 UTC (rev 5800)
@@ -442,10 +442,71 @@
</vpe:dnd>
</vpe:template>
</vpe:if>
+ <vpe:if test="@popupCalendar='true'">
+ <vpe:template children="yes" modify="no">
+ <div class="{@styleClass}" style="{@style}" size="{@size}"
+ title="{tagstring()}">
+ <input type="text" size="2" value="{jsfvalue(@value)}" />
+ <select title="{tagstring()}" disabled="true">
+ <option value ="{jsfvalue(@value)}">
+ <vpe:value expr="{jsfvalue(@value)}" />
+ </option>
+ </select>
+ <input type="text" size="4" value="{jsfvalue(@value)}" />
+ <input type="button" size="3" value="..." />
+ <table>
+ <tr class="{@monthYearRowClass}">
+ <td><a href="#"><</a></td><td colspan="5">December 2005</td><td><a href="#">></a></td></tr>
+ <tr class="{@weekRowClass}">
+ <td>Sun</td><td>Mon</td><td>Tue</td><td>Wed</td><td>Thu</td><td>Fri</td><td>Sat</td></tr>
+ <tr>
+ <td></td><td></td><td></td><td></td><td><a href="#">1</a></td><td><a href="#">2</a></td><td><a href="#">3</a></td></tr>
+ <tr>
+ <td><a href="#">4</a></td><td><a href="#">5</a></td><td><a href="#">6</a></td><td><a href="#">7</a></td><td><a href="#">8</a></td><td><a href="#">9</a></td><td><a href="#">10</a></td></tr>
+ <tr>
+ <td><a href="#">11</a></td><td><a href="#">12</a></td><td><a href="#">13</a></td><td><a href="#">14</a></td><td><a href="#">15</a></td><td><a href="#">16</a></td><td><a href="#">17</a></td></tr>
+ <tr>
+ <td><a href="#">18</a></td><td><a href="#">19</a></td><td><a href="#">20</a></td><td><a href="#">21</a></td><td><a href="#">22</a></td><td><a href="#">23</a></td><td><a href="#">24</a></td></tr>
+ <tr>
+ <td><a href="#">25</a></td><td><a href="#">26</a></td><td><a href="#">27</a></td><td><a href="#">28</a></td><td><a href="#">29</a></td><td><a href="#">30</a></td><td class="{@currentDayCellClass}"><a href="#">31</a></td></tr>
+ </table>
+ </div>
+ <vpe:textFormating>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BoldFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ItalicFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontNameFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="FontSizeFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="BackgroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ <vpe:format type="ForegroundColorFormat">
+ <vpe:formatAttribute type="style" />
+ </vpe:format>
+ </vpe:textFormating>
+ </vpe:template>
+ </vpe:if>
<vpe:template children="no" modify="no">
<div class="{@styleClass}" style="{@style}" size="{@size}"
title="{tagstring()}">
- <vpe:value expr="{jsfvalue(@value)}" />
+
+ <input type="text" size="2" value="{jsfvalue(@value)}" />
+ <select title="{tagstring()}" disabled="true">
+ <option value ="{jsfvalue(@value)}">
+ <vpe:value expr="{jsfvalue(@value)}" />
+ </option>
+ </select>
+ <input type="text" size="4" value="{jsfvalue(@value)}" />
</div>
<vpe:textFormating>
<vpe:format type="UnderlineFormat">
16 years, 9 months
JBoss Tools SVN: r5799 - trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2008-01-18 07:35:43 -0500 (Fri, 18 Jan 2008)
New Revision: 5799
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/CreateJSPFileSupport.java
Log:
JBIDE-1650
Modified: trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/CreateJSPFileSupport.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/CreateJSPFileSupport.java 2008-01-18 12:04:24 UTC (rev 5798)
+++ trunk/jst/plugins/org.jboss.tools.jst.web/src/org/jboss/tools/jst/web/model/handlers/CreateJSPFileSupport.java 2008-01-18 12:35:43 UTC (rev 5799)
@@ -13,12 +13,21 @@
import java.io.File;
import java.util.*;
import org.jboss.tools.common.meta.action.impl.WizardDataValidator;
+import org.jboss.tools.common.model.XModel;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.files.handlers.*;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
+import org.jboss.tools.common.model.util.ClassLoaderUtil;
import org.jboss.tools.jst.web.WebModelPlugin;
+import org.jboss.tools.jst.web.model.helpers.WebAppHelper;
+import org.jboss.tools.jst.web.project.WebProject;
+import org.jboss.tools.jst.web.tld.TaglibMapping;
public class CreateJSPFileSupport extends CreateFileSupport {
+ static {
+ ClassLoaderUtil.init();
+ }
+
protected Map<String,File> templates = new TreeMap<String,File>();
TaglibSet taglibs;
@@ -147,7 +156,14 @@
} else {
return;
}
- taglibs.initTaglibDescriptions(getTarget().getModel());
+ XModel model = getTarget().getModel();
+ XModelObject web = WebAppHelper.getWebApp(model);
+ if(web != null) {
+ TaglibMapping m = WebProject.getInstance(model).getTaglibMapping();
+ if(m != null) m.revalidate(web);
+ }
+
+ taglibs.initTaglibDescriptions(model);
String[] s = taglibs.getDescriptions();
setValueList(1, "taglibs", s);
}
16 years, 9 months
JBoss Tools SVN: r5798 - in trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test: mappingproject and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-18 07:04:24 -0500 (Fri, 18 Jan 2008)
New Revision: 5798
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1649
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java 2008-01-18 11:36:35 UTC (rev 5797)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/OpenMappingTests.java 2008-01-18 12:04:24 UTC (rev 5798)
@@ -61,6 +61,7 @@
Iterator properties = type.getPropertyIterator();
while (properties.hasNext()) {
Property prop = (Property) properties.next();
+ if (prop.getClass() != Property.class) continue;
assertNotNull(OpenMappingAction.findSelection(prop, findAdapter));
}
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-01-18 11:36:35 UTC (rev 5797)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingFileTest.java 2008-01-18 12:04:24 UTC (rev 5798)
@@ -24,7 +24,10 @@
import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.PropertyWorkbenchAdapter;
import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
/**
* @author Dmitry Geraskov
@@ -39,6 +42,7 @@
consCFG.reset();
Object[] configs = null;
Object[] persClasses = null;
+ Object[] props = null;
try {
configs = new ConsoleConfigurationWorkbenchAdapter().getChildren(consCFG);
assertTrue(configs[0] instanceof Configuration);
@@ -51,22 +55,64 @@
for (int i = 0; i < persClasses.length; i++) {
assertTrue(persClasses[0] instanceof PersistentClass);
PersistentClass persClass = (PersistentClass) persClasses[i];
- IEditorPart editor = null;
- Throwable ex = null;
- try {
- editor = OpenMappingAction.run(persClass, consCFG);
- } catch (PartInitException e) {
- ex = e;
- } catch (JavaModelException e) {
- ex = e;
- } catch (FileNotFoundException e) {
- ex = e;
- }
- if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping file for " + persClass.getClassName()
- + " not opened:\n" + ex.getMessage());
+ openTest(persClass, consCFG);
+ props = new PersistentClassWorkbenchAdapter().getChildren(persClass);
+ for (int j = 0; j < props.length; j++) {
+ if (props.getClass() != Property.class) continue;
+ openTest(props[j], consCFG);
+ Object[] compProperties = new PropertyWorkbenchAdapter().getChildren(props[j]);
+ for (int k = 0; k < compProperties.length; k++) {
+ //test Composite properties
+ if (compProperties[k].getClass() != Property.class) continue;
+ openPropertyTest((Property) props[j], (Property)compProperties[k], consCFG);
+ }
+ }
}
}
//close all editors
}
+
+ private void openPropertyTest(Property compositeProperty, Property parentProperty, ConsoleConfiguration consCFG){
+ IEditorPart editor = null;
+ Throwable ex = null;
+ try {
+ editor = OpenMappingAction.run(compositeProperty, parentProperty, consCFG);
+ Object[] compProperties = new PropertyWorkbenchAdapter().getChildren(compositeProperty);
+ for (int k = 0; k < compProperties.length; k++) {
+ //test Composite properties
+ assertTrue(compProperties[k] instanceof Property);
+ // use only first level to time safe
+ //openPropertyTest((Property)compProperties[k], compositeProperty, consCFG);
+ }
+ } catch (PartInitException e) {
+ ex = e;
+ } catch (JavaModelException e) {
+ ex = e;
+ } catch (FileNotFoundException e) {
+ ex = e;
+ }
+ if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
+ if (ex != null) fail("Mapping file for " + compositeProperty.getNodeName()
+ + " not opened:\n" + ex.getMessage());
+ }
+
+ private void openTest(Object selection, ConsoleConfiguration consCFG){
+ IEditorPart editor = null;
+ Throwable ex = null;
+ try {
+ editor = OpenMappingAction.run(selection, consCFG);
+ //checkSelectionMade(editor);
+ } catch (PartInitException e) {
+ ex = e;
+ } catch (JavaModelException e) {
+ ex = e;
+ } catch (FileNotFoundException e) {
+ ex = e;
+ }
+ if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
+ if (ex != null) fail("Mapping file for " + selection/*.getClassName()*/
+ + " not opened:\n" + ex.getMessage());
+ }
+
+
}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2008-01-18 11:36:35 UTC (rev 5797)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenSourceFileTest.java 2008-01-18 12:04:24 UTC (rev 5798)
@@ -21,10 +21,15 @@
import org.hibernate.cfg.Configuration;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.actions.OpenMappingAction;
import org.hibernate.eclipse.console.actions.OpenSourceAction;
import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.PersistentClassWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.PropertyWorkbenchAdapter;
+import org.hibernate.mapping.Component;
import org.hibernate.mapping.PersistentClass;
+import org.hibernate.mapping.Property;
/**
* @author Dmitry Geraskov
@@ -40,6 +45,7 @@
consCFG.reset();
Object[] configs = null;
Object[] persClasses = null;
+ Object[] fields = null;
try {
configs = new ConsoleConfigurationWorkbenchAdapter().getChildren(consCFG);
assertTrue(configs[0] instanceof Configuration);
@@ -52,26 +58,51 @@
for (int i = 0; i < persClasses.length; i++) {
assertTrue(persClasses[0] instanceof PersistentClass);
PersistentClass persClass = (PersistentClass) persClasses[i];
- IEditorPart editor = null;
- Throwable ex = null;
- try {
- editor = new OpenSourceAction().run(persClass, MappingTestProject.getTestProject().getIJavaProject(),
- persClass.getClassName());
- } catch (PartInitException e) {
- ex = e;
- } catch (JavaModelException e) {
- ex = e;
- } catch (FileNotFoundException e) {
- ex = e;
- }
- if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Source file for " + persClass.getClassName()
- + " not opened:\n" + ex.getMessage());
- }
+ String fullyQualifiedName = persClass.getClassName();
+ // test PersistentClasses
+ openTest(persClass, consCFG, fullyQualifiedName);
+ fields = new PersistentClassWorkbenchAdapter().getChildren(persClass);
+ for (int j = 0; j < fields.length; j++) {
+ if (fields[j].getClass() != Property.class) continue;
+ fullyQualifiedName = persClass.getClassName();
+ // test Properties
+ openTest(fields[j], consCFG, fullyQualifiedName);
+ if (fields[j] instanceof Property
+ && ((Property)fields[j]).isComposite()) {
+ fullyQualifiedName =((Component)((Property) fields[j]).getValue()).getComponentClassName();
+
+ Object[] compProperties = new PropertyWorkbenchAdapter().getChildren(fields[j]);
+ for (int k = 0; k < compProperties.length; k++) {
+ if (compProperties[k].getClass() != Property.class) continue;
+ //test Composite properties
+ openTest(compProperties[k], consCFG, fullyQualifiedName);
+ }
+ }
+ }
+ }
}
//close all editors
}
+
+ private void openTest(Object selection, ConsoleConfiguration consCFG, String fullyQualifiedName){
+ IEditorPart editor = null;
+ Throwable ex = null;
+ try {
+ editor = new OpenSourceAction().run(selection, MappingTestProject.getTestProject().getIJavaProject(),
+ fullyQualifiedName);
+ } catch (PartInitException e) {
+ ex = e;
+ } catch (JavaModelException e) {
+ ex = e;
+ } catch (FileNotFoundException e) {
+ ex = e;
+ }
+ if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
+ if (ex != null) fail("Mapping file for " + fullyQualifiedName/*.getClassName()*/
+ + " not opened:\n" + ex.getMessage());
+ }
+
}
16 years, 9 months