JBoss Tools SVN: r8743 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2008-06-12 06:24:43 -0400 (Thu, 12 Jun 2008)
New Revision: 8743
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-2298, storing mechanism was updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2008-06-12 10:05:38 UTC (rev 8742)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/selbar/SelectionBar.java 2008-06-12 10:24:43 UTC (rev 8743)
@@ -10,6 +10,8 @@
******************************************************************************/
package org.jboss.tools.vpe.selbar;
+import java.util.ArrayList;
+
import org.eclipse.compare.Splitter;
import org.eclipse.jface.dialogs.IDialogConstants;
import org.eclipse.jface.dialogs.MessageDialogWithToggle;
@@ -30,7 +32,10 @@
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
+import org.jboss.tools.common.meta.XAttribute;
import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.ui.attribute.adapter.AdapterFactory;
+import org.jboss.tools.common.model.ui.attribute.adapter.IModelPropertyEditorAdapter;
import org.jboss.tools.common.model.ui.util.ModelUtilities;
import org.jboss.tools.jst.jsp.preferences.VpePreference;
import org.jboss.tools.vpe.VpePlugin;
@@ -138,6 +143,15 @@
optionsObject.setAttributeValue(
VpePreference.ATT_SHOW_SELECTION_TAG_BAR,
PREFERENCE_STATUS_BAR_DISABLE);
+
+ /*
+ * Fixes http://jira.jboss.com/jira/browse/JBIDE-2298
+ * To get stored in xml XModelObject
+ * should be marked as modified.
+ */
+ optionsObject.setModified(true);
+ performStore(optionsObject);
+
showBar(PREFERENCE_STATUS_BAR_DISABLE);
}
});
@@ -299,7 +313,41 @@
vpeController.getPageContext().getSourceBuilder()
.getStructuredTextViewer().revealRange(offset, 0);
}
+
+ /**
+ * Performs storing model object in the model and xml file.
+ *
+ * @param xmo the model object to store
+ */
+ private void performStore(XModelObject xmo) {
+ if (null == xmo || null == xmo.getModel()
+ || null == xmo.getModelEntity()) {
+ return;
+ }
+
+ ArrayList<IModelPropertyEditorAdapter> adapters = new ArrayList<IModelPropertyEditorAdapter>();
+ XAttribute[] attribute = xmo.getModelEntity().getAttributes();
+ for (int i = 0; i < attribute.length; i++) {
+ if(!attribute[i].isVisible()) {
+ continue;
+ }
+ IModelPropertyEditorAdapter adapter = AdapterFactory.getAdapter(attribute[i], xmo, xmo.getModel());
+ adapters.add(adapter);
+ }
+ /*
+ * Stores model object by its adaptors.
+ */
+ for (IModelPropertyEditorAdapter adapter : adapters) {
+ adapter.store();
+ }
+ /*
+ * Saves model options
+ */
+ xmo.getModel().saveOptions();
+ }
+
+
public String toString() {
StringBuffer st = new StringBuffer("CountItem: ");
st.append(itemCount);
17 years, 10 months
JBoss Tools SVN: r8742 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-06-12 06:05:38 -0400 (Thu, 12 Jun 2008)
New Revision: 8742
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-675
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-06-12 10:03:56 UTC (rev 8741)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-06-12 10:05:38 UTC (rev 8742)
@@ -17,7 +17,6 @@
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.swt.custom.StyledText;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.ui.progress.UIJob;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
@@ -272,4 +271,54 @@
throw getException();
}
}
+ /**
+ * test Visual Editor Refresh method
+ * @throws Throwable
+ */
+ public void testVisualEditorRefreshAdnCloseWhenUIJobIsRunning() throws Throwable {
+ TestUtil.waitForJobs();
+
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+ // Tests CA
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath("JBIDE/675/employee.xhtml", //$NON-NLS-1$
+ IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + "JBIDE/675/employee.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+ // open and get editor
+ final JSPMultiPageEditor part = openEditor(input);
+
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+ styledText.setCaretOffset(951);
+ styledText.insert("<a"); //$NON-NLS-1$
+ styledText.setCaretOffset(953);
+ for(int i=0;i<100;i++) {
+ styledText.insert(""+i); //$NON-NLS-1$
+ TestUtil.delay(30);
+ }
+ Job job = new UIJob("Close editor Job"){ //$NON-NLS-1$
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+
+ part.getVisualEditor().getController().visualRefresh();
+ part.close(false);
+ part.dispose();
+ return Status.OK_STATUS;
+ }};
+ job.setPriority(Job.SHORT);
+ job.schedule(900);
+ TestUtil.delay(450);
+ if(getException()!=null) {
+ throw getException();
+ }
+ }
}
17 years, 10 months
JBoss Tools SVN: r8741 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-06-12 06:03:56 -0400 (Thu, 12 Jun 2008)
New Revision: 8741
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
Log:
http://jira.jboss.org/jira/browse/JBIDE-675
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-06-12 09:17:16 UTC (rev 8740)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-06-12 10:03:56 UTC (rev 8741)
@@ -210,9 +210,11 @@
private XModelTreeListenerSWTSync optionsListener;
// Added by Max Areshkau Fix for JBIDE-1479
private UIJob job = null;
- private LinkedList<Job> jobQueue;
- private IProgressMonitor progressMonitor;
+ private IProgressMonitor progressMonitor;
private UIJob uiJob;
+ //JBIDE-675, visual refresh job
+ private UIJob visualRefresfJob;
+
/**
* Added by Max Areshkau
* JBIDE-675, stores information about modification events
@@ -336,6 +338,12 @@
getChangeEvents().clear();
uiJob=null;
}
+
+ if(visualRefresfJob!=null) {
+ visualRefresfJob.cancel();
+ visualRefresfJob=null;
+ }
+
if (optionsListener != null) {
XModelObject optionsObject = ModelUtilities.getPreferenceModel()
.getByPath(VpePreference.EDITOR_PATH);
@@ -1556,17 +1564,53 @@
}
public void visualRefresh() {
- if (!switcher
- .startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
- return;
- }
- try {
- visualRefreshImpl();
- } catch (Exception e) {
- VpePlugin.reportProblem(e);
- } finally {
- switcher.stopActiveEditor();
- }
+
+ if(visualRefresfJob==null || visualRefresfJob.getState()==Job.NONE) {
+
+ visualRefresfJob =new UIJob(VpeUIMessages.VPE_VISUAL_REFRESH_JOB){
+
+ @Override
+ public IStatus runInUIThread(IProgressMonitor monitor) {
+
+ if(monitor.isCanceled()) {
+
+ return Status.CANCEL_STATUS;
+ }
+
+ if(uiJob!=null &&
+ uiJob.getState()==Job.RUNNING) {
+ uiJob.cancel();
+ getChangeEvents().clear();
+ //wait while ui job is finished
+ schedule(500);
+ } else {
+
+ if(uiJob!=null) {
+
+ uiJob.cancel();
+ }
+ if (!switcher
+ .startActiveEditor(ActiveEditorSwitcher.ACTIVE_EDITOR_SOURCE)) {
+ return Status.CANCEL_STATUS;
+ }
+ try {
+ monitor.beginTask(VpeUIMessages.VPE_VISUAL_REFRESH_JOB, IProgressMonitor.UNKNOWN);
+ visualRefreshImpl();
+ monitor.done();
+ } finally {
+
+ if(switcher!=null) {
+
+ switcher.stopActiveEditor();
+ }
+ }
+ }
+ return Status.OK_STATUS;
+ }};
+
+ visualRefresfJob.setPriority(Job.SHORT);
+ visualRefresfJob.schedule();
+ }
}
void visualRefreshImpl() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-06-12 09:17:16 UTC (rev 8740)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2008-06-12 10:03:56 UTC (rev 8741)
@@ -94,5 +94,6 @@
public static String CONFIRM_SELECTION_BAR_DIALOG_MESSAGE;
public static String CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE;
public static String VPE_UPDATE_JOB_TITLE;
+ public static String VPE_VISUAL_REFRESH_JOB;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-06-12 09:17:16 UTC (rev 8740)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2008-06-12 10:03:56 UTC (rev 8741)
@@ -54,3 +54,4 @@
CONFIRM_SELECTION_BAR_DIALOG_MESSAGE=Hide selection bar ?
CONFIRM_SELECTION_BAR_DIALOG_TOGGLE_MESSAGE=Always hide selection bar without prompt
VPE_UPDATE_JOB_TITLE=Visual Editor View Update
+VPE_VISUAL_REFRESH_JOB=Visual Editor Refresh
17 years, 10 months
JBoss Tools SVN: r8740 - in trunk/ws/plugins: org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-06-12 05:17:16 -0400 (Thu, 12 Jun 2008)
New Revision: 8740
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java
Log:
JBIDE-2263: have option for web.xml updating and default implementation in ui
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/ImplementationClassCreationCommand.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -84,7 +84,14 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
+
+ // if the user does not check the generate implementation class button, do nothing
+ if(!model.isGenImplementation()){
+ return Status.OK_STATUS;
+ }
+
IStatus status = Status.OK_STATUS;
+
try {
List<String> portTypes = model.getPortTypes();
for (String portTypeName : portTypes) {
@@ -263,7 +270,7 @@
implCU.imports().add(importDec);
//importDec = implAST.newImportDeclaration();
//importDec.setName(implAST.newName(LOGGER_CLASS_FULLNAME));
- implCU.imports().add(importDec);
+ //implCU.imports().add(importDec);
// import jaxws WebService
importDec = implAST.newImportDeclaration();
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/MergeWebXMLCommand.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -48,6 +48,10 @@
@Override
public IStatus execute(IProgressMonitor monitor, IAdaptable info)
throws ExecutionException {
+ if(!model.isUpdateWebxml()){
+ return Status.OK_STATUS;
+ }
+
IEnvironment environment = getEnvironment();
IStatus status = null;
ServletDescriptor[] servletDescriptors = new ServletDescriptor[model
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/commands/WSDL2JavaCommand.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -50,12 +50,12 @@
String command = "sh " + WSCONSUEM_FILE_NAME_LINUX;
if(System.getProperty("os.name").toLowerCase().indexOf("win") >= 0){
command = "cmd.exe /c " + WSCONSUEM_FILE_NAME_WIN;
- path.append(WSCONSUEM_FILE_NAME_WIN);
+ path = path.append(WSCONSUEM_FILE_NAME_WIN);
}else{
- path.append(WSCONSUEM_FILE_NAME_LINUX);
+ path = path.append(WSCONSUEM_FILE_NAME_LINUX);
}
- if(!path.toFile().exists()){
+ if(!path.toFile().getAbsoluteFile().exists()){
return StatusUtils.errorStatus(
NLS.bind(JBossWSCreationCoreMessages.Error_Message_Command_File_Not_Found,
new String[] {path.toOSString()}));
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/data/ServiceModel.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -17,6 +17,10 @@
private List<String> serviceClasses;
private boolean isGenWSDL;
private String target;
+
+ private boolean isGenImplementation = true;
+
+ private boolean UpdateWebxml = true;
public List<String> getServiceClasses(){
@@ -127,4 +131,20 @@
public void setTarget(String target){
this.target = target;
}
+
+ public void setGenerateImplementatoin(boolean isGenImpl){
+ this.isGenImplementation = isGenImpl;
+ }
+
+ public boolean isGenImplementation(){
+ return this.isGenImplementation;
+ }
+
+ public boolean isUpdateWebxml(){
+ return this.UpdateWebxml;
+ }
+
+ public void setUpdateWebxml(boolean updateWebxml){
+ this.UpdateWebxml = updateWebxml;
+ }
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCore.properties 2008-06-12 09:17:16 UTC (rev 8740)
@@ -1,8 +1,12 @@
Label_Custom_Package_Name=Custom package name
Label_Catalog_File=Catalog file
Label_Button_Text_Seletion= &Add
+Label_Generate_Impelemtation=Generate default Web Service Implementation class
+Label_Generate_WSDL=Generete WSDL file
Label_Binding_File=Binding files
Label_JaxWS_Target=JAX-WS specification
+Label_Upate_Webxml=Update default Web.xml
+Label_Update_Webxml=Update default Web.xml
Value_Target_0=2.0
Value_Target_1=2.1
Label_Button_Text_Remove=Remove
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/messages/JBossWSCreationCoreMessages.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -19,7 +19,15 @@
public static String Label_Catalog_File;
public static String Label_Button_Text_Seletion;
public static String Label_Binding_File;
+
+ public static String Label_Generate_Impelemtation;
+
+ public static String Label_Generate_WSDL;
public static String Label_JaxWS_Target;
+
+ public static String Label_Upate_Webxml;
+
+ public static String Label_Update_Webxml;
public static String Value_Target_0;
public static String Value_Target_1;
public static String Label_Button_Text_Remove;
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.core/src/org/jboss/tools/ws/creation/core/utils/JBossWSCreationUtils.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -299,7 +299,7 @@
if(jbws != null){
return jbws.getHomeDir();
}else{
- throw new CoreException(StatusUtils.errorStatus("No JBoss Web Service runtime specified."));
+ throw new CoreException(StatusUtils.errorStatus("No JBoss Web Service runtime has been specified."));
}
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -163,11 +163,16 @@
.setBooleanProperty(
IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_IS_SERVER_SUPPLIED,
false);
- String runtimeId = cmbRuntimes.getText();
- model
- .setStringProperty(
- IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID,
- runtimeId);
+ String runtimeId = cmbRuntimes.getText();
+ JbossWSRuntime jbws = JbossWSRuntimeManager.getInstance().findRuntimeByName(runtimeId);
+ if (jbws != null) {
+ model.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_ID, jbws
+ .getName());
+ model.setStringProperty(
+ IJBossWSFacetDataModelProperties.JBOSS_WS_RUNTIME_HOME,
+ jbws.getHomeDir());
+ }
enableUserSupplied(true);
changePageStatus();
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/CodeGenConfigWidget.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -27,6 +27,8 @@
private ServiceModel model;
private Button btnRemove;
+ private Button btnUpdateWebxml;
+ private Button btnGenDefaultImpl;
public CodeGenConfigWidget(ServiceModel model){
this.model = model;
@@ -136,6 +138,36 @@
}
});
+ btnGenDefaultImpl = new Button(configCom, SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ btnGenDefaultImpl.setLayoutData(gd);
+ btnGenDefaultImpl.setText(JBossWSCreationCoreMessages.Label_Generate_Impelemtation);
+ btnGenDefaultImpl.setSelection(true);
+ btnGenDefaultImpl.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ model.setGenerateImplementatoin(btnGenDefaultImpl.getSelection());
+ btnUpdateWebxml.setEnabled(btnGenDefaultImpl.getSelection());
+ if(!btnGenDefaultImpl.getSelection()){
+ model.setUpdateWebxml(false);
+ }else{
+ model.setUpdateWebxml(btnUpdateWebxml.getSelection());
+ }
+ }
+ });
+
+ btnUpdateWebxml = new Button(configCom, SWT.CHECK);
+ gd = new GridData();
+ gd.horizontalSpan = 3;
+ btnUpdateWebxml.setLayoutData(gd);
+ btnUpdateWebxml.setText(JBossWSCreationCoreMessages.Label_Upate_Webxml);
+ btnUpdateWebxml.setSelection(true);
+ btnUpdateWebxml.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ model.setUpdateWebxml(btnUpdateWebxml.getSelection());
+ }
+ });
+
return this;
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java 2008-06-12 08:02:40 UTC (rev 8739)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/widgets/ProviderInvokeCodeGenConfigWidget.java 2008-06-12 09:17:16 UTC (rev 8740)
@@ -12,6 +12,7 @@
package org.jboss.tools.ws.creation.ui.widgets;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridData;
@@ -22,6 +23,7 @@
import org.eclipse.wst.command.internal.env.ui.widgets.SimpleWidgetDataContributor;
import org.eclipse.wst.command.internal.env.ui.widgets.WidgetDataEvents;
import org.jboss.tools.ws.creation.core.data.ServiceModel;
+import org.jboss.tools.ws.creation.core.messages.JBossWSCreationCoreMessages;
/**
* @author Grid Qian
@@ -30,6 +32,7 @@
SimpleWidgetDataContributor {
private ServiceModel model;
+ private Button btnUpdateWebxml;
public ProviderInvokeCodeGenConfigWidget(ServiceModel model) {
this.model = model;
@@ -48,19 +51,25 @@
GridData wsdlGenData = new GridData();
wsdlGenData.horizontalSpan = 2;
wsdlGen.setLayoutData(wsdlGenData);
- wsdlGen.setText("Generete WSDL file");
+ wsdlGen.setText(JBossWSCreationCoreMessages.Label_Generate_WSDL);
wsdlGen.setSelection(false);
- wsdlGen.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {
-
- }
-
+ wsdlGen.addSelectionListener(new SelectionAdapter() {
+
public void widgetSelected(SelectionEvent e) {
model.setGenWSDL(wsdlGen.getSelection());
}
});
+
+ btnUpdateWebxml = new Button(configCom, SWT.CHECK);
+ btnUpdateWebxml.setText(JBossWSCreationCoreMessages.Label_Update_Webxml);
+ btnUpdateWebxml.setSelection(true);
+ btnUpdateWebxml.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ model.setUpdateWebxml(btnUpdateWebxml.getSelection());
+ }
+ });
return this;
}
}
17 years, 10 months
JBoss Tools SVN: r8739 - trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-06-12 04:02:40 -0400 (Thu, 12 Jun 2008)
New Revision: 8739
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java
Log:
JBIDE-2261: modify jbossws classpath container to support jars that are specified by user
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java 2008-06-12 07:19:23 UTC (rev 8738)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeClassPathInitializer.java 2008-06-12 08:02:40 UTC (rev 8739)
@@ -70,17 +70,29 @@
ArrayList<IClasspathEntry> entryList = new ArrayList<IClasspathEntry>();
JbossWSRuntime jbws = JbossWSRuntimeManager.getInstance()
.findRuntimeByName(segment);
- IPath wsPath = null;
- if (jbws != null) {
- wsPath = new Path(jbws.getHomeDir());
+ if (jbws.isUserConfigClasspath()) {
+ for (String jar : jbws.getLibraries()) {
+ entryList.add(getEntry(new Path(jar)));
+ }
+ entries = entryList.toArray(new IClasspathEntry[entryList
+ .size()]);
+ } else {
+ IPath wsPath = null;
+ if (jbws != null) {
+ wsPath = new Path(jbws.getHomeDir());
+ }
+ if (wsPath != null) {
+ IPath libPath = wsPath
+ .append(JbossWSCoreMessages.Dir_Lib);
+ entryList.addAll(Arrays.asList(getEntries(libPath,
+ entryList)));
+ libPath = wsPath.append(JbossWSCoreMessages.Dir_Client);
+ entryList.addAll(Arrays.asList(getEntries(libPath,
+ entryList)));
+ entries = entryList
+ .toArray(new IClasspathEntry[entryList.size()]);
+ }
}
- if (wsPath != null) {
- IPath libPath = wsPath.append(JbossWSCoreMessages.Dir_Lib);
- entryList.addAll(Arrays.asList(getEntries(libPath,entryList)));
- libPath = wsPath.append(JbossWSCoreMessages.Dir_Client);
- entryList.addAll(Arrays.asList(getEntries(libPath,entryList)));
- entries = entryList.toArray(new IClasspathEntry[entryList.size()]);
- }
if (entries == null)
return new IClasspathEntry[0];
}
@@ -92,15 +104,17 @@
.getClasspathEntry();
}
- protected IClasspathEntry[] getEntries(IPath folder, ArrayList<IClasspathEntry> entryList) {
+ protected IClasspathEntry[] getEntries(IPath folder,
+ ArrayList<IClasspathEntry> entryList) {
String[] files = folder.toFile().list();
ArrayList<IClasspathEntry> list = new ArrayList<IClasspathEntry>();
for (int i = 0; i < files.length; i++) {
- if (files[i].endsWith(".jar") && filterJars(files[i],entryList)) {
+ if (files[i].endsWith(".jar")
+ && filterJars(files[i], entryList)) {
list.add(getEntry(folder.append(files[i])));
} else if (folder.append(files[i]).toFile().isDirectory()) {
list.addAll(Arrays.asList(getEntries(folder
- .append(files[i]),entryList)));
+ .append(files[i]), entryList)));
}
}
return list.toArray(new IClasspathEntry[list.size()]);
@@ -123,8 +137,8 @@
}
public boolean filterJars(String jarName, ArrayList<IClasspathEntry> list) {
- for(IClasspathEntry entry : list){
- if(entry.getPath().lastSegment().equals(jarName)){
+ for (IClasspathEntry entry : list) {
+ if (entry.getPath().lastSegment().equals(jarName)) {
return false;
}
}
17 years, 10 months
JBoss Tools SVN: r8738 - in trunk/ws/plugins: org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate and 6 other directories.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-06-12 03:19:23 -0400 (Thu, 12 Jun 2008)
New Revision: 8738
Added:
trunk/ws/plugins/org.jboss.tools.ws.ui/icons/
trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/
trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/jar_obj.gif
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbwsLibraryListFieldEditor.java
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntime.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeListConverter.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JBossWSFacetInstallDataModelProvider.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/JbossWSUIPlugin.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUI.properties
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUIMessages.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java
trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java
Log:
JBIDE-2262: add ui for users to add selected jars instead of adding all jars of runtime to project classpath
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntime.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntime.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntime.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -11,6 +11,9 @@
package org.jboss.tools.ws.core.classpath;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* @author Grid Qian
*/
@@ -21,11 +24,16 @@
String homeDir = null;
boolean defaultRt = false;
+
+ List<String> libraries;
+ private boolean userConfigClasspath;
+
/**
* Default constructor
*/
public JbossWSRuntime() {
+ libraries = new ArrayList<String>();
}
/**
@@ -84,5 +92,22 @@
public boolean isDefault() {
return defaultRt;
}
+
+ public List<String> getLibraries(){
+
+ return this.libraries;
+ }
+
+ public void setLibraries(List<String> libraries){
+ this.libraries = libraries;
+ }
+
+ public boolean isUserConfigClasspath(){
+ return this.userConfigClasspath;
+ }
+
+ public void setUserConfigClasspath(boolean userConfigClasspath){
+ this.userConfigClasspath = userConfigClasspath;
+ }
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeListConverter.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeListConverter.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/classpath/JbossWSRuntimeListConverter.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -1,7 +1,10 @@
package org.jboss.tools.ws.core.classpath;
+import java.util.ArrayList;
+import java.util.Arrays;
import java.util.HashMap;
+import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
@@ -18,11 +21,14 @@
*/
private static final String REGEXP_ESCAPE = "\\";
private static final String COMMA = ",";
+ private static final String LIBRARY_SEPARATOR = ";";
private static final String EMPTY_STRING = "";
private static final String FIELD_SEPARATOR = "|";
private static final String DEFAULT = "default";
private static final String HOME_DIR = "homeDir";
private static final String NAME = "name";
+ private static final String USER_CONFIG_CLASSPATH = "userConfig";
+ private static final String LIBRARY = "libraries";
/**
* Load String to JbossWSRuntime map from String
@@ -55,13 +61,45 @@
rt.setHomeDir(value);
} else if (DEFAULT.equals(name)) {
rt.setDefault(Boolean.parseBoolean(value));
+ }else if(USER_CONFIG_CLASSPATH.equals(name)){
+ rt.setUserConfigClasspath(Boolean.parseBoolean(value));
+ }else if(LIBRARY.equals(name)){
+ if(value != null && !EMPTY_STRING.equals(value)){
+ rt.setLibraries(getLibrariesFromString(value));
+ }
}
+
}
result.put(rt.getName(), rt);
}
return result;
}
+
+ private List<String> getLibrariesFromString(String strLibraries){
+ List<String> libraries = new ArrayList<String>();
+ StringTokenizer st = new StringTokenizer(strLibraries, LIBRARY_SEPARATOR);
+ while(st.hasMoreTokens()){
+ String library = st.nextToken();
+ if(!libraries.contains(library)){
+ libraries.add(library);
+ }
+ }
+ return libraries;
+
+ }
+
+ private String convertListToString(List<String> libraries){
+ String strLib = "";
+ for(String library: libraries){
+ if("".equals(strLib)){
+ strLib = library;
+ }else{
+ strLib = strLib + LIBRARY_SEPARATOR + library;
+ }
+ }
+ return strLib;
+ }
/**
* Convert map String to JbossWSRUntime to string representation
@@ -84,6 +122,10 @@
buffer.append(FIELD_SEPARATOR).append(DEFAULT).append(
FIELD_SEPARATOR);
buffer.append(runtimes[i].isDefault());
+ buffer.append(FIELD_SEPARATOR).append(USER_CONFIG_CLASSPATH).append(FIELD_SEPARATOR);
+ buffer.append(runtimes[i].isUserConfigClasspath());
+ buffer.append(FIELD_SEPARATOR).append(LIBRARY).append(FIELD_SEPARATOR);
+ buffer.append(convertListToString(runtimes[i].getLibraries()));
if (i != runtimes.length - 1) {
buffer.append(COMMA);
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/IJBossWSFacetDataModelProperties.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -30,11 +30,11 @@
String DEFAULT_VALUE_IS_SERVER_SUPPLIED = "1";
- QualifiedName PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME = new QualifiedName(QUALIFIEDNAME_IDENTIFIER,
+ static QualifiedName PERSISTENCE_PROPERTY_QNAME_RUNTIME_NAME = new QualifiedName(QUALIFIEDNAME_IDENTIFIER,
JBOSS_WS_RUNTIME_ID);
- QualifiedName PERSISTENCE_PROPERTY_RNTIME_LOCATION = new QualifiedName(QUALIFIEDNAME_IDENTIFIER,
+ static QualifiedName PERSISTENCE_PROPERTY_RNTIME_LOCATION = new QualifiedName(QUALIFIEDNAME_IDENTIFIER,
JBOSS_WS_RUNTIME_HOME);
- QualifiedName PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME = new QualifiedName(
+ static QualifiedName PERSISTENCE_PROPERTY_SERVER_SUPPLIED_RUNTIME = new QualifiedName(
QUALIFIEDNAME_IDENTIFIER,
PERSISTENT_PROPERTY_IS_SERVER_SUPPLIED_RUNTIME);
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JBossWSFacetInstallDataModelProvider.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JBossWSFacetInstallDataModelProvider.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/facet/delegate/JBossWSFacetInstallDataModelProvider.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -10,24 +10,14 @@
******************************************************************************/
package org.jboss.tools.ws.core.facet.delegate;
-import java.io.File;
-import java.io.IOException;
import java.util.Set;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Platform;
import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-/**
- * Data model provider for Seam facet wizard page
- *
- * @author eskimo
- *
- */
+
public class JBossWSFacetInstallDataModelProvider extends
FacetInstallDataModelProvider implements IJBossWSFacetDataModelProperties {
- private static final String EMPTY_STRING = "";
/**
* Returns set of facet properties for facet wizard page
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/jar_obj.gif
===================================================================
(Binary files differ)
Property changes on: trunk/ws/plugins/org.jboss.tools.ws.ui/icons/obj16/jar_obj.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/JbossWSUIPlugin.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/JbossWSUIPlugin.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/JbossWSUIPlugin.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -11,6 +11,7 @@
package org.jboss.tools.ws.ui;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -58,4 +59,8 @@
return plugin;
}
+ public static ImageDescriptor getImageDescriptor(String path) {
+ path = "icons/" + path; //$NON-NLS-1$
+ return AbstractUIPlugin.imageDescriptorFromPlugin("org.jboss.tools.ws.ui", path); //$NON-NLS-1$
+ }
}
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUI.properties
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUI.properties 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUI.properties 2008-06-12 07:19:23 UTC (rev 8738)
@@ -32,4 +32,5 @@
JBossWS_SWT_Field_Editor_Factory_Browse=Browse...
JBossWS_SWT_Field_Editor_Factory_Select_Home_Folder=Select JBossWS Home Folder
JBossWS_Runtime_List_Field_Editor_Name2=Name:
+JBossWS_Runtime_Check_Field_Default_Classpath=Configure JBoss Web Service Classpath
JBossWS_Preference_Page_Runtimes=JBossWS Runtimes
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUIMessages.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUIMessages.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/messages/JbossWSUIMessages.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -59,6 +59,7 @@
public static String JBossWS_SWT_Field_Editor_Factory_Browse;
public static String JBossWS_SWT_Field_Editor_Factory_Select_Home_Folder;
public static String JBossWS_Runtime_List_Field_Editor_Name2;
+ public static String JBossWS_Runtime_Check_Field_Default_Classpath;
public static String JBossWS_Preference_Page_Runtimes;
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/ButtonFieldEditor.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -24,6 +24,7 @@
public class ButtonFieldEditor extends BaseFieldEditor {
PushButtonField button= null;
+ int style;
private ButtonPressedAction buttonAction = new ButtonPressedAction(JbossWSUIMessages.JBossWS_Button_Field_Editor_Browse) {
@Override
@@ -32,8 +33,9 @@
}
};
- public ButtonFieldEditor(String name, String label) {
+ public ButtonFieldEditor(String name, String label, int style) {
super(name, label, new Object());
+ this.style = style;
}
public ButtonFieldEditor(String name, ButtonPressedAction action, Object defaultValue) {
@@ -69,7 +71,7 @@
@Override
public Object[] getEditorControls(Object composite) {
if(button==null && composite!=null) {
- button = new PushButtonField((Composite)composite,buttonAction);
+ button = new PushButtonField((Composite)composite, style, buttonAction);
setEnabled(isEnabled());
}
return new Control[]{button.getControl()};
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossRuntimeListFieldEditor.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -400,6 +400,7 @@
private static final String SRT_NAME = "name";
private static final String SRT_HOMEDIR = "homeDir";
+ private static final String SRT_DEFAULT = "defaultClasspath";
private static final int GL_PARENT_COLUMNS = 1;
private static final int GL_CONTENT_COLUMNS = 3;
@@ -415,6 +416,8 @@
""); //$NON-NLS-1$
JbossWSRuntime current = null;
+
+ IFieldEditor jars = null;
public JbossWSRuntimeWizardPage(List<JbossWSRuntime> editedList) {
super(
@@ -444,9 +447,15 @@
name.addPropertyChangeListener(this);
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
+
+ jars = new JbwsLibraryListFieldEditor("", "",
+ current);
+ jars.doFillIntoGrid(root);
+ jars.addPropertyChangeListener(this);
setPageComplete(false);
setControl(root);
}
+
/**
* Process evt: setup default values based on JbossWS Home folder and
@@ -495,13 +504,25 @@
}
}
+ JbossWSRuntime jarJbws = (JbossWSRuntime)jars.getValue();
if (current != null
&& current.getName().equals(name.getValueAsString())
- && current.getHomeDir().equals(homeDir.getValueAsString())) {
+ && current.getHomeDir().equals(homeDir.getValueAsString())
+ && current.isUserConfigClasspath() == jarJbws.isUserConfigClasspath()
+ && (!jarJbws.isUserConfigClasspath()
+ || hasSameLibraies(current.getLibraries(), jarJbws.getLibraries()))) {
+
setErrorMessage(null);
setPageComplete(false);
return;
}
+
+ if(jarJbws.isUserConfigClasspath()
+ && jarJbws.getLibraries().size() == 0){
+ setErrorMessage("The library must contian at least one jar.");
+ setPageComplete(false);
+ return;
+ }
if (homeDir.getValueAsString() == null
|| "".equals(homeDir.getValueAsString().trim())) { //$NON-NLS-1$
@@ -520,6 +541,14 @@
setPageComplete(true);
}
+ private boolean hasSameLibraies(List<String> lib1, List<String> lib2){
+ if(lib1.size() != lib2.size()) return false;
+ for(String jar: lib1){
+ if(!lib2.contains(jar)) return false;
+ }
+
+ return true;
+ }
/**
* Return JbossWS Runtime instance initialized by user input
*
@@ -529,6 +558,9 @@
JbossWSRuntime newRt = new JbossWSRuntime();
newRt.setName(name.getValueAsString());
newRt.setHomeDir(homeDir.getValueAsString());
+ JbossWSRuntime rt = (JbossWSRuntime)jars.getValue();
+ newRt.setLibraries(rt.getLibraries());
+ newRt.setUserConfigClasspath(rt.isUserConfigClasspath());
return newRt;
}
@@ -557,6 +589,8 @@
return editor;
}
+
+
public ButtonFieldEditor.ButtonPressedAction createSelectFolderAction(
String buttonName) {
return new ButtonFieldEditor.ButtonPressedAction(buttonName) {
@@ -693,13 +727,12 @@
@Override
public boolean performFinish() {
JbossWSRuntime rt = page1.getRuntime();
- if (rt.getName().equals(source.getName())
- && rt.getHomeDir().equals(source.getHomeDir())) {
- return true;
- }
+
if (added.contains(source) || changed.containsKey(source)) {
source.setName(rt.getName());
source.setHomeDir(rt.getHomeDir());
+ source.setUserConfigClasspath(rt.isUserConfigClasspath());
+ source.setLibraries(rt.getLibraries());
} else {
changed.put(rt, source);
if (source.isDefault()) {
@@ -980,7 +1013,7 @@
tableView.setSelection(new StructuredSelection(c));
}
}
- if (c != null & c.isDefault()) {
+ if (c != null && c.isDefault()) {
checkedElement = c;
}
setDefaultRuntime();
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbossWSRuntimePreferencePage.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -105,6 +105,8 @@
newName);
}
o.setDefault(c.isDefault());
+ o.setUserConfigClasspath(c.isUserConfigClasspath());
+ o.setLibraries(c.getLibraries());
}
jbossWSRuntimes.getChangedJbossWSRuntimes().clear();
Added: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbwsLibraryListFieldEditor.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbwsLibraryListFieldEditor.java (rev 0)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/JbwsLibraryListFieldEditor.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -0,0 +1,588 @@
+/*******************************************************************************
+ * Copyright (c) 2008 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.ws.ui.preferences;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ILabelProvider;
+import org.eclipse.jface.viewers.ILabelProviderListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.jboss.tools.ws.core.classpath.JbossWSRuntime;
+import org.jboss.tools.ws.ui.JbossWSUIPlugin;
+import org.jboss.tools.ws.ui.messages.JbossWSUIMessages;
+
+/**
+ * @author Grid Qian
+ */
+public class JbwsLibraryListFieldEditor extends BaseFieldEditor {
+
+ // ------------------------------------------------------------------------
+ // Layout parameters
+ // ------------------------------------------------------------------------
+
+ static final int GL_COLUMNS = 2;
+ static final int GL_HINT_HEIGHT = 200;
+ static final int TC_DEFAULT_WIDTH = 21;
+ static final int TC_NAME_WIDTH = 100;
+ static final int TC_VERSION_WIDTH = 50;
+ static final int TC_PATH_WIDTH = 100;
+
+ // ------------------------------------------------------------------------
+ // Field declarations
+ // ------------------------------------------------------------------------
+
+ private TreeViewer listView = null;
+
+ private Composite root = null;
+
+ private ActionPanel actionPanel;
+
+ private JbossWSRuntime tempJbws;
+
+
+
+
+ private Group jarGroup;
+
+ // ------------------------------------------------------------------------
+ // Constructors
+ // ------------------------------------------------------------------------
+
+ /**
+ * Control for editing jbossWSRuntime list
+ *
+ * @param name
+ * String
+ * @param label
+ * String
+ * @param defaultValue
+ * Object
+ */
+ public JbwsLibraryListFieldEditor(String name, String label,
+ JbossWSRuntime jbws) {
+ super(name, label, jbws);
+ this.tempJbws = new JbossWSRuntime();
+ if(jbws != null){
+ this.tempJbws.setUserConfigClasspath(jbws.isUserConfigClasspath());
+ this.tempJbws.getLibraries().addAll(jbws.getLibraries());
+ }
+
+ }
+
+
+ public Object getValue(){
+ return this.tempJbws;
+ }
+ /**
+ * TBD
+ *
+ * @param composite
+ * Object - instance of Composite
+ * @return Object[]
+ */
+ @Override
+ public Object[] getEditorControls(Object composite) {
+
+ root = new Composite((Composite) composite, SWT.NONE);
+ GridData gd = new GridData();
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+ root.setLayoutData(gd);
+
+ root.setLayout(new GridLayout());
+
+ createCheckButton(root);
+
+ jarGroup = new Group(root, SWT.BORDER);
+ jarGroup.setText("Library Jars");
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalAlignment = GridData.FILL;
+ gd.grabExcessHorizontalSpace = true;
+
+
+ jarGroup.setLayoutData(gd);
+ jarGroup.setLayout(new FormLayout());
+
+ createListView(jarGroup);
+ createActionBar(jarGroup);
+
+ FormData listData = new FormData();
+ listData.left = new FormAttachment(0, 5);
+ listData.right = new FormAttachment(actionPanel, -5);
+ listData.top = new FormAttachment(0, 5);
+ listData.bottom = new FormAttachment(100, -5);
+ listView.getControl().setLayoutData(listData);
+
+ FormData actionsData = new FormData();
+ actionsData.top = new FormAttachment(0, 5);
+ actionsData.bottom = new FormAttachment(100, -5);
+ actionsData.right = new FormAttachment(100, -5);
+ actionPanel.setLayoutData(actionsData);
+
+ setJarGroupStatus();
+ return new Control[] { root };
+ }
+
+ protected void createCheckButton(Composite parent){
+ final Button btnDefault = new Button(parent, SWT.CHECK);
+ btnDefault.setText(JbossWSUIMessages.JBossWS_Runtime_Check_Field_Default_Classpath);
+ GridData gd = new GridData();
+ gd.horizontalSpan = 2;
+ btnDefault.setLayoutData(gd);
+
+ btnDefault.setSelection(tempJbws.isUserConfigClasspath());
+ btnDefault.addSelectionListener(new SelectionAdapter(){
+ public void widgetSelected(SelectionEvent e) {
+ tempJbws.setUserConfigClasspath(btnDefault.getSelection());
+ setJarGroupStatus();
+ setValue(null);
+ }
+ });
+
+
+ }
+
+ protected void setJarGroupStatus(){
+ boolean isUserConfig = tempJbws.isUserConfigClasspath();
+ jarGroup.setEnabled(isUserConfig);
+ listView.getTree().setEnabled(isUserConfig);
+ actionPanel.setEnabled(isUserConfig);
+ }
+ @SuppressWarnings("unchecked")
+ protected void createListView(Composite parent) {
+ listView = new TreeViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
+ listView.getTree().setLayoutData(new GridData(GridData.FILL_BOTH));
+
+ listView.setContentProvider(new ITreeContentProvider() {
+
+ @SuppressWarnings("unchecked")
+ public Object[] getElements(Object inputElement) {
+ if (inputElement instanceof JbossWSRuntime) {
+ return ((JbossWSRuntime) inputElement).getLibraries().toArray();
+ } else {
+ throw new IllegalArgumentException(
+ JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_Inputelement_Must_Be
+ + JbossWSUIMessages.JBossWS_Runtime_List_Field_Editor_An_Instance_Of_List);
+ }
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput,
+ Object newInput) {
+ viewer.refresh();
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public Object getParent(Object element) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ // TODO Auto-generated method stub
+ return false;
+ }
+ });
+
+ listView.setLabelProvider(new ILabelProvider() {
+
+ Image jarImg;
+ public void addListener(ILabelProviderListener listener) {
+ }
+
+ public void dispose() {
+ }
+
+ public boolean isLabelProperty(Object element, String property) {
+ return false;
+ }
+
+ public void removeListener(ILabelProviderListener listener) {
+ }
+
+ public Image getImage(Object element) {
+ if (jarImg == null){
+ ImageDescriptor jarImgDesc = JbossWSUIPlugin.getImageDescriptor("obj16/jar_obj.gif");
+ jarImg = jarImgDesc.createImage();
+ }
+ return jarImg;
+ }
+
+ public String getText(Object element) {
+ String fullName = (String)element;
+ File jarFile = new File(fullName);
+ return jarFile.getName() + " - " + jarFile.getParentFile().toString();
+ }
+ });
+
+
+ listView.setInput(getValue());
+
+ }
+
+ protected void createActionBar(Composite parent) {
+ actionPanel = new ActionPanel(parent, new BaseAction[] { new AddAction(),
+ new RemoveAction() });
+ listView.addSelectionChangedListener(actionPanel);
+ }
+
+
+
+ /**
+ * Return array of Controls that forms and editor
+ *
+ * @return Control[]
+ */
+ @Override
+ public Object[] getEditorControls() {
+ return new Control[] { root };
+ }
+
+ /**
+ * Return number of controls in editor
+ *
+ * @return int
+ */
+ @Override
+ public int getNumberOfControls() {
+ return 1;
+ }
+
+ /**
+ * Fill wizard page with editors
+ *
+ * @param parent
+ * Composite - parent composite
+ */
+ @Override
+ public void doFillIntoGrid(Object parent) {
+ Assert.isTrue(parent instanceof Composite,
+ JbossWSUIMessages.Error_JBossWS_Basic_Editor_Composite);
+ Assert.isTrue(((Composite) parent).getLayout() instanceof GridLayout,
+ JbossWSUIMessages.Error_JBossWS_Basic_Editor_Support);
+ Composite aComposite = (Composite) parent;
+ getEditorControls(aComposite);
+ GridLayout gl = (GridLayout) ((Composite) parent).getLayout();
+
+ GridData gd = new GridData();
+ gd.horizontalSpan = gl.numColumns;
+ gd.grabExcessHorizontalSpace = true;
+ gd.horizontalAlignment = GridData.FILL;
+
+ ((Control) getEditorControls()[0]).setLayoutData(gd);
+ }
+
+
+
+ /**
+ * Composite that holds list of BaseActions and presents them as column of
+ * buttons
+ *
+ */
+ public static class ActionPanel extends Composite implements
+ ISelectionChangedListener {
+
+ private BaseAction[] actions = null;
+
+ /**
+ * Constructor creates panel with style, grid layout and buttons
+ * represented the actions
+ *
+ * @param parent
+ * Composite
+ * @param style
+ * int
+ * @param actions
+ * BaseAction[]
+ */
+ public ActionPanel(Composite parent, int style, BaseAction[] actions) {
+ super(parent, style);
+ this.actions = actions;
+ setLayout(new GridLayout(1, false));
+ for (BaseAction action : this.actions) {
+ new ActionButton(this, SWT.PUSH, action);
+ }
+ }
+
+ /**
+ * Constructor creates panel with default style, grid layout and buttons
+ * represented the actions
+ *
+ * @param parent
+ * Composite
+ * @param actions
+ * BaseAction[]
+ */
+ public ActionPanel(Composite parent, BaseAction[] actions) {
+ this(parent, SWT.NONE, actions);
+ }
+
+ /**
+ * Listen to the selection changes and update actions state
+ * (enable/disable)
+ *
+ * @param event
+ * SelectionChangeEvent
+ * @see org.eclipse.jface.viewers.ISelectionChangedListener#selectionChanged(org.eclipse.jface.viewers.SelectionChangedEvent)
+ */
+ public void selectionChanged(SelectionChangedEvent event) {
+ for (BaseAction action : actions) {
+ action.setSelection(event.getSelection());
+ }
+ }
+ }
+
+ /**
+ * Class represents an BaseAction as SWT button control and runs action when
+ * button is prtessed
+ *
+ */
+ public static class ActionButton implements IPropertyChangeListener {
+
+ private Button button;
+ private BaseAction action;
+
+ /**
+ * Create Button control with parent control and style that represents
+ * action
+ *
+ * @param parent
+ * Composite
+ * @param style
+ * int
+ * @param action
+ * BaseAction
+ */
+ public ActionButton(Composite parent, int style, BaseAction action) {
+ this.button = new Button(parent, style);
+ this.action = action;
+
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL,
+ GridData.CENTER, false, false);
+
+ gd.horizontalAlignment = GridData.FILL;
+ gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
+ this.button.setLayoutData(gd);
+ this.action.addPropertyChangeListener(this);
+ this.button.setText(action.getText());
+ this.button.setEnabled(action.isEnabled());
+ this.button.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ ActionButton.this.action.run();
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ }
+
+ /**
+ * Return SWT button control that calls provided action
+ *
+ * @return Control - button swt control
+ */
+ public Control getControl() {
+ return button;
+ }
+
+ /**
+ * Update enabled/disabled button state
+ *
+ * @param event
+ * PropertyChangeEvent
+ * @see org.eclipse.jface.util.IPropertyChangeListener#propertyChange(org.eclipse.jface.util.PropertyChangeEvent)
+ */
+ public void propertyChange(PropertyChangeEvent event) {
+ if (event.getProperty().equals(IAction.ENABLED)) {
+ button.setEnabled(((Boolean) event.getNewValue())
+ .booleanValue());
+ }
+ }
+ }
+
+ /**
+ * Action that changes state enable/disable based on current table selection
+ *
+ */
+ public abstract class BaseAction extends Action {
+
+ String[] jars = new String[0];
+
+ /**
+ * Constructor creates action with provided name
+ *
+ * @param name
+ * String - action name
+ */
+ public BaseAction(String name) {
+ super(name);
+ updateEnablement();
+ }
+
+ /**
+ * Set current selection
+ *
+ * @param selection
+ * ISelection - selected items
+ */
+ public void setSelection(ISelection selection) {
+ if (selection instanceof IStructuredSelection) {
+ List<String> rts = new ArrayList<String>();
+ for (Object jarfile : ((IStructuredSelection) selection).toArray()) {
+ rts.add((String) jarfile);
+ }
+ jars = rts.toArray(new String[] {});
+ } else {
+ jars = new String[0];
+ }
+ updateEnablement();
+ }
+
+ protected abstract void updateEnablement();
+ }
+
+ /**
+ * Action that invokes New JbossWS Runtime Dialog
+ *
+ */
+ public class AddAction extends BaseAction {
+
+ static final String ACTION_NAME = "&Add";
+
+ /**
+ * Constructor create Add action with default name
+ */
+ public AddAction() {
+ super(ACTION_NAME);
+ // This action is always available
+ setEnabled(true);
+ }
+
+ /**
+ * Do nothing, because Add action should be always available
+ */
+ @Override
+ protected void updateEnablement() {
+ // Add button is always available
+ }
+
+ /**
+ * Invoke New JbossWS Runtime Dialog
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @SuppressWarnings("unchecked")
+ @Override
+ public void run() {
+ FileDialog dialog = new FileDialog(Display.getCurrent()
+ .getActiveShell(), SWT.MULTI);
+ dialog.setFilterExtensions(new String[] { "*.jar;*.zip" });
+ String fileName = dialog.open();
+ String[] fileNames = dialog.getFileNames();
+ if (fileName != null) {
+ File filePath = new File(fileName);
+ filePath = filePath.getParentFile();
+ for (int i = 0; i < fileNames.length; i++) {
+ IPath path = new Path(filePath.getAbsolutePath())
+ .append(fileNames[i]);
+ if (!tempJbws.getLibraries().contains(path.toOSString())) {
+ tempJbws.getLibraries().add(path.toOSString());
+ }
+ }
+
+ listView.refresh();
+ setValue(null);
+ }
+ }
+ }
+
+
+ /**
+ * Action deletes all selected JbossWS Runtimes. A warning message is shown
+ * for used JbossWS Runtimes
+ *
+ */
+ public class RemoveAction extends BaseAction {
+
+ static final String ACTION_NAME = "&Remove";
+
+ /**
+ * Create DeleteAction action with default name
+ */
+ public RemoveAction() {
+ super(ACTION_NAME);
+ }
+
+ @Override
+ protected void updateEnablement() {
+ setEnabled(jars.length > 0);
+ }
+
+ /**
+ * Remove all selected JbossWS Runtimes one by one
+ *
+ * @see org.eclipse.jface.action.Action#run()
+ */
+ @Override
+ public void run() {
+ for (String jar : jars) {
+ tempJbws.getLibraries().remove(jar);
+ }
+ listView.refresh();
+ // just try to fire property change listener
+ setValue(null);
+ }
+
+
+ }
+}
\ No newline at end of file
Modified: trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java 2008-06-12 07:13:33 UTC (rev 8737)
+++ trunk/ws/plugins/org.jboss.tools.ws.ui/src/org/jboss/tools/ws/ui/preferences/PushButtonField.java 2008-06-12 07:19:23 UTC (rev 8738)
@@ -11,7 +11,6 @@
package org.jboss.tools.ws.ui.preferences;
-import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
@@ -34,8 +33,8 @@
}
- public PushButtonField(Composite composite, ButtonPressedAction listener) {
- button = new Button(composite,SWT.PUSH);
+ public PushButtonField(Composite composite, int style, ButtonPressedAction listener) {
+ button = new Button(composite, style);
button.setText(listener.getText());
button.addSelectionListener(listener);
}
17 years, 10 months
JBoss Tools SVN: r8737 - in trunk/ws/plugins/org.jboss.tools.ws.core: src/org/jboss/tools/ws/core and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-06-12 03:13:33 -0400 (Thu, 12 Jun 2008)
New Revision: 8737
Modified:
trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF
trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCorePlugin.java
Log:
JBIDE-2047: set default server and runtime: jbossws and jboss server for jboss web service generation
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF 2008-06-12 02:11:49 UTC (rev 8736)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/META-INF/MANIFEST.MF 2008-06-12 07:13:33 UTC (rev 8737)
@@ -20,7 +20,8 @@
org.eclipse.jst.jsf.core,
org.eclipse.jst.jsf.ui,
org.eclipse.jdt.launching,
- org.eclipse.jst.j2ee
+ org.eclipse.jst.j2ee,
+ org.eclipse.jst.ws.consumption.ui
Eclipse-LazyStart: true
Bundle-Vendor: %PLUGIN_PROVIDER
Export-Package: org.jboss.tools.ws.core,
Modified: trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCorePlugin.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCorePlugin.java 2008-06-12 02:11:49 UTC (rev 8736)
+++ trunk/ws/plugins/org.jboss.tools.ws.core/src/org/jboss/tools/ws/core/JbossWSCorePlugin.java 2008-06-12 07:13:33 UTC (rev 8737)
@@ -39,6 +39,9 @@
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
+ org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin.getInstance().getPluginPreferences().setDefault("PREFERENCE_SERVER", "org.eclipse.jst.server.generic.jboss42");
+ org.eclipse.jst.ws.internal.consumption.ui.plugin.WebServiceConsumptionUIPlugin.getInstance().getPluginPreferences().setDefault("PREFERENCE_RUNTIME", "org.jboss.tools.ws.creation.jbossWebServiceRT");
+
}
/*
17 years, 10 months
JBoss Tools SVN: r8736 - in trunk: core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-11 22:11:49 -0400 (Wed, 11 Jun 2008)
New Revision: 8736
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java
Log:
JBIDE-2331
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java 2008-06-12 02:05:52 UTC (rev 8735)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java 2008-06-12 02:11:49 UTC (rev 8736)
@@ -3,6 +3,10 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -29,6 +33,7 @@
import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
public class ArchivePublishWizard extends Wizard {
@@ -39,16 +44,20 @@
setWindowTitle("Archive Publish Settings");
}
public boolean performFinish() {
- if( new Boolean(page.getAlwaysPublish()).booleanValue() ) {
- pack.setProperty(ArchivesBuildListener.DEPLOY_SERVERS, getServers());
- pack.setProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
- IPath p = pack.getProjectPath();
- try {
- ArchivesModel.instance().save(p, null);
- } catch( ArchivesModelException ame ) {
- // TODO
+ boolean alwaysPublish = new Boolean(page.getAlwaysPublish()).booleanValue();
+ pack.setProperty(ArchivesBuildListener.DEPLOY_SERVERS, alwaysPublish ? getServers() : null);
+ pack.setProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
+ final IPath p = pack.getProjectPath();
+ new Job("Saving Archives Preferences") {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ArchivesModel.instance().save(p, null);
+ return Status.OK_STATUS;
+ } catch( ArchivesModelException ame ) {
+ return new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID, "Unable to save archive preferences", ame);
+ }
}
- }
+ }.schedule();
return true;
}
public void addPages() {
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java 2008-06-12 02:05:52 UTC (rev 8735)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java 2008-06-12 02:11:49 UTC (rev 8736)
@@ -25,6 +25,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelException;
import org.jboss.ide.eclipse.archives.core.model.EventManager;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -156,6 +157,8 @@
* @see org.jboss.ide.eclipse.archives.core.model.IArchiveModelNode#save(org.eclipse.core.runtime.IProgressMonitor)
*/
public void save(IProgressMonitor monitor) throws ArchivesModelException {
+ if( monitor == null )
+ monitor = new NullProgressMonitor();
XbPackages packs = (XbPackages)getNodeDelegate();
try {
XMLBinding.marshallToFile(packs, getDescriptor(), monitor);
17 years, 10 months
JBoss Tools SVN: r8735 - branches/jbosstools-2.1.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-11 22:05:52 -0400 (Wed, 11 Jun 2008)
New Revision: 8735
Modified:
branches/jbosstools-2.1.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java
Log:
JBIDE-2331
Modified: branches/jbosstools-2.1.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java
===================================================================
--- branches/jbosstools-2.1.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java 2008-06-12 01:45:15 UTC (rev 8734)
+++ branches/jbosstools-2.1.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/ArchivePublishWizard.java 2008-06-12 02:05:52 UTC (rev 8735)
@@ -3,6 +3,10 @@
import java.util.ArrayList;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
@@ -29,6 +33,7 @@
import org.jboss.ide.eclipse.as.core.modules.ArchivesBuildListener;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
public class ArchivePublishWizard extends Wizard {
@@ -39,16 +44,20 @@
setWindowTitle("Archive Publish Settings");
}
public boolean performFinish() {
- if( new Boolean(page.getAlwaysPublish()).booleanValue() ) {
- pack.setProperty(ArchivesBuildListener.DEPLOY_SERVERS, getServers());
- pack.setProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
- IPath p = pack.getProjectPath();
- try {
- ArchivesModel.instance().save(p, null);
- } catch( ArchivesModelException ame ) {
- // TODO
+ boolean alwaysPublish = new Boolean(page.getAlwaysPublish()).booleanValue();
+ pack.setProperty(ArchivesBuildListener.DEPLOY_SERVERS, alwaysPublish ? getServers() : null);
+ pack.setProperty(ArchivesBuildListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
+ final IPath p = pack.getProjectPath();
+ new Job("Saving Archives Preferences") {
+ protected IStatus run(IProgressMonitor monitor) {
+ try {
+ ArchivesModel.instance().save(p, null);
+ return Status.OK_STATUS;
+ } catch( ArchivesModelException ame ) {
+ return new Status(IStatus.ERROR, JBossServerUIPlugin.PLUGIN_ID, "Unable to save archive preferences", ame);
+ }
}
- }
+ }.schedule();
return true;
}
public void addPages() {
17 years, 10 months
JBoss Tools SVN: r8734 - branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-06-11 21:45:15 -0400 (Wed, 11 Jun 2008)
New Revision: 8734
Modified:
branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java
Log:
JBIDE-2331 - NPE in progress monitor
Modified: branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java
===================================================================
--- branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java 2008-06-12 00:23:42 UTC (rev 8733)
+++ branches/jbosstools-2.1.x/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/ArchiveModelNode.java 2008-06-12 01:45:15 UTC (rev 8734)
@@ -25,6 +25,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.jboss.ide.eclipse.archives.core.model.ArchivesModelException;
import org.jboss.ide.eclipse.archives.core.model.EventManager;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
@@ -156,6 +157,8 @@
* @see org.jboss.ide.eclipse.archives.core.model.IArchiveModelNode#save(org.eclipse.core.runtime.IProgressMonitor)
*/
public void save(IProgressMonitor monitor) throws ArchivesModelException {
+ if( monitor == null )
+ monitor = new NullProgressMonitor();
XbPackages packs = (XbPackages)getNodeDelegate();
try {
XMLBinding.marshallToFile(packs, getDescriptor(), monitor);
17 years, 10 months