JBoss Tools SVN: r5756 - trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2008-01-17 04:51:31 -0500 (Thu, 17 Jan 2008)
New Revision: 5756
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1644
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-17 09:35:13 UTC (rev 5755)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.console/src/org/hibernate/eclipse/console/actions/OpenMappingAction.java 2008-01-17 09:51:31 UTC (rev 5756)
@@ -11,18 +11,20 @@
package org.hibernate.eclipse.console.actions;
import java.io.FileNotFoundException;
+import java.util.ArrayList;
+import java.util.List;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.Assert;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.BadLocationException;
import org.eclipse.jface.text.FindReplaceDocumentAdapter;
import org.eclipse.jface.text.IDocument;
import org.eclipse.jface.text.IRegion;
import org.eclipse.jface.text.Region;
+import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.TreePath;
import org.eclipse.jface.viewers.TreeSelection;
@@ -30,6 +32,7 @@
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.actions.SelectionListenerAction;
import org.eclipse.ui.part.MultiPageEditorPart;
+import org.eclipse.ui.texteditor.AbstractTextEditor;
import org.eclipse.ui.texteditor.ITextEditor;
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.eclipse.console.HibernateConsolePlugin;
@@ -150,8 +153,8 @@
* @throws FileNotFoundException
* @throws BadLocationException
*/
- public static void run(Property compositeProperty, Property parentProperty, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException{
- if (parentProperty.getPersistentClass() == null) return;
+ public static boolean run(Property compositeProperty, Property parentProperty, ConsoleConfiguration consoleConfiguration) throws PartInitException, JavaModelException, FileNotFoundException{
+ if (parentProperty.getPersistentClass() == null) return false;
IJavaProject proj = ProjectUtils.findJavaProject(consoleConfiguration);
java.io.File configXMLFile = consoleConfiguration.getPreferences().getConfigXMLFile();
IResource resource = OpenFileActionUtils.getResource(consoleConfiguration, proj, configXMLFile, parentProperty.getPersistentClass());
@@ -160,13 +163,19 @@
if (resource != null){
editorPart = openMapping(resource);
if (editorPart != null){
- ITextEditor textEditor = getTextEditor(editorPart);
- if (textEditor == null) return;
- textEditor.selectAndReveal(0, 0);
- FindReplaceDocumentAdapter findAdapter = getFindDocAdapter(textEditor);
+ ITextEditor[] textEditors = getTextEditors(editorPart);
+ if (textEditors.length == 0) return false;
+ textEditors[0].selectAndReveal(0, 0);
+ FindReplaceDocumentAdapter findAdapter = null;
+ ITextEditor textEditor = null;
+ for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
+ textEditor = textEditors[i];
+ findAdapter = getFindDocAdapter(textEditor);
+ }
+ if (findAdapter == null) return false;
+
IRegion parentRegion = findSelection(parentProperty, findAdapter);
- if (parentRegion == null) return;
-
+ if (parentRegion == null) return false;
IRegion propRegion = null;
try {
propRegion = findAdapter.find(parentRegion.getOffset()+parentRegion.getLength(), generatePattern(compositeProperty), true, true, false, true);
@@ -175,29 +184,38 @@
}
if (propRegion != null){
textEditor.selectAndReveal(propRegion.getOffset(), propRegion.getLength());
+ return true;
}
}
- return;
+ return false;
}
if (parentProperty.getPersistentClass() != null && parentProperty.isComposite()){
PersistentClass rootClass = parentProperty.getPersistentClass();
if (OpenFileActionUtils.rootClassHasAnnotations(consoleConfiguration, configXMLFile, rootClass)) {
String fullyQualifiedName =((Component)((Property) parentProperty).getValue()).getComponentClassName();
- new OpenSourceAction().run(compositeProperty, proj, fullyQualifiedName);
+ IEditorPart editor = new OpenSourceAction().run(compositeProperty, proj, fullyQualifiedName);
+ if (editor != null) return true;
}
- }
+ }
+ return false;
}
/**
* @param selection
* @param editorPart
*/
- static public void applySelectionToEditor(Object selection, IEditorPart editorPart) {
- ITextEditor textEditor = getTextEditor(editorPart);
- if (textEditor == null) return;
- textEditor.selectAndReveal(0, 0);
- FindReplaceDocumentAdapter findAdapter = getFindDocAdapter(textEditor);
+ static public boolean applySelectionToEditor(Object selection, IEditorPart editorPart) {
+ ITextEditor[] textEditors = getTextEditors(editorPart);
+ if (textEditors.length == 0) return false;
+ textEditors[0].selectAndReveal(0, 0);
+ FindReplaceDocumentAdapter findAdapter = null;
+ ITextEditor textEditor = null;
+ for (int i = 0; i < textEditors.length && findAdapter == null; i++) {
+ textEditor = textEditors[i];
+ findAdapter = getFindDocAdapter(textEditor);
+ }
+ if (findAdapter == null) return false;
IRegion selectRegion = null;
if (selection instanceof RootClass
@@ -209,7 +227,9 @@
if (selectRegion != null){
textEditor.selectAndReveal(selectRegion.getOffset(), selectRegion.getLength());
+ return true;
}
+ return false;
}
/**
@@ -218,7 +238,11 @@
*/
private static FindReplaceDocumentAdapter getFindDocAdapter(
ITextEditor textEditor) {
- IDocument document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ IDocument document = null;
+ if (textEditor.getDocumentProvider() != null){
+ document = textEditor.getDocumentProvider().getDocument(textEditor.getEditorInput());
+ }
+ if (document == null) return null;
FindReplaceDocumentAdapter findAdapter = new FindReplaceDocumentAdapter(document);
return findAdapter;
}
@@ -357,22 +381,28 @@
return pattern.toString();
}
- private static ITextEditor getTextEditor(IEditorPart editorPart) {
+ /**
+ * Method gets all ITextEditors from IEditorPart.
+ * Never returns null.
+ * @param editorPart
+ * @return
+ */
+ private static ITextEditor[] getTextEditors(IEditorPart editorPart) {
/*
* if EditorPart is MultiPageEditorPart then get ITextEditor from it.
*/
if (editorPart instanceof MultiPageEditorPart) {
- ITextEditor editor = null;
+ List testEditors = new ArrayList();
IEditorPart[] editors = ((MultiPageEditorPart) editorPart).findEditors(editorPart.getEditorInput());
for (int i = 0; i < editors.length; i++) {
if (editors[i] instanceof ITextEditor){
- editor = (ITextEditor) editors[i];
- break;
+ testEditors.add(editors[i]);
}
}
- return editor;
+ return (ITextEditor[])testEditors.toArray(new ITextEditor[0]);
+ } else if (editorPart instanceof ITextEditor){
+ return new ITextEditor[]{(ITextEditor) editorPart};
}
- return null;
- }
-
+ return new ITextEditor[0];
+ }
}
18 years, 3 months
JBoss Tools SVN: r5755 - trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-01-17 04:35:13 -0500 (Thu, 17 Jan 2008)
New Revision: 5755
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java
Log:
JBIDE-1643 remove bad System.out.println("...")
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2008-01-17 09:22:05 UTC (rev 5754)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse.jdt.ui/src/org/hibernate/eclipse/jdt/ui/internal/HQLJavaCompletionProposalComputer.java 2008-01-17 09:35:13 UTC (rev 5755)
@@ -145,7 +145,7 @@
}
public void sessionStarted() {
- System.out.println("...");
+
}
}
18 years, 3 months
JBoss Tools SVN: r5754 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-01-17 04:22:05 -0500 (Thu, 17 Jan 2008)
New Revision: 5754
Added:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java
Removed:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagrammTest.java
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
Log:
typo fixing
Copied: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java (from rev 5753, trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagrammTest.java)
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java (rev 0)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagramTest.java 2008-01-17 09:22:05 UTC (rev 5754)
@@ -0,0 +1,69 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.hibernate.eclipse.console.test.mappingproject;
+
+import junit.framework.TestCase;
+
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PartInitException;
+import org.hibernate.InvalidMappingException;
+import org.hibernate.MappingException;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.console.ConsoleConfiguration;
+import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
+import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
+import org.hibernate.mapping.PersistentClass;
+import org.jboss.tools.hibernate.ui.view.views.OpenDiagramActionDelegate;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class OpenMappingDiagramTest extends TestCase {
+ public void testOpenMappingDiagram() {
+ KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
+ final ConsoleConfiguration consCFG = knownConfigurations.find(ProjectUtil.ConsoleCFGName);
+ assertNotNull(consCFG);
+ consCFG.reset();
+ Object[] configs = null;
+ Object[] persClasses = null;
+ try {
+ configs = new ConsoleConfigurationWorkbenchAdapter().getChildren(consCFG);
+ assertTrue(configs[0] instanceof Configuration);
+ persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
+ } catch (InvalidMappingException ex){
+ fail("Mapping Diagramms for package " + HibernateAllMappingTests.getActivePackage().getElementName()
+ + " can't be opened:\n " + ex.getMessage());
+ }
+
+ if (persClasses.length > 0){
+ 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 OpenDiagramActionDelegate().openEditor(persClass, consCFG);
+ } catch (PartInitException e) {
+ ex = e;
+ }
+ if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
+ if (ex != null) fail("Mapping Diagramm for " + persClass.getClassName()
+ + " not opened:\n" + ex.getMessage());
+ }
+ }
+ //close all editors
+ }
+
+
+}
Deleted: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagrammTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagrammTest.java 2008-01-17 01:21:02 UTC (rev 5753)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/OpenMappingDiagrammTest.java 2008-01-17 09:22:05 UTC (rev 5754)
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributor:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.hibernate.eclipse.console.test.mappingproject;
-
-import junit.framework.TestCase;
-
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-import org.hibernate.InvalidMappingException;
-import org.hibernate.MappingException;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.console.ConsoleConfiguration;
-import org.hibernate.console.KnownConfigurations;
-import org.hibernate.eclipse.console.workbench.ConfigurationWorkbenchAdapter;
-import org.hibernate.eclipse.console.workbench.ConsoleConfigurationWorkbenchAdapter;
-import org.hibernate.mapping.PersistentClass;
-import org.jboss.tools.hibernate.ui.view.views.OpenDiagramActionDelegate;
-
-/**
- * @author Dmitry Geraskov
- *
- */
-public class OpenMappingDiagrammTest extends TestCase {
- public void testOpenMappingDiagramm() {
- KnownConfigurations knownConfigurations = KnownConfigurations.getInstance();
- final ConsoleConfiguration consCFG = knownConfigurations.find(ProjectUtil.ConsoleCFGName);
- assertNotNull(consCFG);
- consCFG.reset();
- Object[] configs = null;
- Object[] persClasses = null;
- try {
- configs = new ConsoleConfigurationWorkbenchAdapter().getChildren(consCFG);
- assertTrue(configs[0] instanceof Configuration);
- persClasses = new ConfigurationWorkbenchAdapter().getChildren(configs[0]);
- } catch (InvalidMappingException ex){
- fail("Mapping Diagramms for package " + HibernateAllMappingTests.getActivePackage().getElementName()
- + " can't be opened:\n " + ex.getMessage());
- }
-
- if (persClasses.length > 0){
- 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 OpenDiagramActionDelegate().openEditor(persClass, consCFG);
- } catch (PartInitException e) {
- ex = e;
- }
- if (ex == null ) ex = ProjectUtil.getExceptionIfItOccured(editor);
- if (ex != null) fail("Mapping Diagramm for " + persClass.getClassName()
- + " not opened:\n" + ex.getMessage());
- }
- }
- //close all editors
- }
-
-
-}
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-01-17 01:21:02 UTC (rev 5753)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/mappingproject/TestSet.java 2008-01-17 09:22:05 UTC (rev 5754)
@@ -40,7 +40,7 @@
private static void addPackTests(TestSuite suite){
suite.addTestSuite( OpenSourceFileTest.class );
suite.addTestSuite( OpenMappingFileTest.class );
- suite.addTestSuite( OpenMappingDiagrammTest.class );
+ suite.addTestSuite( OpenMappingDiagramTest.class );
}
private static void addTestsPackTearDown(TestSuite suite){
18 years, 3 months
JBoss Tools SVN: r5753 - in trunk/seam: tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-16 20:21:02 -0500 (Wed, 16 Jan 2008)
New Revision: 5753
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
Log:
1. core.jar is added to test/lib folder
2. security.drl moved to ejb/ejbModule for EAR deployment
3. checks for that are added to JUnit test for seam 2 EAR project
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-01-16 21:45:15 UTC (rev 5752)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-01-17 01:21:02 UTC (rev 5753)
@@ -101,6 +101,7 @@
.include("jboss-deployers.jar") //$NON-NLS-1$
.include("test/thirdparty-all\\.jar") //$NON-NLS-1$
.include("thirdparty-all\\.jar") //$NON-NLS-1$
+ .include("core.jar") //$NON-NLS-1$
.exclude(".*/CVS") //$NON-NLS-1$
.exclude(".*/\\.svn"); //$NON-NLS-1$
@@ -126,8 +127,7 @@
.include("jboss-el.*.jar") //$NON-NLS-1$
.include("mvel14.*.jar") //$NON-NLS-1$
.include("jbpm-jpdl.*\\.jar") //$NON-NLS-1$
- .include("richfaces-api.*\\.jar") //$NON-NLS-1$
- .include("security\\.drl"); //$NON-NLS-1$
+ .include("richfaces-api.*\\.jar"); //$NON-NLS-1$
/*public static AntCopyUtils.FileSet JBOSS_EAR_CONTENT_META_INF = new AntCopyUtils.FileSet()
.include("META-INF/application\\.xml") //$NON-NLS-1$
@@ -411,6 +411,11 @@
// Copy seam project indicator
// ********************************************************************************************
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"), new File(ejb,"ejbModule/"), true); //$NON-NLS-1$ //$NON-NLS-2$
+
+ // ********************************************************************************************
+ // Copy security.drl to source folder
+ // ********************************************************************************************
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"security.drl"), new File(ejb,"ejbModule/"), true); //$NON-NLS-1$ //$NON-NLS-2$
File resources = new File(ear,"resources");
AntCopyUtils.copyFileToFile(
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2008-01-16 21:45:15 UTC (rev 5752)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/Seam2FacetInstallDelegateTest.java 2008-01-17 01:21:02 UTC (rev 5753)
@@ -128,6 +128,7 @@
Set<String> onlyInWar = new HashSet<String>();
Set<String> onlyInEar = new HashSet<String>();
+ Set<String> onlyInEjbSrc = new HashSet<String>();
onlyInEar.add("jboss-seam.jar");
onlyInEar.add("antlr-runtime.jar");
@@ -138,7 +139,6 @@
onlyInEar.add("richfaces-api.jar");
onlyInEar.add("jbpm-jpdl.jar");
onlyInEar.add("META-INF");
- onlyInEar.add("security.drl");
onlyInWar.add("commons-beanutils.jar");
onlyInWar.add("commons-digester.jar");
@@ -165,10 +165,16 @@
assertOnlyContainsTheseFiles(onlyInEarMeta, earMeta);
-
assertOnlyContainsTheseFiles(onlyInWar, (IContainer)war.findMember("WebContent/WEB-INF/lib").getAdapter(IContainer.class));
+
+ IProject ejb = seamProjectsSet.getEjbProject();
+
+ onlyInEjbSrc.add("security.drl");
+ onlyInEjbSrc.add("seam.properties");
+ onlyInEjbSrc.add("import.sql");
+ onlyInEjbSrc.add("components.properties");
-
+ assertOnlyContainsTheseFiles(onlyInEjbSrc, ear.findMember("ejbModule"));
}
@@ -230,6 +236,7 @@
libs.add("jboss-embedded-all.jar");
libs.add("thirdparty-all.jar");
libs.add("jboss-embedded-api.jar");
+ libs.add("core.jar");
assertOnlyContainsTheseFiles(libs, testProject.findMember("lib"));
assertNotNull(testProject.findMember("lib/testng.jar"));
@@ -238,8 +245,6 @@
assertNotNull(testProject.findMember("lib/jboss-embedded-all.jar"));
assertNotNull(testProject.findMember("lib/thirdparty-all.jar"));
-
-
}
public void testSeamProperties() {
18 years, 3 months
JBoss Tools SVN: r5752 - in trunk: tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-16 16:45:15 -0500 (Wed, 16 Jan 2008)
New Revision: 5752
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTestSetup.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
Log:
fix join job issues
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTestSetup.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTestSetup.java 2008-01-16 19:43:17 UTC (rev 5751)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTestSetup.java 2008-01-16 21:45:15 UTC (rev 5752)
@@ -24,6 +24,7 @@
@Override
protected void setUp() throws Exception {
+ EditorTestHelper.joinBackgroundActivities();
ResourcesUtils.importProject("org.jboss.tools.seam.core.test","projects/SeamWebWarTestProject" , new NullProgressMonitor());
EditorTestHelper.joinBackgroundActivities();
}
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-01-16 19:43:17 UTC (rev 5751)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-01-16 21:45:15 UTC (rev 5752)
@@ -172,7 +172,7 @@
}
}
// Join jobs
- joinJobs(1000, 10000, 500);
+ joinJobs(0, 10000, 500);
Logger.global.exiting("EditorTestHelper", "joinBackgroundActivities"); //$NON-NLS-1$ //$NON-NLS-2$
}
18 years, 3 months
JBoss Tools SVN: r5751 - trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-01-16 14:43:17 -0500 (Wed, 16 Jan 2008)
New Revision: 5751
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
Log:
Fixed some issues with joing jobs.
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-01-16 18:28:06 UTC (rev 5750)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamEARTest.java 2008-01-16 19:43:17 UTC (rev 5751)
@@ -10,20 +10,19 @@
******************************************************************************/
package org.jboss.tools.seam.core.test;
+import junit.framework.TestCase;
+
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IncrementalProjectBuilder;
import org.eclipse.core.runtime.NullProgressMonitor;
-import org.jboss.tools.common.model.XJob;
import org.jboss.tools.common.test.util.TestProjectProvider;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
-import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.test.util.JUnitUtils;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
-import junit.framework.TestCase;
-
/**
* @author V.Kabanovich
*
@@ -40,10 +39,10 @@
protected void setUp() throws Exception {
TestProjectProvider providerEAR = new TestProjectProvider("org.jboss.tools.seam.core.test", null, "Test1-ear", makeCopy);
projectEAR = providerEAR.getProject();
-
+
TestProjectProvider providerWAR = new TestProjectProvider("org.jboss.tools.seam.core.test", null, "Test1", makeCopy);
projectWAR = providerWAR.getProject();
-
+
TestProjectProvider providerEJB = new TestProjectProvider("org.jboss.tools.seam.core.test", null, "Test1-ejb", makeCopy);
projectEJB = providerEJB.getProject();
@@ -55,26 +54,19 @@
JUnitUtils.fail("Error in refreshing",e);
}
- try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
- JUnitUtils.fail("Interrupted",e);
- }
+ EditorTestHelper.joinBackgroundActivities();
}
private ISeamProject getSeamProject(IProject project) {
try {
- XJob.waitForJob();
+ EditorTestHelper.joinBackgroundActivities();
+// XJob.waitForJob();
} catch (Exception e) {
JUnitUtils.fail("Interrupted",e);
}
try {
project.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
- try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
- JUnitUtils.fail("Interrupted",e);
- }
+ EditorTestHelper.joinBackgroundActivities();
} catch (Exception e) {
JUnitUtils.fail("Cannot build", e);
}
@@ -104,13 +96,11 @@
*/
public void testCreatingProject() {
}
-
+
public void testProject() {
ISeamProject seamProject = getSeamProject(projectWAR);
ISeamComponent c = seamProject.getComponent("authenticator");
-
+
assertNotNull("War project must see component 'authenticator' declared in ejb project", c);
-
}
-
-}
+}
\ No newline at end of file
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-01-16 18:28:06 UTC (rev 5750)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamValidatorsTest.java 2008-01-16 19:43:17 UTC (rev 5751)
@@ -910,15 +910,14 @@
}
return numbers;
}
-
+
private void refreshProject(IProject project){
- waitForJob();
+ waitForJob();
}
-
+
public static void waitForJob() {
EditorTestHelper.joinJobs(1000,10000,500);
//then wait for a while to Workspace runnable is finished
- EditorTestHelper.joinJobs(2000, 2000, 0);
+ EditorTestHelper.joinJobs(2000, 2000, 500);
}
-
-}
+}
\ No newline at end of file
18 years, 3 months
JBoss Tools SVN: r5750 - trunk/as/docs/reference/en/modules.
by jbosstools-commits@lists.jboss.org
Author: ochikvina
Date: 2008-01-16 13:28:06 -0500 (Wed, 16 Jan 2008)
New Revision: 5750
Modified:
trunk/as/docs/reference/en/modules/runtimes_servers.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-199 - updating the chapter according to Max remarks
Modified: trunk/as/docs/reference/en/modules/runtimes_servers.xml
===================================================================
--- trunk/as/docs/reference/en/modules/runtimes_servers.xml 2008-01-16 18:18:10 UTC (rev 5749)
+++ trunk/as/docs/reference/en/modules/runtimes_servers.xml 2008-01-16 18:28:06 UTC (rev 5750)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<chapter id="runtimes_servers" xreflabel="runtimes_servers">
- <?dbhtml filename="runtimes_servers.html"?>
+ <?dbhtml filename="runtimes_servers.html"?>
<chapterinfo>
<keywordset>
<keyword>JBoss Developer Studio</keyword>
@@ -10,32 +10,43 @@
<keyword>JBoss</keyword>
</keywordset>
</chapterinfo>
- <title>Runtimes and Servers in the JBoss AS plugin</title>
+ <title>Runtimes and Servers in the JBoss AS plugin</title>
- <para>In this chapter we will discuss how to install runtimes and servers</para>
+ <para>In this chapter we will discuss how to install runtimes and servers.</para>
<!-- <para>First of all it's necessary to say a few words about WTP </para> -->
<!-- The Eclipse Web Tools Platform (WTP) project extends the Eclipse platform with tools for developing Web and Java EE applications. It includes source and graphical editors for a variety of languages, wizards and built-in applications to simplify development, and tools and APIs to support deploying, running, and testing apps. -->
- <para>The JBoss AS plugin makes use of WTP. This includes starting and stopping servers in run or debug mode. It also includes
- targeting WTP projects, such as dynamic web projects, to certain server runtimes in order to ensure that the proper jars
- from a specific server are added to the project's classpath properly.</para>
- <para>In order to get started creating, running, and debugging J2EE applications, we must start with creating our <property>runtime</property> and
- <property>server</property> instances.</para>
-
+ <para>The JBoss AS plugin makes use of WTP. This includes starting and stopping servers in run or
+ debug mode. It also includes targeting WTP projects, such as dynamic web projects, to certain
+ server runtimes in order to ensure that the proper jars from a specific server are added to the
+ project's classpath properly.</para>
+ <para>In order to get started creating, running, and debugging J2EE applications, we must start
+ with creating our <property>runtime</property> and <property>server</property> instances.</para>
+
<section>
<title>WTP Runtimes</title>
- <para>In JBoss Tools, the main purpose of Server Runtimes is to point to a server installation somewhere on disk.
- In our case, this will be a JBoss installation, and it can than be used for two primary purposes:</para>
- <itemizedlist>
- <listitem><para>it provides classpath additions to WTP projects that require them.</para></listitem>
- <listitem><para>For JBoss server at least, it provides information necessary for the starting and stopping of the server, it tells which jars to run and which configuration to use.</para></listitem>
- </itemizedlist>
-
- <section id="InstNewRuntime"><title>Installing a new Runtime</title>
- <para>You can install runtimes into eclipse from the <emphasis><property>Window > Preferences... </property></emphasis>
- menu, and then select <emphasis><property>Server > Installed Runtimes</property></emphasis> from the categories available.</para>
+ <para>In JBoss Tools, the main purpose of Server Runtimes is to point to a server installation
+ somewhere on disk. In our case, this will be a JBoss installation, and it can than be used for
+ two primary purposes:</para>
+ <itemizedlist>
+ <listitem>
+ <para>it provides classpath additions to WTP projects that require them.</para>
+ </listitem>
+ <listitem>
+ <para>For JBoss server at least, it provides information necessary for the starting and
+ stopping of the server, it tells which jars to run and which configuration to use.</para>
+ </listitem>
+ </itemizedlist>
+
+ <section id="InstNewRuntime">
+ <title>Installing a new Runtime</title>
+ <para>You can install runtimes into eclipse from the <emphasis>
+ <property>Window > Preferences... </property>
+ </emphasis> menu, and then select <emphasis>
+ <property>Server > Installed Runtimes</property>
+ </emphasis> from the categories available.</para>
<figure>
<title>Installed Runtimes</title>
<mediaobject>
@@ -44,10 +55,19 @@
</imageobject>
</mediaobject>
</figure>
- <para>From this preference page you can see what runtimes are declared, and what type they are. In the image shown above, there are two declared
- runtimes, including a JBoss 4.2 instance.</para>
- <para>To create a JBoss runtime, we begin by clicking the <emphasis><property>Add</property></emphasis> button. This will open another dialog that allows us to choose what type
- of runtime we want to create. Most of the runtime options are provided by WTP, but those provided by JBoss Tools are the ones we will focus on.</para>
+ <para>From this preference page you can see declared runtimes and their types as well. In the
+ image shown above, there are two declared runtimes, including a JBoss 4.2 instance.</para>
+
+ <para>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>
+ </emphasis> button and choose necessary type of runtime from the appeared dialog. </para>
+
+ <!--para>Most of the runtime options are provided by WTP, but those
+ provided by JBoss Tools are the ones we will focus on.</para-->
+
<figure>
<title>Adding a Runtime</title>
<mediaobject>
@@ -56,10 +76,15 @@
</imageobject>
</mediaobject>
</figure>
- <para>As seen above, there appear to be two JBoss categories. The first is contributed by WTP, and is a generic adapter that is not upkept very well.
- For this reason, JBoss Tools provides updated and supported adapters of our own. There is one for each of JBoss 3.2, 4.0, and 4.2. You'll also note a deploy-only
- runtime type. This type provides no classpath for WTP projects. It is used solely by it's server type for the purpose of setting up a deploy directory
- for users who don't wish to make use of starting, stopping, or debugging their projects inside eclipse.</para>
+
+ <para>As seen above, there appear to be two JBoss categories. The first is contributed by WTP,
+ and is a generic adapter that is not upkept very well. For this reason, JBoss Tools provides
+ updated and supported adapters of our own. There is one for each of JBoss 3.2, 4.0, and 4.2.
+ You'll also note a deploy-only runtime type. This type provides no classpath for WTP
+ projects. It is used solely by it's server type for the purpose of setting up a deploy
+ directory for users who don't wish to make use of starting, stopping, or debugging their
+ projects inside eclipse.</para>
+
<figure>
<title>Adding a JBoss 4.2 Runtime</title>
<mediaobject>
@@ -68,61 +93,97 @@
</imageobject>
</mediaobject>
</figure>
- <para>As shown above, all you need to do to create the runtime is to name it, browse to it's install directory,
- select a Java Runtime Environment, and select which configuration you want. As you browse to a valid installation folder, the list of configurations will
- update allowing you to select the configuration of your choice.</para>
- <para>Once the runtime is created, the configuration is an unchanging property
- of that runtime. This is because many of the jars necessary to provide for classpaths, such as the ejb3 jar locations or the servlet jar locations,
- are located in deploy directories of each configurations (depending on which version of JBoss is being used). Because of this, to compile against
- a different configuration's jars, you will need to create a new runtime from that configuration.</para>
- <para>Also, because of the open-source nature of JBoss, it is likely that a user may want to
- modify and repackage some of the configuration-specific jboss jars and create their own configuration using those modified jars. Rather than forcing the user to copy his
- entire JBoss installation, this structure allows them to create only a new configuration instead.</para>
- <para>As a result of having each runtime represent a specific configuration rather than the server installation as a whole, it is very likely you'll create several different runtimes
- to test each of your configurations. It becomes important to ensure your runtimes, and later your servers, are given descriptive names that help you remember which is which.
- It will do no good to try to remember if "JBoss-runtime 5" is the 4.0 install with ejb3? Or the 4.2 install's custom configuration you decided to create.</para>
- <para>After pressing finish, you'll see that your new runtime has been added to the list and can now be targeted by WTP type projects or servers, both of which we'll get to later.</para>
+
+ <para>All you need here is to name chosen runtime (or you can leave offered name), browse to
+ its install directory and select a Java Runtime Environment. As you browse to a valid
+ installation folder, the list of configurations will update allowing you to select the
+ configuration of your choice.</para>
+
+
+
+
+ <para>Once the runtime is created, the configuration is an unchanging property of that
+ runtime. This is because many of the jars necessary to provide for classpaths, such as the
+ ejb3 jar locations or the servlet jar locations, are located in deploy directories of each
+ configurations (depending on which version of JBoss is being used). Because of this, to
+ compile against a different configuration's jars, you will need to create a new runtime from
+ that configuration.</para>
+
+
+ <!--para>The user is likely to want to modify some of the configuration-specific
+ jboss jars. In this case it's possible to create your own new configuration.</para-->
+
+
+ <para>Also, because of the open-source nature of JBoss, it is likely that a user may want to
+ modify and repackage some of the configuration-specific jboss jars and create their own
+ configuration using those modified jars. Rather than forcing the user to copy his entire
+ JBoss installation, this structure allows them to create only a new configuration instead.</para>
+
+ <para>As a result of having each runtime represent a specific configuration rather than the
+ server installation as a whole, it is very likely you'll create several different runtimes
+ to test each of your configurations. It becomes important to ensure your runtimes, and later
+ your servers, are given descriptive names that help you remember which is which. It will do
+ no good to try to remember if "JBoss-runtime 5" is the 4.0 install with ejb3? Or the 4.2
+ install's custom configuration you decided to create.</para>
+ <para>Press <emphasis>
+ <property>Finish</property>
+ </emphasis> to see your new runtime in the list.</para>
</section>
-
+
</section>
-
+
<section>
<title>WTP 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 those modules. </para>
- <para>Servers can be started or stopped with different command-line arguments. They are often backed by a runtime object representing that server's location.</para>
- <section>
+ <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
+ those modules. </para>
+ <para>Servers can be started or stopped with different command-line arguments. They are often
+ backed by a runtime object representing that server's location.</para>
+ <section>
<title>Creating a New Server</title>
- <para>There are many ways to get to the new server wizard. One way is to use the old standard <emphasis><property>File -> New -> Other... </property></emphasis>wizard,
- and type in <emphasis><property>Server</property></emphasis>. This should show the screen below, which does not look that different from the initial screen when creating a new runtime. </para>
- <figure>
- <title>Adding a JBoss Server</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/runtimes_servers/runtimes_servers_4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Because the server object is what keeps track of things like command line arguments when starting or stopping, and runtimes keep track of the location of the installation,
- each server instance must be backed by an appropriate runtime. </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>
- <para>If none of the runtimes declared are one you want to use, for example if you declared a default and a minimal runtime before but now want your server
- to be backed by the ALL configuration, then you can click on the <emphasis><property>Installed Runtimes... </property></emphasis> button to bring up the preference page shown at the beginning of this chapter.</para>
- <figure>
- <title>Installed Server Runtime Environments</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/runtimes_servers/runtimes_servers_5.png"/>
- </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>
- <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>
+ <para>There are many ways to get to the new server wizard. One way is to use the old standard <emphasis>
+ <property>File > New > Other... </property>
+ </emphasis>wizard, and type in <emphasis>
+ <property>Server</property>
+ </emphasis>. This should show the screen below, which does not look that different from the
+ initial screen when creating a new runtime. </para>
+ <figure>
+ <title>Adding a JBoss Server</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/runtimes_servers/runtimes_servers_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Because the server object is what keeps track of things like command line arguments when
+ starting or stopping, and runtimes keep track of the location of the installation, each
+ server instance must be backed by an appropriate runtime. </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>
+ <para>If none of the runtimes declared are one you want to use, for example if you declared a
+ default and a minimal runtime before but now want your server to be backed by the ALL
+ configuration, then you can click on the <emphasis>
+ <property>Installed Runtimes... </property>
+ </emphasis> button to bring up the preference page shown at the beginning of this chapter.</para>
+ <figure>
+ <title>Installed Server Runtime Environments</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/runtimes_servers/runtimes_servers_5.png"/>
+ </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>
+ <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>
+ </section>
+
</section>
-
- </section>
-
- </chapter>
+
+</chapter>
18 years, 3 months
JBoss Tools SVN: r5749 - trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2008-01-16 13:18:10 -0500 (Wed, 16 Jan 2008)
New Revision: 5749
Modified:
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java
trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
Log:
timeout is added to reading the GUI thread even queue
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java 2008-01-16 18:13:04 UTC (rev 5748)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/DisplayHelper.java 2008-01-16 18:18:10 UTC (rev 5749)
@@ -188,10 +188,14 @@
if (timeout < 0)
return false;
+
+ // repeatedly sleep until condition becomes true or timeout elapses
+ DisplayWaiter waiter= new DisplayWaiter(display, true);
+ long finalTimeout = calculateFinalTimeout(timeout);
// if driving the event loop once makes the condition hold, succeed
// without spawning a thread.
- driveEventQueue(display);
+ driveEventQueue(display,finalTimeout);
if (condition())
return true;
@@ -199,18 +203,13 @@
if (timeout == 0)
return false;
- // repeatedly sleep until condition becomes true or timeout elapses
- DisplayWaiter waiter= new DisplayWaiter(display, true);
- long currentTimeMillis= System.currentTimeMillis();
- long finalTimeout= timeout + currentTimeMillis;
- if (finalTimeout < currentTimeMillis)
- finalTimeout= Long.MAX_VALUE;
+ finalTimeout = calculateFinalTimeout(timeout);
boolean condition;
try {
do {
waiter.restart(interval);
if (display.sleep())
- driveEventQueue(display);
+ driveEventQueue(display,finalTimeout);
condition= condition();
} while (!condition && finalTimeout > System.currentTimeMillis());
} finally {
@@ -219,4 +218,28 @@
return condition;
}
+ /**
+ * @param display
+ * @param finalTimeout
+ */
+ private boolean driveEventQueue(Display display, long finalTimeout) {
+ boolean events= false;
+ while (display.readAndDispatch() && finalTimeout > System.currentTimeMillis()) {
+ events= true;
+ }
+ return events;
+ }
+
+ /**
+ * @param timeout
+ * @return
+ */
+ private long calculateFinalTimeout(long timeout) {
+ long currentTimeMillis= System.currentTimeMillis();
+ long finalTimeout= timeout + currentTimeMillis;
+ if (finalTimeout < currentTimeMillis)
+ finalTimeout= Long.MAX_VALUE;
+ return finalTimeout;
+ }
+
}
\ No newline at end of file
Modified: trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java
===================================================================
--- trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-01-16 18:13:04 UTC (rev 5748)
+++ trunk/tests/tests/org.jboss.tools.test/src/org/jboss/tools/test/util/xpl/EditorTestHelper.java 2008-01-16 18:18:10 UTC (rev 5749)
@@ -172,7 +172,7 @@
}
}
// Join jobs
- joinJobs(0, 0, 500);
+ joinJobs(1000, 10000, 500);
Logger.global.exiting("EditorTestHelper", "joinBackgroundActivities"); //$NON-NLS-1$ //$NON-NLS-2$
}
18 years, 3 months
JBoss Tools SVN: r5748 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-01-16 13:13:04 -0500 (Wed, 16 Jan 2008)
New Revision: 5748
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
Log:
XPCOMException processing was adjusted, was added check for error code.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-01-16 18:12:20 UTC (rev 5747)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/ComponentUtil.java 2008-01-16 18:13:04 UTC (rev 5748)
@@ -251,10 +251,16 @@
Node attribute = namedNodeMap.item(i);
//added by Max Areshkau fix for JBIDE-1568
try {
+
visualElement.setAttribute(attribute.getNodeName(), attribute
.getNodeValue());
} catch(XPCOMException ex) {
- //Just ignore this exception
+ //if error-code not equals error for incorrect name throws exception
+ // error code is NS_ERROR_DOM_INVALID_CHARACTER_ERR=0x80530005
+ if(ex.errorcode!=2152923141L) {
+ throw ex;
+ }
+ //else we ignore this exception
}
}
}
18 years, 3 months
JBoss Tools SVN: r5747 - in trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2008-01-16 13:12:20 -0500 (Wed, 16 Jan 2008)
New Revision: 5747
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/spacer/spacer.gif
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1639
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/spacer/spacer.gif
===================================================================
(Binary files differ)
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2008-01-16 16:45:15 UTC (rev 5746)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesSpacerTemplate.java 2008-01-16 18:12:20 UTC (rev 5747)
@@ -7,7 +7,7 @@
*
* Contributors:
* Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.jsf.vpe.richfaces.template;
import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
@@ -26,7 +26,7 @@
*/
public class RichFacesSpacerTemplate extends VpeAbstractTemplate {
- final static private String IMAGE_NAME = "/spacer/spacer.gif";
+ final static private String IMAGE_NAME = "spacer/spacer.gif";
/**
* Creates a node of the visual tree on the node of the source tree. This
@@ -35,18 +35,28 @@
*
* @param pageContext
* Contains the information on edited page.
- * @param sourceNode The current node of the source tree.
- * @param visualDocument The document of the visual tree.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
* @return The information on the created node of the visual tree.
*/
- public VpeCreationData create(VpePageContext pageContext, Node sourceNode, nsIDOMDocument visualDocument) {
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
- nsIDOMElement img = visualDocument.createElement(HtmlComponentUtil.HTML_TAG_IMG);
+ nsIDOMElement img = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_IMG);
ComponentUtil.setImg(img, IMAGE_NAME);
- if(sourceNode instanceof Element) {
- img.setAttribute("width", getSize((Element)sourceNode, "width"));
- img.setAttribute("height", getSize((Element)sourceNode, "height"));
+ if (sourceNode instanceof Element) {
+ // ComponentUtil.copyAttributes(sourceNode, img);
+ img.setAttribute("style", ((Element) sourceNode)
+ .getAttribute("style"));
+ img.setAttribute("class", ((Element) sourceNode)
+ .getAttribute("styleClass"));
+ img.setAttribute("width", getSize((Element) sourceNode, "width"));
+ img.setAttribute("height", getSize((Element) sourceNode, "height"));
+
}
VpeCreationData creationData = new VpeCreationData(img);
@@ -55,8 +65,8 @@
}
private String getSize(Element sourceElement, String attributeName) {
- String size = sourceElement.getAttribute(attributeName);
- if (size==null || size.length()==0) {
+ String size = sourceElement.getAttribute(attributeName);
+ if (size == null || size.length() == 0) {
return "1px";
} else {
return size;
@@ -70,11 +80,18 @@
* java.lang.Object, java.lang.String, java.lang.String)
*/
@Override
- public void setAttribute(VpePageContext pageContext, Element sourceElement, nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data, String name, String value) {
- super.setAttribute(pageContext, sourceElement, visualDocument, visualNode, data, name, value);
+ public void setAttribute(VpePageContext pageContext, Element sourceElement,
+ nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data,
+ String name, String value) {
+ super.setAttribute(pageContext, sourceElement, visualDocument,
+ visualNode, data, name, value);
- nsIDOMElement img = (nsIDOMElement) visualNode.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ nsIDOMElement img = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ // ComponentUtil.copyAttributes(sourceElement, img);
+ img.setAttribute("style", sourceElement.getAttribute("style"));
+ img.setAttribute("class", sourceElement.getAttribute("styleClass"));
img.setAttribute("width", getSize(sourceElement, "width"));
img.setAttribute("height", getSize(sourceElement, "height"));
}
18 years, 3 months