Author: dennyxu
Date: 2008-11-21 02:05:45 -0500 (Fri, 21 Nov 2008)
New Revision: 11942
Added:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/icons/wizards/esb_runtime.gif
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
JBIDE-3194: Add ESB runtime classpath container page
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2008-11-21
05:20:39 UTC (rev 11941)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2008-11-21
07:05:45 UTC (rev 11942)
@@ -113,6 +113,7 @@
IStatus status = StatusUtils
.errorStatus("Can not find the runtime: " + segment);
ESBProjectCorePlugin.getDefault().getLog().log(status);
+ return new IClasspathEntry[0];
}
String runtimeLocation = serverRuntime.getLocation()
.toOSString();
Added: trunk/esb/plugins/org.jboss.tools.esb.project.ui/icons/wizards/esb_runtime.gif
===================================================================
(Binary files differ)
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/icons/wizards/esb_runtime.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java 2008-11-21
05:20:39 UTC (rev 11941)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/ESBProjectPlugin.java 2008-11-21
07:05:45 UTC (rev 11942)
@@ -1,5 +1,6 @@
package org.jboss.tools.esb.project.ui;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -27,6 +28,8 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ Image img = imageDescriptorFromPlugin(PLUGIN_ID,
"icons/wizards/esb_runtime.gif").createImage();
+ getImageRegistry().put("esb_runtime", img);
}
/*
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-11-21
05:20:39 UTC (rev 11941)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2008-11-21
07:05:45 UTC (rev 11942)
@@ -24,6 +24,13 @@
JBoss_Runtime_List_Field_Editor_Home_Folder=Home Folder:
JBoss_Composite_Editor_This_Method_Can_Be_Invoked=This method can be invoked after
getEditorControls(parent) only
JBoss_Button_Field_Editor_Browse=Browse...
+JBoss_ESBRuntime_Classpath_Container_5=esb_runtime
+JBoss_ESBRuntime_Classpath_Container_Description=Select a ESB runtime to add to the
project classpath
+JBoss_ESBRuntime_Classpath_Container_Name=Name
+JBoss_ESBRuntime_Classpath_Container_RuntimeType=Runtime Type
+JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly=ESB Libraries Only
+JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained=Server Contained
+JBoss_ESBRuntime_Classpath_Container_Title=JBoss ESB Library
Error_JBoss_Button_Field_Editor_Not_Implemented_Yet=Not implemented yet. Please setup
real acion for editor.
JBoss_SWT_Field_Editor_Factory_Browse=Browse...
JBoss_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBoss ESB runtime Home Folder
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2008-11-21
05:20:39 UTC (rev 11941)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2008-11-21
07:05:45 UTC (rev 11942)
@@ -51,6 +51,20 @@
public static String JBoss_Runtime_List_Field_Editor_Home_Folder;
public static String JBoss_Composite_Editor_This_Method_Can_Be_Invoked;
public static String JBoss_Button_Field_Editor_Browse;
+ public static String JBoss_ESBRuntime_Classpath_Container_5;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_Description;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_Name;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_RuntimeType;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained;
+
+ public static String JBoss_ESBRuntime_Classpath_Container_Title;
+
public static String Error_JBoss_Button_Field_Editor_Not_Implemented_Yet;
public static String JBoss_SWT_Field_Editor_Factory_Browse;
public static String JBoss_SWT_Field_Editor_Factory_Select_Home_Folder;
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2008-11-21
05:20:39 UTC (rev 11941)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2008-11-21
07:05:45 UTC (rev 11942)
@@ -3,7 +3,6 @@
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
-import java.util.Set;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -12,7 +11,6 @@
import org.eclipse.jdt.ui.wizards.IClasspathContainerPage;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.viewers.ArrayContentProvider;
-import org.eclipse.jface.viewers.ColumnLayoutData;
import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.ILabelProvider;
import org.eclipse.jface.viewers.ILabelProviderListener;
@@ -23,9 +21,10 @@
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -38,6 +37,8 @@
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
+import org.jboss.tools.esb.project.ui.ESBProjectPlugin;
+import org.jboss.tools.esb.project.ui.messages.JBossESBUIMessages;
public class JBossESBRuntimeContainerPage extends WizardPage implements
IClasspathContainerPage {
@@ -47,9 +48,9 @@
private Object selectedRuntime;
public JBossESBRuntimeContainerPage(){
- super("JBoss ESB Runtime Library");
- setTitle("JBoss ESB Library");
- setDescription("Select a ESB runtime to add to the project classpath");
+ super(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Title);
+ setTitle(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Title);
+ setDescription(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Description);
}
public JBossESBRuntimeContainerPage(String pageName) {
@@ -78,16 +79,17 @@
setPageComplete(isPageComplete());
}});
+ runtimeViewer.addFilter(new ESBRuntimeFilter());
TableLayout tablelayout = new TableLayout();
table.setLayout(tablelayout);
tablelayout.addColumnData(new ColumnWeightData(60));
TableColumn tc1 = new TableColumn(table, SWT.NONE);
- tc1.setText("Name");
+ tc1.setText(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_Name);
tablelayout.addColumnData(new ColumnWeightData(40));
TableColumn tc2 = new TableColumn(table, SWT.NONE);
- tc2.setText("Runtime Type");
+ tc2.setText(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType);
tc1.pack();
tc2.pack();
@@ -123,7 +125,6 @@
public void setSelection(IClasspathEntry containerEntry) {
entry = containerEntry;
- System.out.print(containerEntry);
}
private List getAllAvailableESBRuntimes(){
@@ -147,7 +148,19 @@
return selectedRuntime != null;
}
+ class ESBRuntimeFilter extends ViewerFilter{
+ @Override
+ public boolean select(Viewer viewer, Object parentElement,
+ Object element) {
+ if(element instanceof IRuntime){
+ IPath location = ((IRuntime)element).getLocation();
+ return JBossRuntimeManager.isValidESBServer(location.toOSString());
+ }
+ return true;
+ }
+
+ }
class RuntimeLabelProvider implements ITableLabelProvider{
@@ -157,6 +170,8 @@
if(columnIndex == 0){
if(element instanceof IRuntime){
return serverLabel.getImage(element);
+ }else{
+ return
ESBProjectPlugin.getDefault().getImageRegistry().get(JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_5);
}
}
return null;
@@ -173,9 +188,9 @@
break;
case 1:
if(element instanceof IRuntime){
- return "Server contained";
+ return
JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ServerContained;
}else if(element instanceof JBossRuntime){
- return "ESB Runtime Only";
+ return
JBossESBUIMessages.JBoss_ESBRuntime_Classpath_Container_RuntimeType_ESBLibrariesOnly;
}
break;
}
Show replies by date