JBoss Tools SVN: r5857 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-01-21 22:22:00 -0500 (Mon, 21 Jan 2008)
New Revision: 5857
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
Log:
JBIDE-1487 NPE in error log on refresh of view
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2008-01-21 19:32:54 UTC (rev 5856)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2008-01-22 03:22:00 UTC (rev 5857)
@@ -130,6 +130,9 @@
}
}
};
+
+ if( JBossServerView.getDefault() == null ) return;
+
if( Display.getCurrent() == null )
Display.getDefault().asyncExec(r);
else
18 years, 2 months
JBoss Tools SVN: r5856 - in trunk: seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2008-01-21 14:32:54 -0500 (Mon, 21 Jan 2008)
New Revision: 5856
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
Log:
if we must have stupid test only methods then let us clearly mark them as such.
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-01-21 19:25:44 UTC (rev 5855)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-01-21 19:32:54 UTC (rev 5856)
@@ -167,7 +167,8 @@
super.setSourceViewerConfiguration(config);
}
- public SourceViewerConfiguration getSVConfiguration () {
+ /** This is *only* for allowing unit tests to access the source configuration. */
+ public SourceViewerConfiguration getSourceViewerConfigurationForTest () {
return getSourceViewerConfiguration();
}
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-01-21 19:25:44 UTC (rev 5855)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-01-21 19:32:54 UTC (rev 5856)
@@ -454,7 +454,7 @@
JSPTextEditor jspTextEditor = jspEditor.getJspEditor();
StructuredTextViewer viewer = jspTextEditor.getTextViewer();
IDocument document = viewer.getDocument();
- IContentAssistant contentAssistant = jspTextEditor.getSVConfiguration().getContentAssistant(viewer);
+ IContentAssistant contentAssistant = jspTextEditor.getSourceViewerConfigurationForTest().getContentAssistant(viewer);
List<IRegion> regionsToTest = getELRegionsToTest(document);
if (regionsToTest != null) {
18 years, 2 months
JBoss Tools SVN: r5855 - in trunk/jsf/docs/userguide/en: modules and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: ykryvinchanka
Date: 2008-01-21 14:25:44 -0500 (Mon, 21 Jan 2008)
New Revision: 5855
Added:
trunk/jsf/docs/userguide/en/images/palette/palette_25.png
Modified:
trunk/jsf/docs/userguide/en/modules/palette.xml
Log:
http://jira.jboss.com/jira/browse/JBDS-232 changes in structure of Using the Palette section + new screen + new info + new links + some notes and remarks + content review + mistakes correction
Added: trunk/jsf/docs/userguide/en/images/palette/palette_25.png
===================================================================
(Binary files differ)
Property changes on: trunk/jsf/docs/userguide/en/images/palette/palette_25.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/jsf/docs/userguide/en/modules/palette.xml
===================================================================
--- trunk/jsf/docs/userguide/en/modules/palette.xml 2008-01-21 18:41:36 UTC (rev 5854)
+++ trunk/jsf/docs/userguide/en/modules/palette.xml 2008-01-21 19:25:44 UTC (rev 5855)
@@ -13,14 +13,14 @@
<itemizedlist>
<listitem>
- <para>Insert tags into a JSP page with one click</para>
+ <para>Insert tags into a JSP or JSF page with one click</para>
</listitem>
<listitem>
<para>Add custom and 3rd party tags.</para>
</listitem>
</itemizedlist>
- <para>The <property>JBoss Tools Palette</property> provides possibility to add any tag
+ <para>The <property>JBoss Tools Palette</property> contains a developer's project tag libraries and provides possibility to add any tag
libraries to it. Or you can choose a necessary one from the list of already existent tag
libraries:</para>
<itemizedlist>
@@ -43,10 +43,11 @@
</mediaobject>
</figure>
-<section id="UsingThePalette(IncludingOne-ClickTagInsertion)">
+ <section id="UsingThePalette(IncludingOne-ClickTagInsertion)">
<?dbhtml filename="UsingThePalette(IncludingOne-ClickTagInsertion).html"?>
<title>Using the Palette</title>
- <section id="RedHatPalette">
+
+ <section id="RedHatPalette">
<?dbhtml filename="JBossToolsPalette.html"?>
<title>JBoss Tools Palette</title>
@@ -88,14 +89,24 @@
<?dbhtml filename="InsertingTagsIntoAJSPFile.html"?>
<title>Inserting Tags into a JSP File</title>
- <para>A new tag can be added into any text file including jsp, xhtml и htm(l).</para>
- <para>It's very simple to do this. Place the cursor in the JSP page where you
- want to add a tag and then click the tag in the palette. In the example below, the
- commandButton tag has been inserted. Notice also that if you place the cursor over
- any tag, a balloon tip is shown with all the <emphasis role="italic">
- <property>"tag"</property>
- </emphasis> attributes.</para>
-
+ <para>A new tag can be added into any text file including jsp, htm, html and xhtml.</para>
+ <para>It's very simple to do this. Open your JSP file and place the cursor in a place where you'd
+ like to add a tag and then click that tag in the palette.
+
+ In <property>Insert Tag</property> window, that will appeared after that action, you can set the
+ <emphasis><property>value</property></emphasis> of general and advanced <emphasis><property>attributes</property></emphasis> of the tag that you chose.</para>
+
+ <figure>
+ <title>Inserting Tag</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_25.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>In the example below, the commandButton tag has been inserted.</para>
+
<figure>
<title>Inserting Tag</title>
<mediaobject>
@@ -103,7 +114,11 @@
<imagedata fileref="images/palette/palette_2.png" scale="80"/>
</imageobject>
</mediaobject>
- </figure>
+ </figure>
+ <note> if you place the cursor over
+ any tag, a balloon tip is shown with all the <emphasis role="italic">
+ <property>"tag"</property>
+ </emphasis> attributes.</note>
<para>The cursor position after adding a tag into a file is specified by
"|" symbol in the tag template on the right in the Palette Editor window. </para>
<figure>
@@ -152,86 +167,94 @@
<property>".jar"</property>
</emphasis> that includes your tag library under the lib folder in your project.
</para>
- </section>
-
- <section id="Drag_and_Drop65332">
- <?dbhtml filename="DragAndDrop.html"?>
- <title>Drag-and-Drop</title>
- <para>Switch to the Web Projects view and expand the Tag Libraries folder. If the view
- not active, select <emphasis>
- <property>Window > Show View > Web Projects</property>
- </emphasis> from the menu bar.</para>
-
- <figure>
- <title>Web Projects View</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/palette/palette_3.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Also make sure that the JBoss Tools Palette is open. Select the tag library that
- you want to add and simply drag-and-drop it on to the JBoss Tools Palette.</para>
- <para>You will see the following dialog window. As you can see JBoss Developer Studio
- takes care of all the details. You just need to set the Group name to which to add
- this tag library. You can either add this tag library to an existing Group or just
- create a new one.</para>
- <figure>
- <title>Import Tags From TLD File Form</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/palette/palette_4.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Once you are finished, you will see the new tag library added to the JBoss Tools
- Palette.</para>
-
- <figure>
- <title>JBoss Tools Palette with New Tag Library</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/palette/palette_5.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </section>
- <section id="ImportButton521">
- <?dbhtml filename="ImportButton.html"?>
- <title>Import Button</title>
- <para>The same you can do with <emphasis>
- <property>Import</property>
- </emphasis> button.</para>
- <figure>
+
+ <section id="Drag_and_Drop65332">
+ <?dbhtml filename="DragAndDrop.html"?>
+ <title>Drag-and-Drop</title>
+ <para>Switch to the Web Projects view and expand the Tag Libraries folder. If the view
+ not active, select <emphasis>
+ <property>Window > Show View > Web Projects</property>
+ </emphasis> from the menu bar.</para>
+
+ <figure>
+ <title>Web Projects View</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_3.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>Also make sure that the JBoss Tools Palette is open. Select the tag library that
+ you want to add and simply drag-and-drop it on to the JBoss Tools Palette.</para>
+
+ <para>You will see the following dialog window. As you can see JBoss Developer Studio
+ takes care of all the details. You just need to set the Group name to which you wish to place
+ this tag library. You can either add this tag library to an existing Group or just
+ create a new one.</para>
+
+ <figure>
+ <title>Import Tags From TLD File Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_4.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Once you are finished, you will see the new tag library added to the JBoss Tools
+ Palette.</para>
+
+ <figure>
+ <title>JBoss Tools Palette with New Tag Library</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_5.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
+ <section id="ImportButton521">
+ <?dbhtml filename="ImportButton.html"?>
<title>Import Button</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/palette/palette_6.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>On this screen you can select <emphasis>
- <property>Browse</property>
- </emphasis> to locate the tag library that you want to add.</para>
- <figure>
- <title>Import Tags From TLD File Form</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/palette/palette_7.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- <para>Now select the TLD file you want to be added:</para>
- <figure>
- <title>Select TLD File</title>
- <mediaobject>
- <imageobject>
- <imagedata fileref="images/palette/palette_8.png"/>
- </imageobject>
- </mediaobject>
- </figure>
+ <para>The same you can do with <emphasis><property>Import</property></emphasis> button.
+ You can see this button at the top right side of the JBoss Tools Palette</para>
+
+ <figure>
+ <title>Import Button</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_6.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+
+ <para>By clicking on the Import button you will see the Import Tag window a similar like in the Drag-and-Drop method.
+ On this Import Tag form you can select <emphasis><property>Browse...</property></emphasis> to locate the tag library that you want to add.
+ Also you need to set the Group name to which you'd like to add your tag library. And like in the previous method you can add it to an existing Group or create a new one.</para>
+
+ <figure>
+ <title>Import Tags From TLD File Form</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_7.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>Now select the TLD file you want to be added:</para>
+ <figure>
+ <title>Select TLD File</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/palette/palette_8.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </section>
+
</section>
- </section>
+
+ </section>
<section id="PaletteOptions">
<?dbhtml filename="PaletteOptions.html"?>
@@ -415,8 +438,8 @@
<title>Import</title>
<para>The Import button lets you add a custom or 3rd party tag library to
- <property>JBoss Tools Palette</property>. See <link linkend="ImportButton521"
- >here</link> how to add.
+ JBoss Tools Palette. Find out more information on how to add the tags see the <link linkend="ImportButton521"
+ >Adding Custom JSF Tags</link>section.
<!--<link linkend="CreatingAndWorkingCustomCapability">Learn how to import</link>. --></para>
</section>
@@ -425,11 +448,14 @@
<section id="RichFacesSupport">
<?dbhtml filename="RichFacesSupport.html"?>
<title>Rich Faces Support</title>
- <para>JBoss Developer Studio comes with a tight integration with <emphasis>
- <property>Rich Faces</property>
- </emphasis> component framework. Rich Faces ans Ajax4jsf in JBoss Tools Palette always exist, this palette is not dynamic and is not changed from file to file. After installing JBDS Rich Faces components as well as <emphasis>
- <property>Ajax4jsf</property>
- </emphasis> ones are already on the <property>JBoss Tools Palette</property>:</para>
+
+ <para>JBoss Developer Studio comes with a tight integration with <emphasis><property>Rich Faces</property></emphasis> component framework.
+ Rich Faces and Ajax4jsf in JBoss Tools Palette always exist, this palette is not dynamic and is not changed from file to file.
+ JBoss Tools Palette supports only the last version of the Rich Faces components.
+ <note>If you'd like to know the last version of Rich Faces component framework see <ulink url="http://labs.jboss.com/jbossrichfaces/">JBoss RichFaces</ulink> site.</note>
+ After installing JBDS Rich Faces components as well as
+ <emphasis><property>Ajax4jsf</property></emphasis> ones are already on the <property>JBoss Tools Palette</property>:</para>
+
<figure>
<title>Rich Faces Components</title>
<mediaobject>
@@ -438,6 +464,9 @@
</imageobject>
</mediaobject>
</figure>
+
+ <!-- <para>Insert tag into JSP file </para>-->
+
</section>
</chapter>
18 years, 2 months
JBoss Tools SVN: r5854 - in trunk/seam/plugins: org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2008-01-21 13:41:36 -0500 (Mon, 21 Jan 2008)
New Revision: 5854
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1490 Since that Preference Page can work with a few default runtimes (one for each seam version).
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2008-01-21 18:20:54 UTC (rev 5853)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2008-01-21 18:41:36 UTC (rev 5854)
@@ -115,8 +115,9 @@
runtime.setDefault(true);
}
- if (getDefaultRuntime() != null && runtime.isDefault()) {
- getDefaultRuntime().setDefault(false);
+ SeamRuntime oldDefaultRuntime = getDefaultRuntime(runtime.getVersion());
+ if (oldDefaultRuntime != null && runtime.isDefault()) {
+ oldDefaultRuntime.setDefault(false);
}
runtimes.put(runtime.getName(), runtime);
save();
@@ -230,13 +231,13 @@
*/
public SeamRuntime getDefaultRuntime(SeamVersion version) {
for (SeamRuntime rt : runtimes.values()) {
- if (rt.isDefault()) {
+ if (rt.isDefault() && rt.getVersion() == version) {
return rt;
}
}
return null;
}
-
+
/**
* Return version of configuration
*
@@ -318,4 +319,4 @@
}
}
}
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-01-21 18:20:54 UTC (rev 5853)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2008-01-21 18:41:36 UTC (rev 5854)
@@ -206,12 +206,20 @@
* @return
*/
private Object getSeamRuntimeDefaultValue() {
- return ("".equals(SeamProjectPreferences //$NON-NLS-1$
- .getStringPreference(SeamProjectPreferences.SEAM_DEFAULT_RUNTIME_NAME)) ?
- (SeamRuntimeManager.getInstance().getDefaultRuntime()==null?
- "":SeamRuntimeManager.getInstance().getDefaultRuntime().getName()) : //$NON-NLS-1$
- SeamProjectPreferences
- .getStringPreference(SeamProjectPreferences.SEAM_DEFAULT_RUNTIME_NAME));
+ String seamFacetVersion = model.getProperty(IFacetDataModelProperties.FACET_VERSION_STR).toString();
+ SeamVersion seamVersion = SeamVersion.parseFromString(seamFacetVersion);
+
+ String seamDefaultRuntimeName = SeamProjectPreferences.getStringPreference(SeamProjectPreferences.SEAM_DEFAULT_RUNTIME_NAME);
+ if("".equals(seamDefaultRuntimeName)) {
+ SeamRuntime defaultRuntime = SeamRuntimeManager.getInstance().getDefaultRuntime(seamVersion);
+ if(defaultRuntime==null) {
+ return "";
+ } else {
+ return defaultRuntime.getName();
+ }
+ } else {
+ return seamDefaultRuntimeName;
+ }
}
private DataModelSynchronizer sync;
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2008-01-21 18:20:54 UTC (rev 5853)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamPreferencePage.java 2008-01-21 18:41:36 UTC (rev 5854)
@@ -13,6 +13,7 @@
import java.util.ArrayList;
import java.util.Arrays;
+import java.util.List;
import java.util.Map;
import org.eclipse.jface.preference.PreferencePage;
@@ -32,24 +33,22 @@
* <li>define new </li>
* <li>change exists</li>
* <li>remove</li>
+ * <li>set default ones</li>
* </ul>
*
* @author eskimo
*/
-public class SeamPreferencePage extends PreferencePage implements
- IWorkbenchPreferencePage {
+public class SeamPreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
/**
* Seam Preferences page ID
*/
public static final String SEAM_PREFERENCES_ID = "org.jboss.tools.common.model.ui.seam";
-
+
private static final int COLUMNS = 3;
SeamRuntimeListFieldEditor seamRuntimes = new SeamRuntimeListFieldEditor(
"rtlist", SeamPreferencesMessages.SEAM_PREFERENCE_PAGE_SEAM_RUNTIMES, new ArrayList<SeamRuntime>(Arrays.asList(SeamRuntimeManager.getInstance().getRuntimes()))); //$NON-NLS-1$
-
- SeamRuntime initialDefault;
/**
* Create contents of Seam preferences page. SeamRuntime list editor is
@@ -64,8 +63,6 @@
root.setLayout(gl);
seamRuntimes.doFillIntoGrid(root);
- initialDefault = SeamRuntimeManager.getInstance().getDefaultRuntime();
-
return root;
}
@@ -92,12 +89,17 @@
SeamRuntimeManager.getInstance().removeRuntime(rt);
}
seamRuntimes.getRemoved().clear();
- if (initialDefault != null
- && seamRuntimes.getDefaultSeamRuntime() != initialDefault) {
- initialDefault.setDefault(false);
+ List<SeamRuntime> defaultRuntimes = seamRuntimes.getDefaultSeamRuntimes();
+ // reset all default runtimes
+ for (SeamRuntime seamRuntime : SeamRuntimeManager.getInstance().getRuntimes()) {
+ seamRuntime.setDefault(false);
}
- Map<SeamRuntime, SeamRuntime> changed = seamRuntimes
- .getChangedSeamRuntimes();
+ // set deafult runtimes
+ for (SeamRuntime seamRuntime : defaultRuntimes) {
+ seamRuntime.setDefault(true);
+ }
+ seamRuntimes.getDefaultSeamRuntimes().clear();
+ Map<SeamRuntime, SeamRuntime> changed = seamRuntimes.getChangedSeamRuntimes();
for (SeamRuntime c : changed.keySet()) {
SeamRuntime o = changed.get(c);
o.setHomeDir(c.getHomeDir());
@@ -105,15 +107,11 @@
String oldName = o.getName();
String newName = c.getName();
if (!oldName.equals(newName)) {
- SeamRuntimeManager.getInstance().changeRuntimeName(oldName,
- newName);
+ SeamRuntimeManager.getInstance().changeRuntimeName(oldName, newName);
}
}
seamRuntimes.getChangedSeamRuntimes().clear();
- if (seamRuntimes.getDefaultSeamRuntime() != null) {
- seamRuntimes.getDefaultSeamRuntime().setDefault(true);
- }
SeamRuntimeManager.getInstance().save();
}
@@ -137,4 +135,4 @@
performApply();
return super.performOk();
}
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-01-21 18:20:54 UTC (rev 5853)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/preferences/SeamSettingsPreferencePage.java 2008-01-21 18:41:36 UTC (rev 5854)
@@ -84,7 +84,7 @@
super.setElement(element);
project = (IProject) getElement().getAdapter(IProject.class);
}
-
+
boolean hasSeamSupport() {
return seamProject != null;
}
@@ -92,7 +92,7 @@
@Override
protected Control createContents(Composite parent) {
seamProject = SeamCorePlugin.getSeamProject(project, false);
-
+
boolean cannotBeModified = false;
if(seamProject != null) {
@@ -101,13 +101,13 @@
if(!cannotBeModified) {
cannotBeModified = isEarPartInEarSeamProject(project);
}
-
+
seamEnablement = IFieldEditorFactory.INSTANCE.createCheckboxEditor(
SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_SEAM_SUPPORT, SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_SEAM_SUPPORT, false);
seamEnablement.setValue(hasSeamSupport());
SeamRuntime rs = SeamRuntimeManager.getInstance().getDefaultRuntime();
-
+
List<String> namesAsList = getNameList();
runtime = IFieldEditorFactory.INSTANCE.createComboWithButton(SeamPreferencesMessages.SEAM_SETTINGS_PREFERENCE_PAGE_RUNTIME,
@@ -121,7 +121,7 @@
SeamPreferencePage.SEAM_PREFERENCES_ID,
new String[] {SeamPreferencePage.SEAM_PREFERENCES_ID}, null
);
-
+
prefsdlg.open();
String v = runtime.getValueAsString();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2008-01-21 18:20:54 UTC (rev 5853)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2008-01-21 18:41:36 UTC (rev 5854)
@@ -99,7 +99,7 @@
private Map<SeamRuntime, SeamRuntime> changed = new HashMap<SeamRuntime, SeamRuntime>();
- private SeamRuntime checkedElement = null;
+ private List<SeamRuntime> checkedElements = new ArrayList<SeamRuntime>();
private List<SeamRuntime> added = new ArrayList<SeamRuntime>();
@@ -129,8 +129,8 @@
*
* @return List<SeamRuntime>
*/
- public SeamRuntime getDefaultSeamRuntime() {
- return checkedElement;
+ public List<SeamRuntime> getDefaultSeamRuntimes() {
+ return checkedElements;
}
/**
@@ -271,9 +271,9 @@
tableView.getTable().setHeaderVisible(true);
tableView.addCheckStateListener(new ICheckStateListener() {
public void checkStateChanged(CheckStateChangedEvent event) {
+ SeamRuntime selRt = (SeamRuntime) event.getElement();
if (event.getChecked()) {
SeamRuntime deselRt = null;
- SeamRuntime selRt = (SeamRuntime) event.getElement();
Object[] selRts = tableView.getCheckedElements();
for (int i = 0; i < selRts.length; i++) {
@@ -287,21 +287,23 @@
if (deselRt != null) {
Object[] newChecked = new Object[selRts.length - 1];
+ checkedElements.clear();
int i = 0;
for (Object object : selRts) {
SeamRuntime rt = (SeamRuntime) object;
if (rt.getVersion() != selRt.getVersion()
|| rt == selRt) {
newChecked[i] = rt;
+ checkedElements.add(rt);
i++;
}
}
tableView.setCheckedElements(newChecked);
+ } else {
+ checkedElements.add((SeamRuntime)event.getElement());
}
-
- // checkedElement.setDefault(false);
- checkedElement = (SeamRuntime) event.getElement();
- // checkedElement.setDefault(true);
+ } else {
+ checkedElements.remove(selRt);
}
pcs.firePropertyChange(getName(), null, getValue());
}
@@ -309,9 +311,8 @@
for (SeamRuntime rt : (List<SeamRuntime>) getValue()) {
if (rt.isDefault()) {
- tableView.setCheckedElements(new Object[] {rt});
- checkedElement = rt;
- break;
+ tableView.setChecked(rt, true);
+ checkedElements.add(rt);
}
}
ActionPanel actionPanel = new ActionPanel(root, new BaseAction[] {
@@ -321,6 +322,26 @@
}
/**
+ * Checks all runtimes and set default one (for each version) if user did not do it.
+ */
+ private void setDefaultRuntimes() {
+ List<SeamRuntime> runtimes = (List<SeamRuntime>)getValue();
+ for (SeamRuntime seamRuntime : runtimes) {
+ boolean checked = false;
+ for(SeamRuntime checkedElement: checkedElements) {
+ if(checkedElement.getVersion() == seamRuntime.getVersion()) {
+ checked = true;
+ break;
+ }
+ }
+ if(!checked) {
+ tableView.setChecked(seamRuntime, true);
+ checkedElements.add(seamRuntime);
+ }
+ }
+ }
+
+ /**
* Return array of Controls that forms and editor
*
* @return Control[]
@@ -919,7 +940,6 @@
this.button.setEnabled(action.isEnabled());
this.button.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
ActionButton.this.action.run();
}
@@ -1034,6 +1054,7 @@
.getActiveShell(), wiz);
dialog.open();
tableView.refresh();
+ setDefaultRuntimes();
}
}
@@ -1130,6 +1151,7 @@
removeRuntime(rt);
}
tableView.refresh();
+ setDefaultRuntimes();
}
private void removeRuntime(SeamRuntime r) {
@@ -1151,6 +1173,7 @@
}
((List) getValue()).remove(r);
}
+ checkedElements.remove(r);
}
private boolean isRuntimeUsed(String runtimeName) {
@@ -1165,5 +1188,4 @@
return false;
}
}
-
}
\ No newline at end of file
18 years, 2 months
JBoss Tools SVN: r5853 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-21 13:20:54 -0500 (Mon, 21 Jan 2008)
New Revision: 5853
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1422
roll back
KnownConfigurationsTest update to more complex case
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2008-01-21 18:19:26 UTC (rev 5852)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2008-01-21 18:20:54 UTC (rev 5853)
@@ -28,8 +28,7 @@
TestConsoleConfigurationPreferences cfgprefs = new TestConsoleConfigurationPreferences();
consoleCfg = new ConsoleConfiguration(cfgprefs);
- KnownConfigurations.getInstance().setBroadcast(true);
- KnownConfigurations.getInstance().addConfiguration(consoleCfg);
+ KnownConfigurations.getInstance().addConfiguration(consoleCfg, true);
}
protected void tearDown() throws Exception {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2008-01-21 18:19:26 UTC (rev 5852)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2008-01-21 18:20:54 UTC (rev 5853)
@@ -37,14 +37,11 @@
fail("no sf should be closed!");
}
- public void configurationRemoved(ConsoleConfiguration root) {
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
if(!added.remove(root)) {
fail("trying to remove a non existing console");
}
}
-
- public void configurationRefreshAll() {
- }
}
public void testKnownConfigurations() {
@@ -211,24 +208,22 @@
ConsoleConfiguration configuration = new ConsoleConfiguration(preferences);
ConsoleConfiguration configuration2 = new ConsoleConfiguration(preferences2);
- KnownConfigurations.getInstance().setBroadcast(false);
- knownConfigurations.addConfiguration(configuration);
- knownConfigurations.addConfiguration(configuration2);
+ knownConfigurations.addConfiguration(configuration, false);
+ knownConfigurations.addConfiguration(configuration2, false);
configurations = knownConfigurations.getConfigurations();
assertEquals(2,configurations.length);
assertEquals(listener.added.size(), 0);
- KnownConfigurations.getInstance().setBroadcast(true);
- knownConfigurations.addConfiguration(configuration);
- knownConfigurations.addConfiguration(configuration2);
+ knownConfigurations.addConfiguration(configuration, true);
+ knownConfigurations.addConfiguration(configuration2, true);
configurations = knownConfigurations.getConfigurations();
assertEquals(2,configurations.length);
assertEquals(listener.added.size(), 2);
- knownConfigurations.removeConfiguration(configuration);
- knownConfigurations.removeConfiguration(configuration2);
+ knownConfigurations.removeConfiguration(configuration, false);
+ knownConfigurations.removeConfiguration(configuration2, false);
configurations = knownConfigurations.getConfigurations();
assertEquals(0,configurations.length);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2008-01-21 18:19:26 UTC (rev 5852)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2008-01-21 18:20:54 UTC (rev 5853)
@@ -20,8 +20,7 @@
TestConsoleConfigurationPreferences cfgprefs = new TestConsoleConfigurationPreferences();
consoleCfg = new ConsoleConfiguration(cfgprefs);
- KnownConfigurations.getInstance().setBroadcast(true);
- KnownConfigurations.getInstance().addConfiguration(consoleCfg);
+ KnownConfigurations.getInstance().addConfiguration(consoleCfg, true);
}
protected void tearDown() throws Exception {
18 years, 2 months
JBoss Tools SVN: r5852 - in trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console: node and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-21 13:19:26 -0500 (Mon, 21 Jan 2008)
New Revision: 5852
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1422
roll back
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2008-01-21 17:49:30 UTC (rev 5851)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurations.java 2008-01-21 18:19:26 UTC (rev 5852)
@@ -64,9 +64,6 @@
*/
public class KnownConfigurations {
- // flag broadcast updates to all listeners - true by default
- // for prevent broadcasting set this flag into false
- private boolean broadcastFlag = true;
// TODO: is the best way for the querypage model ?
private QueryPageModel queryPages = new QueryPageModel();
private List configurationListeners = new ArrayList();
@@ -141,7 +138,7 @@
* Add the repository to the receiver's list of known configurations. Doing this will enable
*
*/
- public ConsoleConfiguration addConfiguration(final ConsoleConfiguration configuration) {
+ public ConsoleConfiguration addConfiguration(final ConsoleConfiguration configuration, boolean broadcast) {
// Check the cache for an equivalent instance and if there is one, just update the cache
ConsoleConfiguration existingConfiguration = internalGetRepository(configuration.getName() );
if (existingConfiguration == null) {
@@ -153,7 +150,7 @@
existingConfiguration = configuration;
}
- if (broadcastFlag) {
+ if (broadcast) {
fireNotification(new Notification() {
public void notify(KnownConfigurationsListener listener) {
listener.configurationAdded(configuration);
@@ -167,24 +164,22 @@
ConsoleConfiguration[] cfgs = getConfigurations();
for (int i = 0; i < cfgs.length; i++) {
ConsoleConfiguration configuration = cfgs[i];
- removeConfiguration(configuration);
+ removeConfiguration(configuration, false);
}
}
// added forUpdate as a workaround for letting listeners know it is done to update the configuration so they don't cause removal issues.
- public void removeConfiguration(final ConsoleConfiguration configuration) {
+ public void removeConfiguration(final ConsoleConfiguration configuration, final boolean forUpdate) {
ConsoleConfiguration oldConfig = (ConsoleConfiguration) getRepositoriesMap().remove(configuration.getName() );
if (oldConfig != null) {
oldConfig.removeConsoleConfigurationListener(sfListener);
- if (broadcastFlag) {
- fireNotification(new Notification() {
- public void notify(KnownConfigurationsListener listener) {
- listener.configurationRemoved(configuration);
- }
- });
- }
+ fireNotification(new Notification() {
+ public void notify(KnownConfigurationsListener listener) {
+ listener.configurationRemoved(configuration, forUpdate);
+ }
+ });
oldConfig.reset();
removeLoggingStream( oldConfig );
@@ -352,19 +347,5 @@
return queryParameters;
}
- public boolean getBroadcast() {
- return this.broadcastFlag;
- }
- public void setBroadcast(boolean broadcastFlag) {
- this.broadcastFlag = broadcastFlag;
- if (broadcastFlag) {
- fireNotification(new Notification() {
- public void notify(KnownConfigurationsListener listener) {
- listener.configurationRefreshAll();
- }
- });
- }
- }
-
}
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java 2008-01-21 17:49:30 UTC (rev 5851)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/KnownConfigurationsListener.java 2008-01-21 18:19:26 UTC (rev 5852)
@@ -31,7 +31,5 @@
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory closingFactory);
- public void configurationRemoved(ConsoleConfiguration root);
-
- public void configurationRefreshAll();
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate);
}
\ No newline at end of file
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2008-01-21 17:49:30 UTC (rev 5851)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/node/ConfigurationListNode.java 2008-01-21 18:19:26 UTC (rev 5852)
@@ -52,14 +52,10 @@
childrenCreated=false;
}
- public void configurationRemoved(ConsoleConfiguration root) {
+ public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
markChildrenForReload();
}
- public void configurationRefreshAll() {
- markChildrenForReload();
- }
-
public void sessionFactoryClosing(ConsoleConfiguration configuration, SessionFactory closingFactory) {
}
18 years, 2 months
JBoss Tools SVN: r5851 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-01-21 12:49:30 -0500 (Mon, 21 Jan 2008)
New Revision: 5851
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
Log:
JBIDE-1553 JUnit Test for Seam EL Content Assist
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-01-21 17:47:54 UTC (rev 5850)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTest.java 2008-01-21 17:49:30 UTC (rev 5851)
@@ -35,6 +35,7 @@
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
import org.jboss.tools.seam.ui.text.java.SeamELProposalProcessor;
+import org.jboss.tools.test.util.xpl.EditorTestHelper;
import junit.framework.Test;
import junit.framework.TestCase;
@@ -411,8 +412,9 @@
public void testSeamELContentAssist() {
try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
+// XJob.waitForJob();
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
e.printStackTrace();
}
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
@@ -441,8 +443,9 @@
// Delay for 3 seconds so that
// the Favorites view can be seen.
try {
- XJob.waitForJob();
- } catch (InterruptedException e) {
+// XJob.waitForJob();
+ EditorTestHelper.joinBackgroundActivities();
+ } catch (Exception e) {
e.printStackTrace();
assertTrue("Waiting for the jobs to complete has failed.", false);
}
18 years, 2 months
JBoss Tools SVN: r5850 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-01-21 12:47:54 -0500 (Mon, 21 Jan 2008)
New Revision: 5850
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
Log:
JBIDE-1553 JUnit Test for Seam EL Content Assist
The class SeamELProposalProcessor.Proposal is moved public to allow creation of Content Assistant related JUnit tests
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-01-21 17:34:34 UTC (rev 5849)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/text/java/SeamELProposalProcessor.java 2008-01-21 17:47:54 UTC (rev 5850)
@@ -69,7 +69,7 @@
private static final ICompletionProposal[] NO_PROPOSALS= new ICompletionProposal[0];
private static final IContextInformation[] NO_CONTEXTS= new IContextInformation[0];
- private static final class Proposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension4 {
+ public static final class Proposal implements ICompletionProposal, ICompletionProposalExtension, ICompletionProposalExtension2, ICompletionProposalExtension3, ICompletionProposalExtension4 {
private final String fString;
private final String fPrefix;
18 years, 2 months
JBoss Tools SVN: r5849 - trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2008-01-21 12:34:34 -0500 (Mon, 21 Jan 2008)
New Revision: 5849
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
Log:
JBIDE-1553 JUnit Test for Seam EL Content Assist
Method SourceViewerConfiguration getSVConfiguration() is added to allow creation of Content Assistant related JUnit tests
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-01-21 17:10:31 UTC (rev 5848)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPTextEditor.java 2008-01-21 17:34:34 UTC (rev 5849)
@@ -151,7 +151,7 @@
super
.setSourceViewerConfiguration(new ExtendedStructuredTextViewerConfigurationJSP());
}
-
+
protected void setSourceViewerConfiguration(SourceViewerConfiguration config) {
if (config instanceof StructuredTextViewerConfigurationJSP) {
if (!(config instanceof ExtendedStructuredTextViewerConfigurationJSP)) {
@@ -167,6 +167,10 @@
super.setSourceViewerConfiguration(config);
}
+ public SourceViewerConfiguration getSVConfiguration () {
+ return getSourceViewerConfiguration();
+ }
+
protected void initializeDrop(ITextViewer textViewer) {
Composite c = textViewer.getTextWidget();
18 years, 2 months
JBoss Tools SVN: r5848 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test.
by jbosstools-commits@lists.jboss.org
Author: vyemialyanchyk
Date: 2008-01-21 12:10:31 -0500 (Mon, 21 Jan 2008)
New Revision: 5848
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1422
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2008-01-21 17:07:48 UTC (rev 5847)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2008-01-21 17:10:31 UTC (rev 5848)
@@ -28,7 +28,8 @@
TestConsoleConfigurationPreferences cfgprefs = new TestConsoleConfigurationPreferences();
consoleCfg = new ConsoleConfiguration(cfgprefs);
- KnownConfigurations.getInstance().addConfiguration(consoleCfg, true);
+ KnownConfigurations.getInstance().setBroadcast(true);
+ KnownConfigurations.getInstance().addConfiguration(consoleCfg);
}
protected void tearDown() throws Exception {
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2008-01-21 17:07:48 UTC (rev 5847)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/KnownConfigurationsTest.java 2008-01-21 17:10:31 UTC (rev 5848)
@@ -37,11 +37,14 @@
fail("no sf should be closed!");
}
- public void configurationRemoved(ConsoleConfiguration root, boolean forUpdate) {
+ public void configurationRemoved(ConsoleConfiguration root) {
if(!added.remove(root)) {
fail("trying to remove a non existing console");
}
}
+
+ public void configurationRefreshAll() {
+ }
}
public void testKnownConfigurations() {
@@ -130,21 +133,102 @@
}
};
+
+ ConsoleConfigurationPreferences preferences2 = new ConsoleConfigurationPreferences() {
+
+ String name = "new test";
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public void readStateFrom(Element element) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void writeStateTo(Element node) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public File getPropertyFile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public File getConfigXMLFile() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Properties getProperties() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public File[] getMappingFiles() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public URL[] getCustomClassPathURLS() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public boolean useAnnotations() {
+ // TODO Auto-generated method stub
+ return false;
+ }
+
+ public String getEntityResolverName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public ConfigurationMode getConfigurationMode() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getNamingStrategy() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public String getPersistenceUnitName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ };
+
ConsoleConfiguration configuration = new ConsoleConfiguration(preferences);
+ ConsoleConfiguration configuration2 = new ConsoleConfiguration(preferences2);
- knownConfigurations.addConfiguration(configuration, false);
+ KnownConfigurations.getInstance().setBroadcast(false);
+ knownConfigurations.addConfiguration(configuration);
+ knownConfigurations.addConfiguration(configuration2);
configurations = knownConfigurations.getConfigurations();
- assertEquals(1,configurations.length);
+ assertEquals(2,configurations.length);
assertEquals(listener.added.size(), 0);
- knownConfigurations.addConfiguration(configuration, true);
+ KnownConfigurations.getInstance().setBroadcast(true);
+ knownConfigurations.addConfiguration(configuration);
+ knownConfigurations.addConfiguration(configuration2);
configurations = knownConfigurations.getConfigurations();
- assertEquals(1,configurations.length);
- assertEquals(listener.added.size(), 1);
+ assertEquals(2,configurations.length);
+ assertEquals(listener.added.size(), 2);
- knownConfigurations.removeConfiguration(configuration,false);
+ knownConfigurations.removeConfiguration(configuration);
+ knownConfigurations.removeConfiguration(configuration2);
configurations = knownConfigurations.getConfigurations();
assertEquals(0,configurations.length);
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2008-01-21 17:07:48 UTC (rev 5847)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/QueryParametersTest.java 2008-01-21 17:10:31 UTC (rev 5848)
@@ -20,7 +20,8 @@
TestConsoleConfigurationPreferences cfgprefs = new TestConsoleConfigurationPreferences();
consoleCfg = new ConsoleConfiguration(cfgprefs);
- KnownConfigurations.getInstance().addConfiguration(consoleCfg, true);
+ KnownConfigurations.getInstance().setBroadcast(true);
+ KnownConfigurations.getInstance().addConfiguration(consoleCfg);
}
protected void tearDown() throws Exception {
18 years, 2 months