JBoss Tools SVN: r13864 - workspace/Denny/esb-example.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-02-27 01:28:25 -0500 (Fri, 27 Feb 2009)
New Revision: 13864
Modified:
workspace/Denny/esb-example/helloworld.zip
Log:
Modified: workspace/Denny/esb-example/helloworld.zip
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Tools SVN: r13863 - workspace/Denny/esb-example.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2009-02-27 01:22:59 -0500 (Fri, 27 Feb 2009)
New Revision: 13863
Modified:
workspace/Denny/esb-example/helloworld.zip
workspace/Denny/esb-example/helloworld_testclient.zip
Log:
Update server runtime to SOA-P 4.3
Modified: workspace/Denny/esb-example/helloworld.zip
===================================================================
(Binary files differ)
Modified: workspace/Denny/esb-example/helloworld_testclient.zip
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Tools SVN: r13862 - in workspace/dart/plugins/org.jboss.tools.smooks.testui: src/org/smooks/tools/testui/java and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-02-27 01:18:13 -0500 (Fri, 27 Feb 2009)
New Revision: 13862
Modified:
workspace/dart/plugins/org.jboss.tools.smooks.testui/plugin.xml
workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceContentProvider.java
workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceLabelProvider.java
workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceModel.java
workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/views/TestProjectsView.java
workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/xml2java/X2JTestRunner.java
Log:
Modified: workspace/dart/plugins/org.jboss.tools.smooks.testui/plugin.xml
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.testui/plugin.xml 2009-02-27 05:56:36 UTC (rev 13861)
+++ workspace/dart/plugins/org.jboss.tools.smooks.testui/plugin.xml 2009-02-27 06:18:13 UTC (rev 13862)
@@ -17,30 +17,11 @@
</view>
</extension>
<extension
- point="org.eclipse.ui.perspectiveExtensions">
- <perspectiveExtension
- targetID="org.eclipse.jdt.ui.JavaPerspective">
- <view
- ratio="0.5"
- relative="org.eclipse.ui.views.TaskList"
- relationship="right"
- id="org.smooks.tools.testui.views.SampleView">
- </view>
- </perspectiveExtension>
- </extension>
- <extension
- point="org.eclipse.help.contexts">
- <contexts
- file="contexts.xml">
- </contexts>
- </extension>
- <extension
point="org.eclipse.ui.editors">
<editor
class="org.smooks.tools.testui.editors.SmooksTestMultiPageEditor"
- contributorClass="org.smooks.tools.testui.editors.MultiPageEditorContributor"
icon="icons/sample.gif"
- id="org.smooks.tools.testui.editors.MultiPageEditor"
+ id="org.smooks.tools.testui.editors.SmooksTestEditor"
name="Smooks Test Editor">
</editor>
</extension>
Modified: workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceContentProvider.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceContentProvider.java 2009-02-27 05:56:36 UTC (rev 13861)
+++ workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceContentProvider.java 2009-02-27 06:18:13 UTC (rev 13862)
@@ -17,7 +17,12 @@
if(!has) return has;
if(bean instanceof JavaBeanInstanceModel){
Object value = ((JavaBeanInstanceModel)bean).getValue();
- if(value == null) return false;
+ if(value == null){
+ if(((JavaBeanInstanceModel)bean).isArray() || ((JavaBeanInstanceModel)bean).isList()) {
+ return true;
+ }
+ return false;
+ }
}
return true;
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceLabelProvider.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceLabelProvider.java 2009-02-27 05:56:36 UTC (rev 13861)
+++ workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceLabelProvider.java 2009-02-27 06:18:13 UTC (rev 13862)
@@ -27,10 +27,14 @@
case 0:
return getText(element);
case 1:
- if(element instanceof JavaBeanInstanceModel){
- Object value = ((JavaBeanInstanceModel)element).getValue();
- if(value != null){
- return value.toString();
+ if (element instanceof JavaBeanInstanceModel) {
+ Object value = ((JavaBeanInstanceModel) element).getValue();
+ if (((JavaBeanInstanceModel) element).isPrimitive()) {
+ if (value != null) {
+ return value.toString();
+ } else {
+ return "null";
+ }
}
}
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceModel.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceModel.java 2009-02-27 05:56:36 UTC (rev 13861)
+++ workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/java/JavaBeanInstanceModel.java 2009-02-27 06:18:13 UTC (rev 13862)
@@ -3,43 +3,30 @@
*/
package org.smooks.tools.testui.java;
+import java.beans.PropertyDescriptor;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Iterator;
import org.jboss.tools.smooks.javabean.model.JavaBeanModel;
/**
* @author Dart
- *
+ *
*/
public class JavaBeanInstanceModel extends JavaBeanModel {
-
+
private Object instanceModel = null;
-
+
public Object getValue(Object args) {
- if(instanceModel == null){
- return null;
- }
- Method readMethod = this.getPropertyDescriptor().getReadMethod();
- if(readMethod != null){
- try {
- readMethod.invoke(instanceModel, args);
- } catch (IllegalArgumentException e) {
- e.printStackTrace();
- } catch (IllegalAccessException e) {
- e.printStackTrace();
- } catch (InvocationTargetException e) {
- e.printStackTrace();
- }
- }
- return null;
+ return instanceModel;
}
-
- public Object getValue(){
+
+ public Object getValue() {
return getValue(null);
}
-
public Object getInstanceModel() {
return instanceModel;
}
@@ -47,17 +34,75 @@
public void setInstanceModel(Object instanceModel) {
this.instanceModel = instanceModel;
}
-
- public JavaBeanInstanceModel(Object instance , String beanId){
+
+ public JavaBeanInstanceModel(Object instance, String beanId) {
this(instance.getClass());
this.setInstanceModel(instance);
String name = getName();
- if(beanId != null){
+ if (beanId != null) {
name += " (" + beanId + ")";
setName(name);
}
}
+ @Override
+ protected JavaBeanModel newChildJavaBean(Class clazz, String name,
+ PropertyDescriptor pd, Class parentClass, boolean lazyLoading) {
+ JavaBeanInstanceModel instance = new JavaBeanInstanceModel(clazz, name);
+ Object obj = null;
+ if (instanceModel != null) {
+ Method method = pd.getReadMethod();
+ if (method != null) {
+ try {
+ obj = method.invoke(instanceModel, null);
+ } catch (IllegalArgumentException e) {
+ e.printStackTrace();
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
+ }
+ }
+ }
+ instance.setInstanceModel(obj);
+ return instance;
+ }
+
+ @Override
+ protected void createArrayChildren(Class<Object> clazz, String name,
+ PropertyDescriptor pd, Class<? extends Object> parentClass,
+ boolean lazyLoad) {
+ if(instanceModel.getClass().isArray()){
+ Object[] objs = (Object[])instanceModel;
+ for (int i = 0; i < objs.length; i++) {
+ Object obj = objs[i];
+ String simpleName = obj.getClass().getSimpleName();
+ simpleName += String.valueOf(i+1);
+ JavaBeanInstanceModel instance = new JavaBeanInstanceModel(obj.getClass(), simpleName);
+ instance.setInstanceModel(obj);
+ addProperty(instance);
+ }
+ }
+ }
+
+ @Override
+ protected void createListChildren(Class<Object> clazz, String name,
+ PropertyDescriptor pd, Class<? extends Object> parentClass,
+ boolean lazyLoad) {
+ int index = 1;
+ if(Collection.class.isAssignableFrom(instanceModel.getClass())){
+ Collection objs = (Collection)instanceModel;
+ for (Iterator iterator = objs.iterator(); iterator.hasNext();index++) {
+ Object obj = iterator.next();
+ String simpleName = obj.getClass().getSimpleName();
+ simpleName += String.valueOf(index);
+ JavaBeanInstanceModel instance = new JavaBeanInstanceModel(obj.getClass(), simpleName);
+ instance.setInstanceModel(obj);
+ addProperty(instance);
+ }
+ }
+ }
+
public JavaBeanInstanceModel(Class beanClass, String name) {
super(beanClass, name);
}
@@ -65,5 +110,5 @@
public JavaBeanInstanceModel(Class beanClass) {
super(beanClass);
}
-
+
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/views/TestProjectsView.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/views/TestProjectsView.java 2009-02-27 05:56:36 UTC (rev 13861)
+++ workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/views/TestProjectsView.java 2009-02-27 06:18:13 UTC (rev 13862)
@@ -197,12 +197,7 @@
drillDownAdapter = new DrillDownAdapter(viewer);
viewer.setContentProvider(new ViewContentProvider());
viewer.setLabelProvider(new ViewLabelProvider());
-
viewer.setSorter(new NameSorter());
-
- // Create the help context id for the viewer's control
- PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(),
- "org.smooks.tools.testui.viewer");
makeActions();
hookContextMenu();
hookDoubleClickAction();
@@ -314,7 +309,7 @@
.getWorkbenchWindow()
.getActivePage()
.openEditor(input,
- "org.smooks.tools.testui.editors.MultiPageEditor");
+ "org.smooks.tools.testui.editors.SmooksTestEditor");
} catch (PartInitException e) {
e.printStackTrace();
}
Modified: workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/xml2java/X2JTestRunner.java
===================================================================
--- workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/xml2java/X2JTestRunner.java 2009-02-27 05:56:36 UTC (rev 13861)
+++ workspace/dart/plugins/org.jboss.tools.smooks.testui/src/org/smooks/tools/testui/xml2java/X2JTestRunner.java 2009-02-27 06:18:13 UTC (rev 13862)
@@ -140,7 +140,7 @@
String beanID = (String) iterator.next();
Object obj = result.getBean(beanID);
if(obj != null){
- JavaBeanInstanceModel instanceModel = new JavaBeanInstanceModel(obj.getClass(),beanID);
+ JavaBeanInstanceModel instanceModel = new JavaBeanInstanceModel(obj,beanID);
resultList.addJavaBean(instanceModel);
}
}
15 years, 10 months
JBoss Tools SVN: r13861 - trunk/as/plugins/org.jboss.ide.eclipse.as.core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2009-02-27 00:56:36 -0500 (Fri, 27 Feb 2009)
New Revision: 13861
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-3756 - that config should be private
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-02-27 01:32:14 UTC (rev 13860)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-02-27 05:56:36 UTC (rev 13861)
@@ -319,7 +319,7 @@
id="org.jboss.ide.eclipse.as.core.server.startupConfiguration"
modes="run,debug,profile"
name="JBoss Application Server Startup Configuration"
- public="true"
+ public="false"
sourceLocatorId="org.eclipse.jdt.launching.sourceLocator.JavaSourceLookupDirector"
sourcePathComputerId="org.eclipse.jst.server.tomcat.core.sourcePathComputer"/>
<launchConfigurationType
15 years, 10 months
JBoss Tools SVN: r13860 - in trunk: birt/plugins/org.jboss.tools.birt.oda.ui and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2009-02-26 20:32:14 -0500 (Thu, 26 Feb 2009)
New Revision: 13860
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jboss_about.png
trunk/birt/plugins/org.jboss.tools.birt.oda.ui/jboss_about.png
trunk/esb/plugins/org.jboss.tools.esb.ui/jboss_about.png
trunk/examples/plugins/org.jboss.tools.project.examples/jboss_about.png
trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/jboss_about.png
trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/jboss_about.png
trunk/jmx/plugins/org.jboss.tools.jmx.ui/jboss_about.png
trunk/portlet/plugins/org.jboss.tools.portlet.ui/jboss_about.png
trunk/smooks/plugins/org.jboss.tools.smooks.ui/jboss_about.png
trunk/struts/plugins/org.jboss.tools.struts.ui/jboss_about.png
trunk/tptp/plugins/org.jboss.tools.eclipse.as.tptp/jboss_about.png
trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/jboss_about.png
trunk/ws/plugins/org.jboss.tools.ws.ui/jboss_about.png
Log:
[JBIDE-3240] new icon
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/birt/plugins/org.jboss.tools.birt.oda.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/esb/plugins/org.jboss.tools.esb.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/freemarker/plugins/org.jboss.ide.eclipse.freemarker/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/jbpm/plugins/org.jboss.tools.jbpm.convert/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/jmx/plugins/org.jboss.tools.jmx.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/struts/plugins/org.jboss.tools.struts.ui/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/tptp/plugins/org.jboss.tools.eclipse.as.tptp/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/vpe/plugins/org.jboss.tools.xulrunner.initializer/jboss_about.png
===================================================================
(Binary files differ)
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/jboss_about.png
===================================================================
(Binary files differ)
15 years, 10 months
JBoss Tools SVN: r13859 - trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-02-26 20:05:26 -0500 (Thu, 26 Feb 2009)
New Revision: 13859
Modified:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
Log:
increase test coverage
Modified: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF 2009-02-27 01:05:16 UTC (rev 13858)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/META-INF/MANIFEST.MF 2009-02-27 01:05:26 UTC (rev 13859)
@@ -10,7 +10,8 @@
org.eclipse.core.runtime,
org.jboss.tools.common.model.ui,
org.jboss.tools.common.model.ui.test,
- org.jboss.tools.common.model.test
+ org.jboss.tools.common.model.test,
+ org.jboss.tools.tests;bundle-version="2.0.0"
Export-Package: org.jboss.tools.jst.web.ui.test
Bundle-ClassPath: jst-web-ui.jar
Bundle-Localization: plugin
15 years, 10 months
JBoss Tools SVN: r13858 - in trunk/jst: tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-02-26 20:05:16 -0500 (Thu, 26 Feb 2009)
New Revision: 13858
Added:
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiPreferencesPagesTest.java
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java
trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
Log:
increase test coverage
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java 2009-02-27 00:55:08 UTC (rev 13857)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.ui/src/org/jboss/tools/jst/web/ui/internal/preferences/LibrarySetsPreferencePage.java 2009-02-27 01:05:16 UTC (rev 13858)
@@ -27,6 +27,7 @@
public class LibrarySetsPreferencePage extends PreferencePage implements
IWorkbenchPreferencePage {
+ public static final String ID = "org.jboss.tools.jst.web.ui.internal.preferences.LibrarySetsPreferencePage";
public static final String BUNDLE_NAME = "preferences";
public static final ResourceBundle BUNDLE = ResourceBundle.getBundle(LibrarySetsPreferencePage.class.getPackage().getName() + "." + BUNDLE_NAME);
String[] librarySets;
Modified: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2009-02-27 00:55:08 UTC (rev 13857)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiAllTests.java 2009-02-27 01:05:16 UTC (rev 13858)
@@ -24,6 +24,7 @@
TestSuite suite = new TestSuite(JstWebUiAllTests.class.getName());
suite.addTestSuite(WebViewsTest.class);
suite.addTestSuite(WebWizardsTest.class);
+ suite.addTestSuite(JstWebUiPreferencesPagesTest.class);
return suite;
}
}
Added: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiPreferencesPagesTest.java
===================================================================
--- trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiPreferencesPagesTest.java (rev 0)
+++ trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiPreferencesPagesTest.java 2009-02-27 01:05:16 UTC (rev 13858)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jst.web.ui.test;
+
+import org.jboss.tools.jst.web.ui.internal.preferences.LibSetPreferencePage;
+import org.jboss.tools.jst.web.ui.internal.preferences.LibrarySetsPreferencePage;
+import org.jboss.tools.tests.PreferencePageTest;
+
+/**
+ * @author eskimo
+ *
+ */
+public class JstWebUiPreferencesPagesTest extends PreferencePageTest {
+
+ public void testLibrarySetsPreferencePage() {
+ doDefaultTest(LibrarySetsPreferencePage.ID,LibrarySetsPreferencePage.class);
+ }
+}
Property changes on: trunk/jst/tests/org.jboss.tools.jst.web.ui.test/src/org/jboss/tools/jst/web/ui/test/JstWebUiPreferencesPagesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
JBoss Tools SVN: r13857 - trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/preferences.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-02-26 19:55:08 -0500 (Thu, 26 Feb 2009)
New Revision: 13857
Modified:
trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/preferences/TilesEditorTabbedPreferencesPage.java
Log:
expose methods to allow test property page from JUnit tests
Modified: trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/preferences/TilesEditorTabbedPreferencesPage.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/preferences/TilesEditorTabbedPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
+++ trunk/jst/plugins/org.jboss.tools.jst.web.tiles.ui/src/org/jboss/tools/jst/web/tiles/ui/preferences/TilesEditorTabbedPreferencesPage.java 2009-02-27 00:55:08 UTC (rev 13857)
@@ -41,8 +41,14 @@
}
public static void openPreferenceDialog() {
- new TilesEditorPreferenceDialog().open();
+ openPreferenceDialog(true);
}
+
+ public static void openPreferenceDialog(boolean block) {
+ TilesEditorPreferenceDialog dialog = new TilesEditorPreferenceDialog();
+ dialog.setBlockOnOpen(block);
+ dialog.open();
+ }
private static class TilesEditorPreferenceDialog extends PreferenceDialog {
public TilesEditorPreferenceDialog() {
15 years, 10 months
JBoss Tools SVN: r13856 - in trunk/jsf: tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-02-26 19:46:46 -0500 (Thu, 26 Feb 2009)
New Revision: 13856
Added:
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiPreferencesPagesTest.java
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFCapabilitiesPreferencesPage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFFlowTabbedPreferencesPage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFImplementationsPreferencesPage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFPagesPreferencesPage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFProjectPreferencesPage.java
trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java
trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
Log:
fix for test errors
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFCapabilitiesPreferencesPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFCapabilitiesPreferencesPage.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFCapabilitiesPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -26,6 +26,9 @@
import org.jboss.tools.jsf.project.capabilities.JSFCapabilities;
public class JSFCapabilitiesPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {
+
+ public static final String ID = "org.jboss.tools.jsf.ui.capabilities";
+
static String[] CAPABILITIES_HEADER = new String[]{"name"};
static String[] FILE_ADDITIONS_HEADER = new String[]{"label"};
static String[] LIB_REFERENCE_HEADER = new String[]{"name"};
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFFlowTabbedPreferencesPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFFlowTabbedPreferencesPage.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFFlowTabbedPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -17,6 +17,9 @@
import org.jboss.tools.jsf.web.JSFTemplate;
public class JSFFlowTabbedPreferencesPage extends TabbedPreferencesPage implements IWorkbenchPreferencePage {
+
+ public static final String ID = "org.jboss.tools.jsf.ui.jsfflowdiagram";
+
public static String JSF_EDITOR_PATH = "%Options%/Struts Studio/Editors/JSF Flow Diagram";
public static String JSF_ADD_VIEW_PATH = "%Options%/Struts Studio/Editors/JSF Flow Diagram/Add View";
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFImplementationsPreferencesPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFImplementationsPreferencesPage.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFImplementationsPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -20,6 +20,8 @@
*/
public class JSFImplementationsPreferencesPage extends AbstractImplementationsPreferencesPage {
+ public static final String ID = "org.jboss.tools.jsf.ui.jsfimplementations";
+
public JSFImplementationsPreferencesPage() {
super();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFPagesPreferencesPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFPagesPreferencesPage.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFPagesPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -19,6 +19,8 @@
*/
public class JSFPagesPreferencesPage extends AbstractPagesPreferencesPage {
+ public static final String ID = "org.jboss.tools.jsf.ui.jsfpages";
+
protected AbstractWebProjectTemplate createHelper() {
return JSFTemplate.getInstance();
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFProjectPreferencesPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFProjectPreferencesPage.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFProjectPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -17,6 +17,8 @@
public class JSFProjectPreferencesPage extends WebProjectPreferencesPage {
+ public static final String ID = "org.jboss.tools.jsf.ui.project";
+
public JSFProjectPreferencesPage() {}
protected String getNewProjectOptionPath() {
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.ui/src/org/jboss/tools/jsf/ui/preferences/JSFStudioPreferencesPage.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -13,7 +13,9 @@
import org.jboss.tools.common.model.ui.preferences.CompanyPreferencesPage;
public class JSFStudioPreferencesPage extends CompanyPreferencesPage {
-
+
+ public static final String ID = "org.jboss.tools.jsf.ui";
+
protected String getKey() {
return "JSFSTUDIO";
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2009-02-27 00:29:44 UTC (rev 13855)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiAllTests.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -11,6 +11,8 @@
package org.jboss.tools.jsf.ui.test;
+import org.jboss.tools.jsf.ui.preferences.JSFCapabilitiesPreferencesPage;
+
import junit.framework.Test;
import junit.framework.TestSuite;
@@ -18,7 +20,7 @@
public static Test suite() {
TestSuite suite = new TestSuite("JSF UI tests");
-
+ suite.addTestSuite(JSFCapabilitiesPreferencesPage.class);
suite.addTestSuite(CssClassNewWizardTest.class);
suite.addTestSuite(CssFileNewWizardTest.class);
suite.addTestSuite(CSSStyleDialogTest.class);
Added: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiPreferencesPagesTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiPreferencesPagesTest.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiPreferencesPagesTest.java 2009-02-27 00:46:46 UTC (rev 13856)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.ui.test;
+
+import org.jboss.tools.jsf.ui.preferences.JSFCapabilitiesPreferencesPage;
+import org.jboss.tools.jsf.ui.preferences.JSFFlowTabbedPreferencesPage;
+import org.jboss.tools.jsf.ui.preferences.JSFImplementationsPreferencesPage;
+import org.jboss.tools.jsf.ui.preferences.JSFPagesPreferencesPage;
+import org.jboss.tools.jsf.ui.preferences.JSFProjectPreferencesPage;
+import org.jboss.tools.jsf.ui.preferences.JSFStudioPreferencesPage;
+import org.jboss.tools.tests.PreferencePageTest;
+
+/**
+ * @author eskimo
+ *
+ */
+public class JsfUiPreferencesPagesTest extends PreferencePageTest {
+
+ public void testJsfCapabilitiesPreferencesPage() {
+ doDefaultTest(JSFCapabilitiesPreferencesPage.ID, JSFCapabilitiesPreferencesPage.class);
+ }
+
+ public void testJSFFlowTabbedPreferencesPage() {
+ doDefaultTest(JSFFlowTabbedPreferencesPage.ID,JSFFlowTabbedPreferencesPage.class);
+ }
+
+ public void testJsfImplementationsPreferencesPage() {
+ doDefaultTest(JSFImplementationsPreferencesPage.ID,JSFImplementationsPreferencesPage.class);
+ }
+
+ public void testJSFPagesPreferencesPage() {
+ doDefaultTest(JSFPagesPreferencesPage.ID,JSFPagesPreferencesPage.class);
+ }
+
+ public void testJsfProjectPreferencesPage() {
+ doDefaultTest(JSFProjectPreferencesPage.ID,JSFProjectPreferencesPage.class);
+ }
+
+ public void testJsfStudioPreferencesPage() {
+ doDefaultTest(JSFStudioPreferencesPage.ID,JSFStudioPreferencesPage.class);
+ }
+}
Property changes on: trunk/jsf/tests/org.jboss.tools.jsf.ui.test/src/org/jboss/tools/jsf/ui/test/JsfUiPreferencesPagesTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years, 10 months
JBoss Tools SVN: r13855 - in trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples: model and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2009-02-26 19:29:44 -0500 (Thu, 26 Feb 2009)
New Revision: 13855
Added:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectModelElement.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
Log:
JBIDE-3849 Filter project examples per site to know the origins of the example
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/Messages.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -14,6 +14,7 @@
public class Messages extends NLS {
private static final String BUNDLE_NAME = "org.jboss.tools.project.examples.messages"; //$NON-NLS-1$
+ public static String NewProjectExamplesWizardPage_Site;
public static String Category_Other;
public static String ECFExamplesTransport_Downloading;
public static String ECFExamplesTransport_Internal_Error;
@@ -45,6 +46,10 @@
public static String NewProjectExamplesWizardPage_Projects;
public static String NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog;
public static String NewProjectExamplesWizardPage_URL;
+ public static String Project_JBoss_Tools_Team_from_jboss_org;
+ public static String Project_Local;
+ public static String Project_Unknown;
+ public static String ProjectExamplesActivator_All;
public static String ProjectExamplesActivator_Waiting;
public static String ProjectUtil_Invalid_URL;
public static String ProjectUtil_Invalid_welcome_element;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -35,7 +35,8 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.project.examples"; //$NON-NLS-1$
-
+ public static final String ALL_SITES = Messages.ProjectExamplesActivator_All;
+
// The shared instance
private static ProjectExamplesActivator plugin;
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/messages.properties 2009-02-27 00:29:44 UTC (rev 13855)
@@ -29,6 +29,11 @@
NewProjectExamplesWizardPage_Projects=Projects:
NewProjectExamplesWizardPage_Show_the_Quick_Fix_dialog=Show the Quick Fix dialog
NewProjectExamplesWizardPage_URL=URL:
+Project_JBoss_Tools_Team_from_jboss_org=JBoss Tools Team from jboss.org
+Project_Local=Local
+Project_Unknown=Unknown
+ProjectExamplesActivator_All=All
ProjectExamplesActivator_Waiting=Waiting...
ProjectUtil_Invalid_URL=Invalid URL\: {0}
ProjectUtil_Invalid_welcome_element=The welcome element has invalid the url attribute
+NewProjectExamplesWizardPage_Site=Site\:
\ No newline at end of file
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Category.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -14,6 +14,7 @@
import java.util.List;
import org.jboss.tools.project.examples.Messages;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
/**
* @author snjeza
@@ -79,4 +80,8 @@
return getName();
}
+ public String getSite() {
+ return ProjectExamplesActivator.ALL_SITES;
+ }
+
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/Project.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -13,6 +13,9 @@
import java.math.BigDecimal;
import java.util.List;
+import org.jboss.tools.project.examples.Messages;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+
/**
* @author snjeza
*
@@ -29,6 +32,7 @@
private boolean welcome;
private String type;
private String welcomeURL;
+ private String site;
public Project() {
name=""; //$NON-NLS-1$
@@ -133,4 +137,21 @@
public void setWelcomeURL(String welcomeURL) {
this.welcomeURL = welcomeURL;
}
+
+ public String getSite() {
+ if (site == null) {
+ if (getUrl().startsWith("http://anonsvn.jboss.org")) { //$NON-NLS-1$
+ site = Messages.Project_JBoss_Tools_Team_from_jboss_org;
+ } else if (getUrl().startsWith("file:")) { //$NON-NLS-1$
+ site = Messages.Project_Local;
+ } else {
+ site = Messages.Project_Unknown;
+ }
+ }
+ return site;
+ }
+
+ public void setSite(String site) {
+ this.site = site;
+ }
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectModelElement.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectModelElement.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectModelElement.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -19,4 +19,5 @@
public String getName();
public String getDescription();
public String getShortDescription();
+ public String getSite();
}
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/model/ProjectUtil.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -150,6 +150,9 @@
if (nodeName.equals("name")) { //$NON-NLS-1$
project.setName(getContent(child));
}
+ if (nodeName.equals("site")) { //$NON-NLS-1$
+ project.setSite(getContent(child));
+ }
if (nodeName.equals("shortDescription")) { //$NON-NLS-1$
project
.setShortDescription(getContent(child));
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2009-02-27 00:17:13 UTC (rev 13854)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/NewProjectExamplesWizardPage.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -11,8 +11,11 @@
package org.jboss.tools.project.examples.wizard;
+import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.IStructuredSelection;
@@ -23,10 +26,13 @@
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
@@ -58,22 +64,46 @@
}
public void createControl(Composite parent) {
- Composite composite = new Composite(parent,SWT.NULL);
+ Composite composite = new Composite(parent,SWT.NONE);
composite.setLayout(new GridLayout(1,false));
GridData gd = new GridData(GridData.FILL_BOTH);
- gd.widthHint= 225;
composite.setLayoutData(gd);
+ Composite siteComposite = new Composite(composite,SWT.NONE);
+ GridLayout gridLayout = new GridLayout(2,false);
+ gridLayout.marginHeight = 0;
+ gridLayout.marginWidth = 0;
+ siteComposite.setLayout(gridLayout);
+ gd = new GridData(SWT.FILL, SWT.BEGINNING, true, false);
+ siteComposite.setLayoutData(gd);
+
+ new Label(siteComposite,SWT.NONE).setText(Messages.NewProjectExamplesWizardPage_Site);
+ final Combo siteCombo = new Combo(siteComposite,SWT.READ_ONLY);
+ siteCombo.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));
+ List<Category> categories = ProjectUtil.getProjects();
+ Set<String> sites = new TreeSet<String>();
+ sites.add(ProjectExamplesActivator.ALL_SITES);
+ for (Category category:categories) {
+ List<Project> projects = category.getProjects();
+ for (Project project:projects) {
+ sites.add(project.getSite());
+ }
+ }
+ String[] items = sites.toArray(new String[0]);
+ siteCombo.setItems(items);
+ siteCombo.setText(ProjectExamplesActivator.ALL_SITES);
+
new Label(composite,SWT.NONE).setText(Messages.NewProjectExamplesWizardPage_Projects);
- ProjectExamplesPatternFilter filter = new ProjectExamplesPatternFilter();
+ final ProjectExamplesPatternFilter filter = new ProjectExamplesPatternFilter();
+
int styleBits = SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER;
- FilteredTree filteredTree = new FilteredTree(composite, styleBits, filter);
+ final FilteredTree filteredTree = new FilteredTree(composite, styleBits, filter);
filteredTree.setBackground(parent.getDisplay().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
- TreeViewer viewer = filteredTree.getViewer();
+ final TreeViewer viewer = filteredTree.getViewer();
Tree tree = viewer.getTree();
tree.setLayoutData(new GridData(GridData.FILL_BOTH));
tree.setFont(parent.getFont());
@@ -81,8 +111,10 @@
viewer.setLabelProvider(new ProjectLabelProvider());
viewer.setContentProvider(new ProjectContentProvider());
- AdaptableList input = new AdaptableList(ProjectUtil.getProjects());
+ final AdaptableList input = new AdaptableList(categories);
+ final SiteFilter siteFilter = new SiteFilter();
+ viewer.addFilter(siteFilter);
viewer.setInput(input);
Label descriptionLabel = new Label(composite,SWT.NULL);
@@ -152,9 +184,17 @@
gd=new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan=2;
showQuickFixButton.setLayoutData(gd);
- //Label showQuickFixLabel = new Label(internal,SWT.NULL);
- //showQuickFixLabel.setText("Show the Quick Fix dialog:");
+ siteCombo.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ siteFilter.setSite(siteCombo.getText());
+ viewer.refresh();
+ }
+
+ });
+
setPageComplete(false);
setControl(composite);
Added: trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java (rev 0)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/wizard/SiteFilter.java 2009-02-27 00:29:44 UTC (rev 13855)
@@ -0,0 +1,52 @@
+package org.jboss.tools.project.examples.wizard;
+
+import java.util.List;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.jboss.tools.project.examples.ProjectExamplesActivator;
+import org.jboss.tools.project.examples.model.Category;
+import org.jboss.tools.project.examples.model.Project;
+import org.jboss.tools.project.examples.model.ProjectModelElement;
+
+public class SiteFilter extends ViewerFilter {
+
+ private String site;
+
+ public SiteFilter() {
+ super();
+ site = ProjectExamplesActivator.ALL_SITES;
+ }
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ if (! (element instanceof ProjectModelElement) ) {
+ return false;
+ }
+ if (element instanceof Category) {
+ Category category = (Category) element;
+ int size = 0;
+ if (site.equals(ProjectExamplesActivator.ALL_SITES)) {
+ size += category.getProjects().size();
+ } else {
+ List<Project> projects = category.getProjects();
+ for (Project project:projects) {
+ if (site.equals(project.getSite())) {
+ size++;
+ }
+ }
+ }
+ return size > 0;
+ }
+ ProjectModelElement model = (ProjectModelElement) element;
+ if ( site.equals(ProjectExamplesActivator.ALL_SITES) || site.equals(model.getSite())) {
+ return true;
+ }
+ return false;
+ }
+
+ public void setSite(String site) {
+ this.site = site;
+ }
+
+}
15 years, 10 months