JBoss Tools SVN: r5797 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-18 06:36:35 -0500 (Fri, 18 Jan 2008)
New Revision: 5797
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1649
"instance of" changed to getClass = Property.class
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java 2008-01-18 11:36:30 UTC (rev 5796)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.ui.veditor/src/org/jboss/tools/hibernate/ui/veditor/editors/popup/PopupMenuProvider.java 2008-01-18 11:36:35 UTC (rev 5797)
@@ -60,7 +60,7 @@
Shape shape = (Shape)obj;
Object first = shape.getOrmElement();
if (first instanceof PersistentClass
- || first instanceof Property
+ || first.getClass() == Property.class
|| first instanceof Table
|| first instanceof Column){
action = getActionRegistry().getAction(OpenSourceAction.ACTION_ID);
16 years, 9 months
JBoss Tools SVN: r5796 - in trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console: views and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-18 06:36:30 -0500 (Fri, 18 Jan 2008)
New Revision: 5796
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1649
"instance of" changed to getClass = Property.class
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-01-18 11:19:11 UTC (rev 5795)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-01-18 11:36:30 UTC (rev 5796)
@@ -77,7 +77,7 @@
}
public static void run(TreePath path, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException {
- boolean isPropertySel = (path.getLastSegment() instanceof Property);
+ boolean isPropertySel = (path.getLastSegment().getClass() == Property.class);
if (isPropertySel){
Property propertySel = (Property)path.getLastSegment();
PersistentClass persClass = propertySel.getPersistentClass();
@@ -153,8 +153,8 @@
* @throws FileNotFoundException
* @throws BadLocationException
*/
- public static boolean run(Property compositeProperty, Property parentProperty, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException{
- if (parentProperty.getPersistentClass() == null) return false;
+ public static IEditorPart run(Property compositeProperty, Property parentProperty, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException{
+ if (parentProperty.getPersistentClass() == null) return null;
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
IResource resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, parentProperty.getPersistentClass());
@@ -164,7 +164,7 @@
editorPart = openMapping(resource);
if (editorPart != null){
ITextEditor[] textEditors = getTextEditors(editorPart);
- if (textEditors.length == 0) return false;
+ if (textEditors.length == 0) return editorPart;
textEditors[0].selectAndReveal(0, 0);
FindReplaceDocumentAdapter findAdapter = null;
ITextEditor textEditor = null;
@@ -172,22 +172,36 @@
textEditor = textEditors[i];
findAdapter = getFindDocAdapter(textEditor);
}
- if (findAdapter == null) return false;
+ if (findAdapter == null) return null;
IRegion parentRegion = findSelection(parentProperty, findAdapter);
- if (parentRegion == null) return false;
+ if (parentRegion == null) return editorPart;
IRegion propRegion = null;
try {
propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), generatePattern(compositeProperty), true, true, false, true);
+ if (propRegion == null){
+ // try to use key-property
+ String pattern = generatePattern(compositeProperty).replaceFirst("property", "key-property");
+ propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), pattern, true, true, false, true);
+ }
+ /*if (propRegion == null){
+ // try to find name = "<name>"
+ String pattern = HIBERNATE_TAG_NAME + "[\\s]*=[\\s]*\"" + property.getNodeName() + '\"';
+ propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), pattern, true, true, false, true);
+ }*/
} catch (BadLocationException e) {
HibernateConsolePlugin.getDefault().logErrorMessage("Selection not found.", e);
- }
+ }
+
if (propRegion != null){
+ int length = compositeProperty.getNodeName().length();
+ int offset = propRegion.getOffset() + propRegion.getLength() - length - 1;
+ propRegion = new Region(offset, length);
textEditor.selectAndReveal(propRegion.getOffset(), propRegion.getLength());
- return true;
+ return editorPart;
}
}
- return false;
+ return editorPart;
}
if (parentProperty.getPersistentClass() != null && parentProperty.isComposite()){
@@ -195,10 +209,13 @@
if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
String fullyQualifiedName =((Component)((Property) parentProperty).getValue()).getComponentClassName();
IEditorPart editor = new OpenSourceAction().run(compositeProperty, proj, fullyQualifiedName);
- if (editor != null) return true;
+ return editor;
}
}
- return false;
+ if (editorPart == null) {
+ throw new FileNotFoundException("Mapping file for property '" + compositeProperty.getNodeName() + "' not found.");
+ }
+ return null;
}
/**
@@ -369,7 +386,11 @@
StringBuffer pattern = new StringBuffer("<");
if(property.getPersistentClass() != null &&
property.getPersistentClass().getIdentifierProperty()==property) {
- pattern.append("id");
+ if (property.isComposite()){
+ pattern.append("composite-id");
+ } else {
+ pattern.append("id");
+ }
} else{
pattern.append(tool.getTag(property));
}
@@ -387,7 +408,7 @@
* @param editorPart
* @return
*/
- private static ITextEditor[] getTextEditors(IEditorPart editorPart) {
+ public static ITextEditor[] getTextEditors(IEditorPart editorPart) {
/*
* if EditorPart is MultiPageEditorPart then get ITextEditor from it.
*/
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-01-18 11:19:11 UTC (rev 5795)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenSourceAction.java 2008-01-18 11:36:30 UTC (rev 5796)
@@ -53,15 +53,18 @@
ConsoleConfiguration consoleConfiguration = (ConsoleConfiguration)(path.getSegment(0));
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
- String fullyQualifiedName = persClass.getClassName();
- if (fullyQualifiedName.length() == 0
- && lastSegment instanceof Property){
+ String fullyQualifiedName = null;
+ if (lastSegment instanceof Property){
Object prevSegment = path.getParentPath().getLastSegment();
if (prevSegment instanceof Property
&& ((Property)prevSegment).isComposite()){
fullyQualifiedName =((Component)((Property) prevSegment).getValue()).getComponentClassName();
}
}
+ if (fullyQualifiedName == null && persClass != null){
+ fullyQualifiedName = persClass.getClassName();
+ }
+
try {
run(lastSegment, proj, fullyQualifiedName);
} catch (JavaModelException e) {
@@ -84,8 +87,23 @@
*/
public IEditorPart run(Object selection, IJavaProject proj,
String fullyQualifiedName) throws JavaModelException, PartInitException, FileNotFoundException {
+ if (fullyQualifiedName == null) return null;
+ String remainder = null;
+ IType type = null;
+ if (fullyQualifiedName.indexOf("$") > 0) {
+ remainder = fullyQualifiedName.substring(fullyQualifiedName.indexOf("$") + 1);
+ fullyQualifiedName = fullyQualifiedName.substring(0, fullyQualifiedName.indexOf("$"));
+ type = proj.findType(fullyQualifiedName);
+ while ( remainder.indexOf("$") > 0 ){
+ String subtype = remainder.substring(0, fullyQualifiedName.indexOf("$"));
+ type = type.getType(subtype);
+ remainder = remainder.substring(fullyQualifiedName.indexOf("$") + 1);
+ }
+ type = type.getType(remainder);
+ } else {
+ type = proj.findType(fullyQualifiedName);
+ }
IResource resource = null;
- IType type = proj.findType(fullyQualifiedName);
if (type != null) resource = type.getResource();
IEditorPart editorPart = null;
@@ -126,4 +144,5 @@
}
}
+
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2008-01-18 11:19:11 UTC (rev 5795)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/views/ConfigurationsViewActionGroup.java 2008-01-18 11:36:30 UTC (rev 5796)
@@ -139,7 +139,7 @@
}
menu.add(new Separator() );
if (first instanceof PersistentClass
- || first instanceof Property){
+ || first.getClass() == Property.class){
menu.add(openSourceAction);
menu.add(openMappingAction);
}
16 years, 9 months
JBoss Tools SVN: r5795 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-01-18 06:19:11 -0500 (Fri, 18 Jan 2008)
New Revision: 5795
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java
Log:
JBIDE-1648 Content Assist falls with NullPointerException
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java 2008-01-18 10:56:03 UTC (rev 5794)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java 2008-01-18 11:19:11 UTC (rev 5795)
@@ -550,7 +550,7 @@
*/
public IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, pos);
- ITextRegion region = sdRegion.getRegionAtCharacterOffset(pos);
+ ITextRegion region = (sdRegion == null ? null : sdRegion.getRegionAtCharacterOffset(pos));
if (region == null) {
return null;
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java 2008-01-18 10:56:03 UTC (rev 5794)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatJSPContentAssistProcessor.java 2008-01-18 11:19:11 UTC (rev 5795)
@@ -629,7 +629,7 @@
*/
public IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
IStructuredDocumentRegion sdRegion = ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, pos);
- ITextRegion region = sdRegion.getRegionAtCharacterOffset(pos);
+ ITextRegion region = (sdRegion == null ? null : sdRegion.getRegionAtCharacterOffset(pos));
if (region == null) {
return null;
}
16 years, 9 months
JBoss Tools SVN: r5794 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-01-18 05:56:03 -0500 (Fri, 18 Jan 2008)
New Revision: 5794
Modified:
trunk/as/docs/reference/en/modules/perspective.xml
trunk/as/docs/reference/en/modules/runtimes_servers.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-199 - making some changes according to the task
Modified: trunk/as/docs/reference/en/modules/perspective.xml
===================================================================
--- trunk/as/docs/reference/en/modules/perspective.xml 2008-01-18 10:55:23 UTC (rev 5793)
+++ trunk/as/docs/reference/en/modules/perspective.xml 2008-01-18 10:56:03 UTC (rev 5794)
@@ -19,12 +19,13 @@
contains a few additional views. Two of the additional views are standard views,
specifically the <property>Console </property> view and the <property>Properties</property>
view. The other two views that are added are the <property>Project archives</property> view
- and the <property>JBoss Servers View</property>.</para>
+ and the <property>JBoss Servers View</property>. </para>
<section id="JBossServerView">
<?dbhtml filename="JBossServerView.html"?>
<title>The JBoss Servers View</title>
- <para>This chapter will focus on the the JBoss Server's View. The JBoss Servers View is
+ <para>This chapter will focus on the the JBoss Server's View. </para>
+ <para>The JBoss Servers View is
based on the WTP view, Servers View. The top half of the JBoss Servers View essentially
embeds the original Servers View directly into it, making slight changes to the context
menu. A second half was added to provide additional information about the server
@@ -265,7 +266,7 @@
<para>Delete</para>
</entry>
<entry>
- <para>Standard option that allows to delete any existing server.</para>
+ <para>Standard option that allows to delete the chosen server.</para>
</entry>
</row>
Modified: trunk/as/docs/reference/en/modules/runtimes_servers.xml
===================================================================
--- trunk/as/docs/reference/en/modules/runtimes_servers.xml 2008-01-18 10:55:23 UTC (rev 5793)
+++ trunk/as/docs/reference/en/modules/runtimes_servers.xml 2008-01-18 10:56:03 UTC (rev 5794)
@@ -56,8 +56,8 @@
</mediaobject>
</figure>
<para>From this preference page you can see all declared runtimes and their types as well.
- Figure above shows two declared runtimes that include a JBoss 4.2 instance. Here, it's possible to edit or remove existing runtimes as well as add a new
- one.</para>
+ Figure above shows two declared runtimes that include a JBoss 4.2 instance. Here,
+ it's possible to edit or remove existing runtimes as well as add a new one.</para>
<para>To create a JBoss runtime click <emphasis>
<property>Add</property>
@@ -83,7 +83,7 @@
directory for users who don't wish to make use of starting, stopping, or debugging their
projects inside eclipse.</para>
- <figure>
+ <figure id="add_runtime_figure">
<title>Adding a JBoss 4.2 Runtime</title>
<mediaobject>
<imageobject>
@@ -92,7 +92,7 @@
</mediaobject>
</figure>
- <para>The following table describe all the available options of the wizard.</para>
+ <para>The following table describes all the available options of the wizard.</para>
<table>
<title>Server Runtime Wizard Parameters</title>
<tgroup cols="2">
@@ -139,7 +139,7 @@
<entry>
<para>The proper Java Runtime Environment. Because of the open-source nature of
JBoss, a user is likely to want to modify and repackage some of the
- configuration-specific jboss jars and create their own configuration. Thus, ruthe
+ configuration-specific jboss jars and create their own configuration. Thus, rather
than forcing the user to copy his entire JBoss installation, the structure of the
wizard allows to create only a new configuration instead.</para>
</entry>
@@ -196,7 +196,7 @@
</section>
<section>
- <title>WTP Servers</title>
+ <title>Servers</title>
<para>WTP servers are eclipse-representations of a backing server installation. They are used to
start or stop servers, deploy to servers, or debug code that will run on the server. They keep
track of the modules (jars, wars, etc) you deploy to the server and also allow you to undeploy
@@ -222,18 +222,19 @@
or stopping, and runtimes keep track of the location of the installation. Thus, each server
instance must be backed by an appropriate runtime. </para>
- <para>The combo box below the view lets you select which runtime to use from the list of
- already declared. If there is no runtime that match your needs just press <emphasis>
+ <para>From the list of already declared runtimes in the combo box below the view it's
+ possible to select which runtime you want your server to be backed by. If there is no
+ runtime that matches your needs just press <emphasis>
<property>Installed Runtimes... </property>
- </emphasis> to bring up the familiar <link linkend="InstNewRuntime">preference page</link>.
- Here, it becomes possible to edit already existing runtime or add a new one with necessary
- configuration.</para>
+ </emphasis> to bring up the familiar preference page like in <link linkend="InstNewRuntime">
+ the previous section</link>. Here, it becomes possible to edit already existing runtime or
+ add a new one with necessary configuration.</para>
<!--para>Because there may be many runtimes of each type declared, the wizard allows you to
select which runtime you want your server to be backed by. The combo box below the view lets
you select which declared runtime to use. For example, if there were already multiple JBoss
4.2 runtimes declared, the combo box would list all of the 4.2 runtimes available. </para-->
-
+
<figure>
<title>Installed Server Runtime Environments</title>
<mediaobject>
@@ -242,12 +243,26 @@
</imageobject>
</mediaobject>
</figure>
+
<para>If the server you want to create doesn't have any installed runtime yet, the combo box
- and button will disappear, and the next page in the wizard will force you to create the
- associated runtime first. </para>
+ and button will disappear. The next page in the wizard which has the same form as in <link
+ linkend="add_runtime_figure">the previous section</link> will ask you to create the
+ associated runtime.</para>
<para>Either way, after targeting your server to a runtime, the final screen in this wizard is
largely confirmational, giving the user a chance to verify that he's selected the
appropriate runtime. It also allows the user to name the server appropriately. </para>
+
+ <figure>
+ <title>Installed Server Runtime Environments</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/runtimes_servers/runtimes_servers_6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Now, having JBoss server and runtime installed, we can dwell on all services and tools that
+ JBoss Application Server provides.</para>
</section>
</section>
16 years, 9 months
JBoss Tools SVN: r5793 - trunk/as/docs/reference/en/images/runtimes_servers.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-01-18 05:55:23 -0500 (Fri, 18 Jan 2008)
New Revision: 5793
Added:
trunk/as/docs/reference/en/images/runtimes_servers/runtimes_servers_6.png
Log:
http://jira.jboss.com/jira/browse/JBDS-199 - adding a screenshot
Added: trunk/as/docs/reference/en/images/runtimes_servers/runtimes_servers_6.png
===================================================================
(Binary files differ)
Property changes on: trunk/as/docs/reference/en/images/runtimes_servers/runtimes_servers_6.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
16 years, 9 months
JBoss Tools SVN: r5792 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-17 21:15:10 -0500 (Thu, 17 Jan 2008)
New Revision: 5792
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
Log:
System.out.println() removed
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-01-18 02:13:13 UTC (rev 5791)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/ResourcesUtils.java 2008-01-18 02:15:10 UTC (rev 5792)
@@ -69,17 +69,6 @@
op.setCreateContainerStructure(false);
op.setContext(Display.getCurrent().getActiveShell());
op.run(monitor);
- Job j = new Job("+++++++++++test"){/* (non-Javadoc)
- * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- System.out.println("++++++++++Running a decorator.job");
- return Status.OK_STATUS;
- }};
- j.setUser(true);
- j.setPriority(Job.DECORATE);
- j.schedule();
return importedPrj;
}
16 years, 9 months
JBoss Tools SVN: r5791 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-17 21:13:13 -0500 (Thu, 17 Jan 2008)
New Revision: 5791
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
Log:
fix seam ui test errors
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-01-18 02:03:10 UTC (rev 5790)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/view/SeamComponentsViewTest.java 2008-01-18 02:13:13 UTC (rev 5791)
@@ -49,6 +49,7 @@
import org.jboss.tools.test.util.JUnitUtils;
import org.jboss.tools.test.util.ResourcesUtils;
import org.jboss.tools.test.util.WorkbenchUtils;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
/**
*
@@ -552,12 +553,8 @@
System.out.println("Refresh project "+count);
try {
project.refreshLocal(IResource.DEPTH_INFINITE, new NullProgressMonitor());
- try {
- waitForJob();
- } catch (InterruptedException e) {
- JUnitUtils.fail(e.getMessage(),e);
- }
- } catch (Exception e) {
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (CoreException e) {
JUnitUtils.fail("Cannot build test Project", e);
break;
}
@@ -567,84 +564,6 @@
}
}
- public void waitForJobs() {
- while (Job.getJobManager().currentJob() != null)
- delay(5000);
- }
-
- /** * Process UI input but do not return for the
- * specified time interval. *
- * @param waitTimeMillis the number of milliseconds */
- protected void delay(long waitTimeMillis) {
- Display display = Display.getCurrent();
- // If this is the UI thread,
- // then process input.
- if (display != null) {
- long endTimeMillis = System.currentTimeMillis() + waitTimeMillis;
- while (System.currentTimeMillis() < endTimeMillis){
- if (!display.readAndDispatch()) display.sleep();
- } display.update();
- }
- // Otherwise, perform a simple sleep.
- else {
- try {
- Thread.sleep(waitTimeMillis);
- } catch (InterruptedException e) {
- // Ignored.
- }
- }
- }
- public static void waitForJob() throws InterruptedException {
- Object[] o = {
- XJob.FAMILY_XJOB, ResourcesPlugin.FAMILY_AUTO_REFRESH, ResourcesPlugin.FAMILY_AUTO_BUILD
- };
- while(true) {
- boolean stop = true;
- for (int i = 0; i < o.length; i++) {
- Job[] js = Job.getJobManager().find(o[i]);
- if(js != null && js.length > 0) {
- Job.getJobManager().join(o[i], new NullProgressMonitor());
- stop = false;
- }
- }
- if(stop) {
- Job running = getJobRunning(10);
- if(running != null) {
- running.join();
- stop = false;
- }
- }
- if(stop) break;
- }
- }
-
- public static Job getJobRunning(int iterationLimit) {
- Job[] js = Job.getJobManager().find(null);
- Job dm = null;
- if(js != null) for (int i = 0; i < js.length; i++) {
- if(js[i].getState() == Job.RUNNING && js[i].getThread() != Thread.currentThread()) {
- if(js[i] instanceof UIJob) continue;
- if(js[i].belongsTo(DecoratorManager.FAMILY_DECORATE) || js[i].getName().equals("Task List Saver")) {
- dm = js[i];
- continue;
- }
- //TODO keep watching
- System.out.println(js[i].getName());
- return js[i];
- }
- }
- if(dm != null) {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e) {
- //ignore
- }
- if(iterationLimit > 0)
- return getJobRunning(iterationLimit - 1);
- }
- return null;
-
- }
public void updateTree(Tree tree) {
for(int i=0;i<tree.getItemCount();i++){
16 years, 9 months
JBoss Tools SVN: r5790 - in trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test: META-INF and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-17 21:03:10 -0500 (Thu, 17 Jan 2008)
New Revision: 5790
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF
trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/build.properties
Log:
testHQLDetector Error org.eclipse.core.runtime.CoreException: /testresources/ejb3-persistence.jar
java.lang.RuntimeException: org.eclipse.core.runtime.CoreException: /testresources/ejb3-persistence.jar
at org.hibernate.eclipse.console.test.SimpleTestProject.initialize(SimpleTestProject.java:48)
at org.hibernate.eclipse.console.test.SimpleTestProject.<init>(SimpleTestProject.java:36)
at org.hibernate.eclipse.jdt.ui.test.HQLQueryValidatorTest$1.<init>(HQLQueryValidatorTest.java:47)
at org.hibernate.eclipse.jdt.ui.test.HQLQueryValidatorTest.createTestProject(HQLQueryValidatorTest.java:47)
at org.hibernate.eclipse.console.test.HibernateConsoleTest.setUp(HibernateConsoleTest.java:27)
testCheckQueryEL Error java.lang.RuntimeException: org.eclipse.core.internal.resources.ResourceException: Resource '/hqlquerytest' already exists.
java.lang.RuntimeException: java.lang.RuntimeException: org.eclipse.core.internal.resources.ResourceException: Resource '/hqlquerytest' already exists.
at org.hibernate.eclipse.console.test.SimpleTestProject.initialize(SimpleTestProject.java:48)
at org.hibernate.eclipse.console.test.SimpleTestProject.<init>(SimpleTestProject.java:36)
at org.hibernate.eclipse.jdt.ui.test.HQLQueryValidatorTest$1.<init>(HQLQueryValidatorTest.java:47)
at org.hibernate.eclipse.jdt.ui.test.HQLQueryValidatorTest.createTestProject(HQLQueryValidatorTest.ja
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF 2008-01-18 01:46:10 UTC (rev 5789)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/META-INF/MANIFEST.MF 2008-01-18 02:03:10 UTC (rev 5790)
@@ -16,3 +16,4 @@
Eclipse-LazyStart: true
Export-Package: org.hibernate.eclipse.jdt.ui.test
Bundle-Activator: org.hibernate.eclipse.jdt.ui.test.HibernateJDTuiTestPlugin
+Bundle-ClassPath: org.hibernate.eclipse.jdt.ui.test.jar
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/build.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/build.properties 2008-01-18 01:46:10 UTC (rev 5789)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.jdt.ui.test/build.properties 2008-01-18 02:03:10 UTC (rev 5790)
@@ -1,4 +1,13 @@
-source.. = src/
-output.. = bin/
bin.includes = META-INF/,\
- .
+ testresources/,\
+ org.hibernate.eclipse.jdt.ui.test.jar
+jars.compile.order = org.hibernate.eclipse.jdt.ui.test.jar
+source.org.hibernate.eclipse.jdt.ui.test.jar = src/
+output.org.hibernate.eclipse.jdt.ui.test.jar = bin/
+src.includes = testresources/,\
+ src/,\
+ build.properties,\
+ META-INF/,\
+ .project,\
+ .classpath
+source.org.hibernate.eclipse.jdt.ui.test.jar = src/
16 years, 9 months
JBoss Tools SVN: r5789 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-17 20:46:10 -0500 (Thu, 17 Jan 2008)
New Revision: 5789
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/build.properties
Log:
fix test error
testEachPackWithTestSet Error java.lang.RuntimeException: Folder res/project/ not found!
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/build.properties
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/build.properties 2008-01-18 01:04:05 UTC (rev 5788)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/build.properties 2008-01-18 01:46:10 UTC (rev 5789)
@@ -5,4 +5,19 @@
META-INF/,\
lib/hibernate-tools-tests.jar,\
lib/hsqldb.jar,\
- lib/jaxen-1.1-beta-7.jar
+ lib/jaxen-1.1-beta-7.jar,\
+ res/,\
+ about.html
+src.includes = about.html,\
+ src/,\
+ res/,\
+ plugin.xml,\
+ lib/,\
+ hibernate-build.xml,\
+ build.properties,\
+ build/,\
+ META-INF/,\
+ .settings/,\
+ .project,\
+ .cvsignore,\
+ .classpath
16 years, 9 months
JBoss Tools SVN: r5788 - in trunk/as/plugins: org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-17 20:04:05 -0500 (Thu, 17 Jan 2008)
New Revision: 5788
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ShowStackTraceDialog.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java
Log:
JBIDE-1638 Examining Event Log Exceptions.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2008-01-17 23:44:20 UTC (rev 5787)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/events/EventLogModel.java 2008-01-18 01:04:05 UTC (rev 5788)
@@ -41,7 +41,9 @@
*/
public class EventLogModel {
public static final String ENABLE_LOGGING_PREFERENCE = "org.jboss.ide.eclipse.as.core.extensions.events.enableLogging";
-
+ public static final String EVENT_TYPE_EXCEPTION = "org.jboss.ide.eclipse.as.core.extensions.events.EXCEPTION";
+ public static final String EXCEPTION_PROPERTY = "org.jboss.ide.eclipse.as.core.extensions.events.EXCEPTION_PROPERTY";
+
public static void enableLogging(boolean enabled) {
if( enabled )
enableLogging();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2008-01-17 23:44:20 UTC (rev 5787)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/extensions/polling/JMXPoller.java 2008-01-18 01:04:05 UTC (rev 5788)
@@ -22,7 +22,6 @@
package org.jboss.ide.eclipse.as.core.extensions.polling;
import java.io.IOException;
-import java.util.Date;
import java.util.Properties;
import javax.management.MBeanException;
@@ -35,6 +34,7 @@
import javax.naming.NamingException;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXClassLoaderRepository;
import org.jboss.ide.eclipse.as.core.extensions.jmx.JMXUtil;
@@ -51,9 +51,7 @@
public class JMXPoller implements IServerStatePoller {
public static final String STARTED_PROPERTY = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.STARTED_PROPERTY";
- public static final String EXCEPTION_PROPERTY = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.EXCEPTION_PROPERTY";
public static final String EVENT_TYPE_STARTING = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.eventTypes.STARTING";
- public static final String EVENT_TYPE_EXCEPTION = "org.jboss.ide.eclipse.as.core.extensions.polling.jmx.eventTypes.EXCEPTION";
public static final int STATE_STARTED = 1;
@@ -201,8 +199,8 @@
}
public JMXEvent(SimpleTreeItem parent, Exception e) {
- super(parent, PollThread.SERVER_STATE_MAJOR_TYPE, EVENT_TYPE_EXCEPTION );
- setProperty(EXCEPTION_PROPERTY, e.getMessage());
+ super(parent, PollThread.SERVER_STATE_MAJOR_TYPE, EventLogModel.EVENT_TYPE_EXCEPTION );
+ setProperty(EventLogModel.EXCEPTION_PROPERTY, e);
}
}
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ShowStackTraceDialog.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ShowStackTraceDialog.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/ShowStackTraceDialog.java 2008-01-18 01:04:05 UTC (rev 5788)
@@ -0,0 +1,71 @@
+package org.jboss.ide.eclipse.as.ui.dialogs;
+
+import java.util.ArrayList;
+
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.window.IShellProvider;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
+
+public class ShowStackTraceDialog extends Dialog {
+
+ private EventLogTreeItem selected;
+ public ShowStackTraceDialog(IShellProvider parentShell, EventLogTreeItem selected) {
+ super(parentShell);
+ this.selected = selected;
+ }
+
+ public ShowStackTraceDialog(Shell shell, EventLogTreeItem selected) {
+ super(shell);
+ this.selected = selected;
+ }
+
+ protected void configureShell(Shell newShell) {
+ super.configureShell(newShell);
+ setShellStyle(SWT.SHELL_TRIM);
+ newShell.setText("Exception Stack Trace");
+ //newShell.setImage(JBossServerUISharedImages.getImage(JBossServerUISharedImages.TWIDDLE_IMAGE));
+ newShell.setBounds(300, 300, 500, 300);
+ }
+
+ protected Control createDialogArea(Composite parent) {
+ Composite c = (Composite)super.createDialogArea(parent);
+ c.setLayout(new FillLayout());
+ Text t = new Text(c, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ Object exception = selected.getProperty(EventLogModel.EXCEPTION_PROPERTY);
+ if( exception instanceof Throwable) {
+ Throwable aThrowable = (Throwable)exception;
+ ArrayList<Throwable> seen = new ArrayList<Throwable>();
+ final StringBuilder result = new StringBuilder();
+ boolean first = true;
+ while( aThrowable != null && !seen.contains(aThrowable)) {
+ seen.add(aThrowable);
+ if( !first ) result.append("nested:" + Text.DELIMITER);
+ appendDetails(aThrowable, result);
+ aThrowable = aThrowable.getCause();
+ first = false;
+ }
+ t.setText(result.toString());
+ }
+ return c;
+ }
+
+ protected void appendDetails(Throwable t, StringBuilder result) {
+ result.append(t.toString());
+ result.append(Text.DELIMITER);
+
+ //add each element of the stack trace
+ for (StackTraceElement element : t.getStackTrace() ){
+ result.append(" at ");
+ result.append( element );
+ result.append( Text.DELIMITER );
+ }
+ result.append(Text.DELIMITER );
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2008-01-17 23:44:20 UTC (rev 5787)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/EventLogViewProvider.java 2008-01-18 01:04:05 UTC (rev 5788)
@@ -58,6 +58,7 @@
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.IEventLogListener;
import org.jboss.ide.eclipse.as.core.util.SimpleTreeItem;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.dialogs.ShowStackTraceDialog;
import org.jboss.ide.eclipse.as.ui.preferencepages.ViewProviderPreferenceComposite;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.IEventLogLabelProvider;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
@@ -82,13 +83,13 @@
private ITreeContentProvider contentProvider;
private LabelProvider labelProvider;
-
private IEventLogLabelProvider[] labelProviderDelegates = null;
-
private IPropertySheetPage propertyPage = null;
+ private Object[] selection;
private IServer input;
private Action clearLogAction;
+ private Action showStackTraceAction;
private static HashMap<String, String> majorTypeToName = new HashMap<String, String>();
static {
@@ -119,7 +120,15 @@
}
};
clearLogAction.setText("Clear Event Log");
- //clearLogAction.setImageDescriptor(newImage)
+
+ showStackTraceAction = new Action() {
+ public void run() {
+ EventLogTreeItem item = (EventLogTreeItem)selection[0];
+ ShowStackTraceDialog dialog = new ShowStackTraceDialog(new Shell(), item);
+ dialog.open();
+ }
+ };
+ showStackTraceAction.setText("See Exception Details");
}
public class EventLogContentProvider implements ITreeContentProvider {
@@ -265,8 +274,14 @@
}
public void fillContextMenu(Shell shell, IMenuManager menu, Object selection[]) {
+ this.selection = selection;
if( selection.length == 1 && selection[0] == this.provider)
menu.add(clearLogAction);
+ if( selection.length == 1 && selection[0] instanceof EventLogTreeItem &&
+ (((EventLogTreeItem)selection[0]).getEventClass().equals(EventLogModel.EVENT_TYPE_EXCEPTION)) ||
+ ((EventLogTreeItem)selection[0]).getSpecificType().equals(EventLogModel.EVENT_TYPE_EXCEPTION)) {
+ menu.add(showStackTraceAction);
+ }
}
public ITreeContentProvider getContentProvider() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java 2008-01-17 23:44:20 UTC (rev 5787)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PollingLabelProvider.java 2008-01-18 01:04:05 UTC (rev 5788)
@@ -27,6 +27,7 @@
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.ui.internal.provisional.UIDecoratorManager;
+import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.extensions.polling.JMXPoller;
import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
@@ -52,7 +53,7 @@
supported.add(PollThread.POLL_THREAD_EXCEPTION);
supported.add(PollThread.POLLER_NOT_FOUND);
- supported.add(JMXPoller.EVENT_TYPE_EXCEPTION);
+ supported.add(EventLogModel.EVENT_TYPE_EXCEPTION);
supported.add(JMXPoller.EVENT_TYPE_STARTING);
supported.add(JBossServerBehavior.FORCE_SHUTDOWN_EVENT_KEY);
@@ -78,7 +79,7 @@
return getErrorImage();
}
- if( element.getSpecificType().equals(JMXPoller.EVENT_TYPE_EXCEPTION))
+ if( element.getSpecificType().equals(EventLogModel.EVENT_TYPE_EXCEPTION))
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
if( element.getSpecificType().equals(JMXPoller.EVENT_TYPE_STARTING)) {
boolean started = ((Boolean)element.getProperty(JMXPoller.STARTED_PROPERTY)).booleanValue();
@@ -111,8 +112,11 @@
if( element.getSpecificType().equals(PollThread.POLLER_NOT_FOUND)) return expectedString + " failed. Poller not found";
}
- if( element.getSpecificType().equals(JMXPoller.EVENT_TYPE_EXCEPTION))
- return "JMXException: " + (String)element.getProperty(JMXPoller.EXCEPTION_PROPERTY);
+ if( element.getSpecificType().equals(EventLogModel.EVENT_TYPE_EXCEPTION)) {
+ Object o = element.getProperty(EventLogModel.EXCEPTION_PROPERTY);
+ return "JMXException: " + ( o == null ? "null" : ((Exception)o).getMessage());
+ }
+
if( element.getSpecificType().equals(JMXPoller.EVENT_TYPE_STARTING)) {
boolean started = ((Boolean)element.getProperty(JMXPoller.STARTED_PROPERTY)).booleanValue();
if( !started )
@@ -154,7 +158,7 @@
// property names and their readable forms
propertyToMessageMap.put(EventLogTreeItem.DATE, "Time");
propertyToMessageMap.put(PollThread.EXPECTED_STATE, "Expected State");
- propertyToMessageMap.put(JMXPoller.EXCEPTION_PROPERTY, "Exception");
+ propertyToMessageMap.put(EventLogModel.EXCEPTION_PROPERTY, "Exception");
propertyToMessageMap.put(JMXPoller.STARTED_PROPERTY, "Server Started");
propertyToMessageMap.put(PollThread.POLL_THREAD_ABORTED_CAUSE, "Abort Cause");
// now values and their readable forms
16 years, 9 months