JBoss Tools SVN: r19557 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor/template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2009-12-23 10:01:49 -0500 (Wed, 23 Dec 2009)
New Revision: 19557
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateData.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.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:
https://jira.jboss.org/jira/browse/JBIDE-5470, dialog was updated, tag name validation was added, page controls were updated.
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2009-12-23 14:59:36 UTC (rev 19556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/preferences/TemplatesPreferencePage.java 2009-12-23 15:01:49 UTC (rev 19557)
@@ -18,8 +18,6 @@
import org.eclipse.jface.viewers.TableLayout;
import org.eclipse.swt.SWT;
import org.eclipse.swt.SWTException;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
@@ -33,9 +31,6 @@
import org.eclipse.swt.widgets.Widget;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
-import org.jboss.tools.common.model.ui.action.CommandBar;
-import org.jboss.tools.common.model.ui.action.CommandBarListener;
-import org.jboss.tools.common.model.ui.objecteditor.XTable;
import org.jboss.tools.vpe.editor.template.VpeAnyData;
import org.jboss.tools.vpe.editor.template.VpeEditAnyDialog;
import org.jboss.tools.vpe.editor.template.VpeTemplateManager;
@@ -50,7 +45,7 @@
VpeUIMessages.TemplatesTableProvider_URI,
VpeUIMessages.TemplatesTableProvider_Children};
private static final int[] COLUMNS_WIDTHS = new int[] {
- 50, 50, 90, 30
+ 50, 50, 90, 40
};
private Table tagsTable;
private Button addButton;
@@ -58,10 +53,9 @@
private Button removeButton;
private List<VpeAnyData> tagsList;
- protected boolean changed;
+ protected boolean tagListWasChanged;
public TemplatesPreferencePage() {
- setPreferenceStore(getPreferenceStore());
/*
* Initialize tags list from the file
*/
@@ -86,7 +80,7 @@
composite.setFont(parent.getFont());
/*
- * Create datatable with the list of unknown tags
+ * Create data-table with the list of unknown tags
*/
tagsTable = new Table(composite, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
TableLayout layout = new TableLayout();
@@ -94,19 +88,6 @@
tagsTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 3));
tagsTable.setHeaderVisible(true);
tagsTable.setLinesVisible(true);
- tagsTable.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- super.widgetSelected(e);
- }
-
- });
/*
* Create columns in the table
@@ -126,16 +107,16 @@
/*
* Add buttons
*/
- addButton = new Button(composite, SWT.NONE);
- addButton.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+ addButton = new Button(composite, SWT.BUTTON1);
+ addButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
addButton.setText(VpeUIMessages.TemplatesPreferencePage_Add);
- editButton = new Button(composite, SWT.NONE);
- editButton.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+ editButton = new Button(composite, SWT.BUTTON1);
+ editButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
editButton.setText(VpeUIMessages.TemplatesPreferencePage_Edit);
- removeButton = new Button(composite, SWT.NONE);
- removeButton.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 1));
+ removeButton = new Button(composite, SWT.BUTTON1);
+ removeButton.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
removeButton.setText(VpeUIMessages.TemplatesPreferencePage_Remove);
/*
@@ -152,19 +133,26 @@
}
private void updateTagsTable() {
+ /*
+ * If widget is null or disposed - exit.
+ */
if(tagsTable == null || tagsTable.isDisposed()) {
return;
}
+ /*
+ * Remember selection index.
+ */
int selectionIndex = tagsTable.getSelectionIndex();
/*
* Clear all previously saved items.
*/
tagsTable.clearAll();
- TableItem tableItem = null;
+ tagsTable.update();
/*
* Recreate table items
*/
+ TableItem tableItem = null;
for (int i = 0; i < tagsList.size(); i++) {
if(tagsTable.getItemCount() > i) {
/*
@@ -179,7 +167,7 @@
}
/*
* Fill in columns.
- * Tags table has 5 columns with checkbox in the first column.
+ * Tags table has 4 columns.
*/
String[] itemColumnsData = new String[tagsTable.getColumnCount()];
for (int j = 0; j < itemColumnsData.length; j++) {
@@ -241,16 +229,6 @@
if(v.indexOf('\r') >= 0) v = v.replace('\r', ' ');
return v;
}
-
- public boolean performOk() {
- if(changed) {
- /*
- * Commit changes to the file
- */
- VpeTemplateManager.getInstance().setAnyTemplates(tagsList);
- }
- return true;
- }
public void handleEvent(Event event) {
Widget source = event.widget;
@@ -266,6 +244,7 @@
* Add new template to the list.
*/
tagsList.add(data);
+ tagListWasChanged = true;
}
} else if (source == editButton) {
/*
@@ -274,22 +253,51 @@
VpeAnyData data = (VpeAnyData) tagsList.get(tagsTable.getSelectionIndex());
VpeEditAnyDialog editDialog = new VpeEditAnyDialog(getShell(), data);
editDialog.open();
- if(data.isChanged()){
- changed = true;
+ if(data.isChanged()) {
+ tagListWasChanged = true;
}
} else if (source == removeButton) {
/*
* Handle remove event
*/
tagsList.remove(tagsTable.getSelectionIndex());
+ tagListWasChanged = true;
} else {
/*
* Handle default event
*/
}
/*
- * Update tags table with the new tempales.
+ * Update tags table with the new templates.
*/
updateTagsTable();
}
+
+ @Override
+ public boolean performOk() {
+ if(tagListWasChanged) {
+ /*
+ * Commit changes to the file
+ */
+ VpeTemplateManager.getInstance().setAnyTemplates(tagsList);
+ }
+ return true;
+ }
+
+ @Override
+ protected void performApply() {
+ performOk();
+ }
+
+ @Override
+ protected void performDefaults() {
+ /*
+ * Initialize tags list from the file again.
+ * Update visual table.
+ */
+ tagsList = VpeTemplateManager.getInstance().getAnyTemplates();
+ updateTagsTable();
+ }
+
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2009-12-23 14:59:36 UTC (rev 19556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeEditAnyDialog.java 2009-12-23 15:01:49 UTC (rev 19557)
@@ -143,6 +143,7 @@
text = data.getName();
}
tagName.setText(text);
+ tagName.addModifyListener(templateVerifier);
/*
* Create Tag URI label
@@ -161,6 +162,7 @@
text = data.getUri();
}
tagUri.setText(text);
+ tagUri.addModifyListener(templateVerifier);
/*
* Create Tag for display label
@@ -193,6 +195,7 @@
*/
childrenCheckbox = new Button(composite, SWT.CHECK);
childrenCheckbox.setLayoutData(new GridData(SWT.LEFT, SWT.NONE, true, false, 2, 1));
+ childrenCheckbox.setSelection(data.isChildren());
/*
* Create value label
@@ -206,7 +209,11 @@
*/
txtValue = new Text(composite, SWT.BORDER);
txtValue.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false, 2, 1));
- txtValue.setText(data.getValue() != null ? data.getValue() : ""); //$NON-NLS-1$
+ text = Constants.EMPTY;
+ if ((data != null) && (data.getValue() != null)) {
+ text = data.getValue();
+ }
+ txtValue.setText(text);
txtValue.addModifyListener(templateVerifier);
/*
@@ -334,6 +341,26 @@
VpePlugin.getPluginLog().logError(e);
}
}
+
+ /**
+ * Validates tag name.
+ * <p>
+ * Prefix should exist.
+ * <p>
+ * Otherwise template won't be saved correctly to auto-templates.xml.
+ *
+ * @return message is validation failed, null otherwise.
+ */
+ private IMessageProvider validateTagName() {
+ Message message = null;
+ if (tagName.getText().indexOf(":") < 0) { //$NON-NLS-1$
+ message = new Message(
+ MessageFormat.format(VpeUIMessages.TAG_NAME_IS_NOT_VALID,
+ tagName.getText().trim()),
+ IMessageProvider.ERROR);
+ }
+ return message;
+ }
/**
* Validates {@link VpeEditAnyDialog#txtTagForDisplay} field.
@@ -387,8 +414,11 @@
IMessageProvider tagForDisplayMessage = validateTagForDisplay();
IMessageProvider valueMessage = validateValue();
+ IMessageProvider tagNameMessage = validateTagName();
- if (tagForDisplayMessage != null) {
+ if (tagNameMessage != null) {
+ message = tagNameMessage;
+ } else if (tagForDisplayMessage != null) {
message = tagForDisplayMessage;
} else if (valueMessage != null) {
message = valueMessage;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateData.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateData.java 2009-12-23 14:59:36 UTC (rev 19556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateData.java 2009-12-23 15:01:49 UTC (rev 19557)
@@ -71,7 +71,7 @@
}
public String getPrefix() {
- if (name != null && name.indexOf(":") > 0) { //$NON-NLS-1$
+ if ((name != null) && (name.indexOf(":") > 0)) { //$NON-NLS-1$
return name.substring(0, name.indexOf(":")); //$NON-NLS-1$
}
return null;
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-12-23 14:59:36 UTC (rev 19556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/template/VpeTemplateManager.java 2009-12-23 15:01:49 UTC (rev 19557)
@@ -788,7 +788,7 @@
VpeAnyData data = iter.next();
root.appendChild(createNewTagElement(document, data));
String prefix = data.getPrefix();
- if (prefix != null && prefix.length() > 0 && !prefixSet.contains(prefix)) {
+ if ((prefix != null) && (prefix.length() > 0) && !prefixSet.contains(prefix)) {
root = appendTaglib(prefixSet, document, root, data);
prefixSet.add(prefix);
}
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 2009-12-23 14:59:36 UTC (rev 19556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/VpeUIMessages.java 2009-12-23 15:01:49 UTC (rev 19557)
@@ -45,6 +45,8 @@
public static String TAG_STYLE;
public static String CHILDREN;
public static String VALUE;
+ public static String TAG_NAME_IS_NOT_VALID;
+ public static String TAG_FOR_DISPLAY_IS_NOT_VALID;
public static String VALUE_IS_NOT_VALID;
public static String BACKGROUND_COLOR;
public static String ERROR_OF_TYPE_CONVERSION;
@@ -80,7 +82,6 @@
public static String HIDE_TOOLBAR;
public static String SHOW;
public static String HIDE;
- public static String TAG_FOR_DISPLAY_IS_NOT_VALID;
public static String MenuCreationHelper_Cut;
public static String MenuCreationHelper_Paste;
public static String MenuCreationHelper_Test;
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 2009-12-23 14:59:36 UTC (rev 19556)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/messages/messages.properties 2009-12-23 15:01:49 UTC (rev 19557)
@@ -1,4 +1,4 @@
-ATTRIBUTES_MENU_ITEM=<{0}> Attributes
+AATTRIBUTES_MENU_ITEM=<{0}> Attributes
SELECT_THIS_TAG_MENU_ITEM=Select This Tag
STRIP_TAG_MENU_ITEM=Strip Tag
PARENT_TAG_MENU_ITEM=Parent Tag ({0})
@@ -26,6 +26,8 @@
TAG_STYLE=Tag style:
CHILDREN=Allow tag children:
VALUE=Value:
+TAG_NAME_IS_NOT_VALID=Tag name is not valid ({0})
+TAG_FOR_DISPLAY_IS_NOT_VALID=Tag for display is not valid ({0}).
VALUE_IS_NOT_VALID=Value is not valid ({0}).
BACKGROUND_COLOR=Background Color
@@ -62,7 +64,6 @@
NON_VISUAL_TAGS=Non-visual tags
SHOW=Show
HIDE=Hide
-TAG_FOR_DISPLAY_IS_NOT_VALID=Tag for display is not valid ({0}).
MenuCreationHelper_Cut=Cut
MenuCreationHelper_Paste=Paste
MenuCreationHelper_Test=Test
15 years
JBoss Tools SVN: r19556 - in trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yzhishko
Date: 2009-12-23 09:59:36 -0500 (Wed, 23 Dec 2009)
New Revision: 19556
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5574 fixed
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2009-12-23 14:52:18 UTC (rev 19555)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/browser/XulRunnerBrowser.java 2009-12-23 14:59:36 UTC (rev 19556)
@@ -167,20 +167,7 @@
public void dispose() {
//added by mareshkau, here we remove listener.
//if we hasn't do it, listener will be continue work even after close browser
- nsIServiceManager serviceManager = mozilla.getServiceManager();
- nsIWebProgress webProgress = (nsIWebProgress) serviceManager
- .getServiceByContractID("@mozilla.org/docloaderservice;1", //$NON-NLS-1$
- nsIWebProgress.NS_IWEBPROGRESS_IID);
- try {
- webProgress.removeProgressListener(this);
- } catch(XPCOMException xpcomException) {
-
- //this exception throws when progress listener already has been deleted,
- //so just ignore if error code NS_ERROR_FAILURE
- if(xpcomException.errorcode!=XulRunnerBrowser.NS_ERROR_FAILURE) {
- throw xpcomException;
- }
- }
+ removeProgressListener(this);
browser.dispose();
browser = null;
}
@@ -449,4 +436,22 @@
public void setText(String html) {
browser.setText(html);
}
+
+ protected void removeProgressListener(nsIWebProgressListener progressListener){
+ nsIServiceManager serviceManager = mozilla.getServiceManager();
+ nsIWebProgress webProgress = (nsIWebProgress) serviceManager
+ .getServiceByContractID("@mozilla.org/docloaderservice;1", //$NON-NLS-1$
+ nsIWebProgress.NS_IWEBPROGRESS_IID);
+ try {
+ webProgress.removeProgressListener(progressListener);
+ } catch(XPCOMException xpcomException) {
+
+ //this exception throws when progress listener already has been deleted,
+ //so just ignore if error code NS_ERROR_FAILURE
+ if(xpcomException.errorcode!=XulRunnerBrowser.NS_ERROR_FAILURE) {
+ throw xpcomException;
+ }
+ }
+ }
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-12-23 14:52:18 UTC (rev 19555)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.xulrunner/src/org/jboss/tools/vpe/xulrunner/editor/XulRunnerEditor.java 2009-12-23 14:59:36 UTC (rev 19556)
@@ -48,7 +48,6 @@
import org.mozilla.interfaces.nsISupports;
import org.mozilla.interfaces.nsITooltipListener;
import org.mozilla.interfaces.nsITransferable;
-import org.mozilla.interfaces.nsIWebProgress;
import org.mozilla.xpcom.Mozilla;
import org.mozilla.xpcom.XPCOMException;
@@ -56,10 +55,10 @@
* @author Sergey Vasilyev (svasilyev(a)exadel.com)
*
*/
-public class XulRunnerEditor extends XulRunnerBrowser{
-
+public class XulRunnerEditor extends XulRunnerBrowser {
+
private VisualPaintListener paintListener;
-
+
/** IVpeResizeListener */
private IVpeResizeListener resizeListener;
@@ -165,10 +164,7 @@
}
getWebBrowser().removeWebBrowserListener(XulRunnerEditor.this,
nsITooltipListener.NS_ITOOLTIPLISTENER_IID);
- nsIWebProgress webProgress = (nsIWebProgress) getServiceManager()
- .getServiceByContractID("@mozilla.org/docloaderservice;1", //$NON-NLS-1$
- nsIWebProgress.NS_IWEBPROGRESS_IID);
- webProgress.removeProgressListener(XulRunnerEditor.this);
+ removeProgressListener(XulRunnerEditor.this);
removeSelectionListener();
if (resizeListener != null)
getIXulRunnerVpeResizer().removeResizeListener(
@@ -189,7 +185,7 @@
}
});
- //Part of fix https://jira.jboss.org/jira/browse/JBIDE-4022
+ // Part of fix https://jira.jboss.org/jira/browse/JBIDE-4022
paintListener = new VisualPaintListener();
getBrowser().getParent().addPaintListener(paintListener);
// addListener(SWT.Activate, eventListenet);
@@ -211,7 +207,7 @@
// addListener(SWT.FocusOut, eventListenet);
addListener(SWT.Selection, eventListenet);
addListener(SWT.Paint, eventListenet);
-
+
resizeListener = new IVpeResizeListener() {
public void onEndResizing(int usedResizeMarkerHandle, int top,
int left, int width, int height,
@@ -397,13 +393,14 @@
nsIDOMElement element = getElement(node);
- //See https://jira.jboss.org/jira/browse/JBIDE-5117. We make
- //unnecessary redrawing of previously selected component in VE
- //which happens in drawElementOutline(nsIDOMElement domElement)
- //method and call IFlasher.drawElementOutline(nsIDOMElement domElement)
- //twice for different elements without browser repainting. So, for some
- //conflicts in Mozilla browser border above TR element wasn't repainted.
-
+ // See https://jira.jboss.org/jira/browse/JBIDE-5117. We make
+ // unnecessary redrawing of previously selected component in VE
+ // which happens in drawElementOutline(nsIDOMElement domElement)
+ // method and call IFlasher.drawElementOutline(nsIDOMElement domElement)
+ // twice for different elements without browser repainting. So, for some
+ // conflicts in Mozilla browser border above TR element wasn't
+ // repainted.
+
// if (getLastSelectedElement() != null) {
//
// scrollRegtangleFlag = scroll && node != null;
@@ -787,12 +784,14 @@
+ ';' + XulRunnerEditor.VISIBLE_ELEMENT_BORDER);
}
this.lastBorderedElement = domElement;
- this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME, oldstyle);
+ this.lastBorderedElement.setAttribute(PREV_STYLE_ATTR_NAME,
+ oldstyle);
} else {
// under osx function drawElementOutline not works
getIFlasher().drawElementOutline(domElement);
}
}
+
/**
* Checks if node has select in parent node, if has it's cause crash on OSX
* and xulrunner 1.8.1.3
@@ -809,21 +808,20 @@
// return hasSelectInParenNodes(domNode.getParentNode());
// }
// }
-
+
@Override
protected void onDispose() {
lastSelectedNode = null;
iFlasher = null;
super.onDispose();
}
-
- private class VisualPaintListener implements PaintListener{
+ private class VisualPaintListener implements PaintListener {
+
public void paintControl(PaintEvent e) {
showSelectionRectangle();
}
-
+
}
-
-
+
}
15 years
JBoss Tools SVN: r19555 - in trunk/esb/plugins/org.jboss.tools.esb.core: src/org/jboss/tools/esb/core/model and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-23 09:52:18 -0500 (Wed, 23 Dec 2009)
New Revision: 19555
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/JBRListenerConverter.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBOrderedChildren.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddProviderSupport.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5548
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-23 14:40:36 UTC (rev 19554)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-23 14:52:18 UTC (rev 19555)
@@ -365,7 +365,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=converter" name="ESBFTPRemote">
<XChildrenEntities/>
<XEntityRenderer>
@@ -589,6 +590,177 @@
<XDependencies/>
</XModelEntity>
<XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%;hasConvertedProperties=true"
+ XMLSUBPATH="jbr-bus" name="ESBJBRBus120">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity maxCount="1" name="ESBJBRConfig" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.bus" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="channel" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="id" xmlname="busid"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ name="port" xmlname="port">
+ <Constraint loader="%IntEL%"/>
+ </XModelAttribute>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=converter" name="ESBJBRConfig">
+ <XChildrenEntities/>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.property" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="JBR Gateway Config" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true"
+ default="Config" name="name" visibility="false" xmlname="name">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;pre=true"
+ default="Default(true)" name="synchronous" xmlname="synchronous">
+ <Constraint loader="ListString">
+ <value name="Default(true)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;pre=true"
+ name="service invoker timeout" xmlname="serviceInvokerTimeout"/>
+ <XModelAttribute PROPERTIES="category=general;pre=true"
+ name="async response" xmlname="asyncResponse"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="CopyActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="DeleteActions"/>
+ <XActionItemReference entity="ESBPreAlias" name="Properties"/>
+ <XActionItemReference entity="ESBPreAlias" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%;hasConvertedProperties=true"
+ XMLSUBPATH="jbr-listener" name="ESBJBRListener120">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity maxCount="1" name="ESBJBRConfig" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.listener" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="jbr listener" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttributeReference
+ attributes="name,channel id ref,max threads,is gateway"
+ entity="ESBListener101" name="listener"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem kind="list" name="CreateActions">
+ <XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%;hasConvertedProperties=true"
+ XMLSUBPATH="jbr-provider" name="ESBJBRProvider120">
+ <XChildrenEntities>
+ <XChildEntity name="ESBProperty"/>
+ <XChildEntity name="ESBBus"/>
+ <XChildEntity name="ESBJBRBus120"/>
+ <XChildEntity maxCount="1" name="ESBJBRConfig" required="yes"/>
+ </XChildrenEntities>
+ <XEntityRenderer>
+ <ICONS>
+ <ICON info="main.esb.provider" type="main"/>
+ </ICONS>
+ </XEntityRenderer>
+ <XModelAttributes>
+ <XModelAttribute default="jbr provider" loader="ElementType" name="element type">
+ <Editor name="Uneditable"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general;id=true;save=always"
+ name="name" xmlname="name"/>
+ <XModelAttribute PROPERTIES="category=general;save=always"
+ default="http" name="protocol" xmlname="protocol">
+ <Constraint loader="List">
+ <value name="http"/>
+ <value name="https"/>
+ <value name="socket"/>
+ <value name="sslsocket"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="category=general" name="host" xmlname="host"/>
+ <XModelAttribute TRIM="no" name="comment" visibility="false" xmlname="#comment">
+ <Editor name="Note"/>
+ </XModelAttribute>
+ </XModelAttributes>
+ <XActionItem kind="list">
+ <XActionItem ICON="action.empty" displayName="New" group="1"
+ kind="list" name="CreateActions">
+ <XActionItemReference entity="ESBAction101" name="AddProperty" path="CreateActions/AddProperty"/>
+ <XActionItem HandlerClassName="%Create%" ICON="action.empty"
+ PROPERTIES="validator.add=true" WizardClassName="%Default%"
+ displayName="JBR Bus..." kind="action" name="AddBus">
+ <EntityData EntityName="ESBJBRBus120">
+ <AttributeData AttributeName="id"/>
+ <AttributeData AttributeName="port"/>
+ </EntityData>
+ </XActionItem>
+ </XActionItem>
+ <XActionItem ICON="action.empty" displayName="Create" kind="list" name="EditActions"/>
+ <XActionItemReference entity="ESBProperty" name="CopyActions"/>
+ <XActionItemReference entity="ESBProperty" name="DeleteActions"/>
+ <XActionItemReference entity="ESBProperty" name="Properties"/>
+ <XActionItemReference entity="ESBProperty" name="MoveActions"/>
+ </XActionItem>
+ <XDependencies/>
+ </XModelEntity>
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%ESBOrdered%"
XMLSUBPATH="jca-gateway" name="ESBJCAGateway120">
<XChildrenEntities>
@@ -639,8 +811,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity
- ImplementingClass="%ESB%"
+ <XModelEntity ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
XMLSUBPATH="listener" name="ESBListener120">
<XChildrenEntities>
@@ -688,7 +859,7 @@
<XChildEntity name="ESBFTPListener120"/>
<XChildEntity name="ESBSQLListener120"/>
<XChildEntity name="ESBHibernateListener101"/>
- <XChildEntity name="ESBJBRListener101"/>
+ <XChildEntity name="ESBJBRListener120"/>
<XChildEntity name="ESBGroovyListener101"/>
<XChildEntity name="ESBHTTPGateway120"/>
<XChildEntity name="ESBUDPListener110"/>
@@ -748,7 +919,7 @@
ICON="action.empty" PROPERTIES="validator.add=true"
WizardClassName="%Default%" displayName="JBR Listener..."
kind="action" name="AddJBRListener">
- <EntityData EntityName="ESBJBRListener101">
+ <EntityData EntityName="ESBJBRListener120">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="channel id ref" Mandatory="no"/>
</EntityData>
@@ -856,7 +1027,7 @@
XMLSUBPATH="providers" name="ESBProviders120">
<XChildrenEntities>
<XChildEntity name="ESBBusProvider101"/>
- <XChildEntity name="ESBJBRProvider101"/>
+ <XChildEntity name="ESBJBRProvider120"/>
<XChildEntity name="ESBScheduleProvider101"/>
<XChildEntity name="ESBJMSProvider101"/>
<XChildEntity name="ESBJCAProvider101"/>
@@ -901,7 +1072,19 @@
<AttributeData AttributeName="id"/>
</EntityData>
</XActionItem>
- <XActionItemReference entity="ESBProviders101" name="AddJBRProvider" path="CreateActions/AddJBRProvider"/>
+ <XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
+ PROPERTIES="validator.add=true;support=org.jboss.tools.esb.core.model.handlers.AddProviderSupport;busEntity=ESBJBRBus120"
+ displayName="JBR Provider..." kind="action" name="AddJBRProvider">
+ <EntityData EntityName="ESBJBRProvider120">
+ <AttributeData AttributeName="name"/>
+ <AttributeData AttributeName="protocol"/>
+ <AttributeData AttributeName="host" Mandatory="no"/>
+ </EntityData>
+ <EntityData EntityName="ESBBusCreator">
+ <AttributeData AttributeName="id"/>
+ <AttributeData AttributeName="port"/>
+ </EntityData>
+ </XActionItem>
<XActionItemReference entity="ESBProviders101" name="AddJCAProvider" path="CreateActions/AddJCAProvider"/>
<XActionItemReference entity="ESBProviders101" name="AddJMSProvider" path="CreateActions/AddJMSProvider"/>
<XActionItemReference entity="ESBProviders101"
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java 2009-12-23 14:40:36 UTC (rev 19554)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBLoaderUtil.java 2009-12-23 14:52:18 UTC (rev 19555)
@@ -56,9 +56,9 @@
String entity = o.getModelEntity().getName();
if(SpecificActionLoader.instance.isActionsFolder(entity)) {
SpecificActionLoader.instance.convertChildrenToSpecific(o);
- } else if(SpecificPropertyConverter.instance.isListenersFolder(entity)) {
- SpecificPropertyConverter.instance.convertChildrenToSpecific(o);
- } //TODO add other folders
+ } else if("true".equals(o.getModelEntity().getProperty("hasConvertedProperties"))) {
+ SpecificPropertyConverter.instance.convertBasicToSpecific(o);
+ }
}
public boolean save(Element parent, XModelObject o) {
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBOrderedChildren.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBOrderedChildren.java 2009-12-23 14:40:36 UTC (rev 19554)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/ESBOrderedChildren.java 2009-12-23 14:52:18 UTC (rev 19555)
@@ -18,11 +18,18 @@
*/
public class ESBOrderedChildren extends GroupOrderedChildren {
+ protected int getGroupCount() {
+ return 3;
+ }
+
protected int getGroup(XModelObject o) {
if(o != null && ESBConstants.ENT_ESB_PROPERTY.equals(o.getModelEntity().getName())) {
return 0;
}
- return 1;
+ if("ESBJBRConfig".equals(o.getModelEntity().getName())) {
+ return 1;
+ }
+ return 2;
}
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java 2009-12-23 14:40:36 UTC (rev 19554)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java 2009-12-23 14:52:18 UTC (rev 19555)
@@ -14,6 +14,7 @@
import org.jboss.tools.common.model.impl.RegularObjectImpl;
import org.jboss.tools.esb.core.model.converters.FTPListenerConverter;
import org.jboss.tools.esb.core.model.converters.IPropertyConverter;
+import org.jboss.tools.esb.core.model.converters.JBRListenerConverter;
/**
* When loading from xml, reads 'raw' list of esb property children of loaded object
@@ -37,30 +38,16 @@
return entity.startsWith(ENT_ESB_LISTENERS);
}
- public void convertChildrenToSpecific(XModelObject actions) {
- boolean modified = false;
+ static String JBR_ENTITIES = ".ESBJBRProvider120.ESBJBRListener120.ESBJBRBus120.";
- XModelObject[] as = actions.getChildren();
- for (int i = 0; i < as.length; i++) {
- XModelObject action = convertBasicToSpecific(actions, as[i]);
- if(action != null) {
- as[i] = action;
- modified = true;
- }
- }
- if(modified) {
- ((RegularObjectImpl)actions).replaceChildren(as);
- }
-
- }
-
- public XModelObject convertBasicToSpecific(XModelObject parent, XModelObject basic) {
+ public XModelObject convertBasicToSpecific(XModelObject basic) {
String entity = basic.getModelEntity().getName();
if("ESBFTPListener120".equals(entity)) {
FTPListenerConverter.instance.toSpecific(basic, basic);
+ } else if(JBR_ENTITIES.indexOf("." + entity + ".") >= 0) {
+ JBRListenerConverter.instance.toSpecific(basic, basic);
}
- //returns null because no new object is created
- return null;
+ return basic;
}
public XModelObject convertSpecificToBasic(XModelObject specific) {
@@ -69,6 +56,9 @@
if("ESBFTPListener120".equals(entity)) {
basic = basic.copy();
FTPListenerConverter.instance.toBasic(basic, specific);
+ } else if(JBR_ENTITIES.indexOf("." + entity + ".") >= 0) {
+ basic = basic.copy();
+ JBRListenerConverter.instance.toBasic(basic, specific);
}
return basic;
}
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/JBRListenerConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/JBRListenerConverter.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/JBRListenerConverter.java 2009-12-23 14:52:18 UTC (rev 19555)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * 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.esb.core.model.converters;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.esb.core.model.SpecificActionLoader;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class JBRListenerConverter implements IPropertyConverter {
+ public static JBRListenerConverter instance = new JBRListenerConverter();
+
+ public JBRListenerConverter() {}
+
+ public void toBasic(XModelObject basic, XModelObject specific) {
+ XModelObject config = specific.getChildByPath("Config");
+ if(config != null) {
+ SpecificActionLoader.copySpecificAtttributesToBasicProperties(config, basic);
+ }
+ }
+
+ public void toSpecific(XModelObject basic, XModelObject specific) {
+ XModelObject config = specific.getChildByPath("Config");
+ if(config != null) {
+ SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, config);
+ }
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/JBRListenerConverter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddProviderSupport.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddProviderSupport.java 2009-12-23 14:40:36 UTC (rev 19554)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/handlers/AddProviderSupport.java 2009-12-23 14:52:18 UTC (rev 19555)
@@ -62,7 +62,7 @@
protected void execute() throws XModelException {
Properties p0 = extractStepData(0);
- XModelObject provider = getTarget().getModel().createModelObject(providerEntity, p0);
+ XModelObject provider = XModelObjectLoaderUtil.createValidObject(getTarget().getModel(), providerEntity, p0);
Properties p1 = extractStepData(1);
XModelObject bus = XModelObjectLoaderUtil.createValidObject(getTarget().getModel(), busEntity, p1);
15 years
JBoss Tools SVN: r19554 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-23 09:40:36 -0500 (Wed, 23 Dec 2009)
New Revision: 19554
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5569
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2009-12-23 14:39:58 UTC (rev 19553)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2009-12-23 14:40:36 UTC (rev 19554)
@@ -34,7 +34,8 @@
org.eclipse.jst.j2ee.core,
org.eclipse.jst.common.frameworks,
org.jboss.tools.jst.web.kb;visibility:=reexport,
- org.jboss.tools.jsf
+ org.jboss.tools.jsf,
+ org.eclipse.debug.core;bundle-version="3.4.0"
Bundle-Version: 2.0.0
Export-Package:
org.jboss.tools.seam.core,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 14:39:58 UTC (rev 19553)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 14:40:36 UTC (rev 19554)
@@ -39,12 +39,17 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.application.Application;
@@ -768,14 +773,12 @@
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
- if (jpaVersion != null) {
+ /*if (jpaVersion != null) {
IScopeContext context = new ProjectScope(project);
IEclipsePreferences prefs = context.getNode("org.eclipse.jpt.core");
String platformId = prefs.get("org.eclipse.jpt.core.platform", null);
if ("hibernate".equals(platformId)){
- /*
- * Hibernate automatically creates console configuration
- */
+ // Hibernate automatically creates console configuration
hibernateConsoleLaunchFile = null;
} else {
try {
@@ -792,7 +795,39 @@
SeamCorePlugin.getPluginLog().logError(e);
}
//hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ }*/
+ try {
+ hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.launch");
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
}
+ if (jpaVersion != null) {
+ IScopeContext context = new ProjectScope(project);
+ IEclipsePreferences prefs = context.getNode("org.eclipse.jpt.core");
+ String platformId = prefs.get("org.eclipse.jpt.core.platform", null);
+ if ("hibernate".equals(platformId)){
+ // Delete launch configuration
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType lct = lm.getLaunchConfigurationType("org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType");
+ ILaunchConfiguration[] lcs = lm.getLaunchConfigurations(lct);
+ ILaunchConfiguration lsForDelete = null;
+ for(int i = 0; i < lcs.length && lcs[i].exists(); i++) {
+ String lcProject = lcs[i].getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
+ if (project.getName().equals(lcProject)) {
+ lsForDelete = lcs[i];
+ break;
+ }
+ }
+ if (lsForDelete != null){
+ lsForDelete.delete();
+ }
+ try {
+ hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console_jpa.launch");//$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
//final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
15 years
JBoss Tools SVN: r19553 - in branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-23 09:39:58 -0500 (Wed, 23 Dec 2009)
New Revision: 19553
Modified:
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5569
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2009-12-23 14:11:20 UTC (rev 19552)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2009-12-23 14:39:58 UTC (rev 19553)
@@ -34,7 +34,8 @@
org.eclipse.jst.j2ee.core,
org.eclipse.jst.common.frameworks,
org.jboss.tools.jst.web.kb;visibility:=reexport,
- org.jboss.tools.jsf
+ org.jboss.tools.jsf,
+ org.eclipse.debug.core;bundle-version="3.4.0"
Bundle-Version: 2.0.0
Export-Package:
org.jboss.tools.seam.core,
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 14:11:20 UTC (rev 19552)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 14:39:58 UTC (rev 19553)
@@ -39,12 +39,17 @@
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.debug.core.DebugPlugin;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchConfigurationType;
+import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.emf.common.util.EList;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
+import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jface.dialogs.ErrorDialog;
import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
import org.eclipse.jst.j2ee.application.Application;
@@ -768,14 +773,12 @@
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
- if (jpaVersion != null) {
+ /*if (jpaVersion != null) {
IScopeContext context = new ProjectScope(project);
IEclipsePreferences prefs = context.getNode("org.eclipse.jpt.core");
String platformId = prefs.get("org.eclipse.jpt.core.platform", null);
if ("hibernate".equals(platformId)){
- /*
- * Hibernate automatically creates console configuration
- */
+ // Hibernate automatically creates console configuration
hibernateConsoleLaunchFile = null;
} else {
try {
@@ -792,7 +795,39 @@
SeamCorePlugin.getPluginLog().logError(e);
}
//hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ }*/
+ try {
+ hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.launch");
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
}
+ if (jpaVersion != null) {
+ IScopeContext context = new ProjectScope(project);
+ IEclipsePreferences prefs = context.getNode("org.eclipse.jpt.core");
+ String platformId = prefs.get("org.eclipse.jpt.core.platform", null);
+ if ("hibernate".equals(platformId)){
+ // Delete launch configuration
+ ILaunchManager lm = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType lct = lm.getLaunchConfigurationType("org.hibernate.eclipse.launch.ConsoleConfigurationLaunchConfigurationType");
+ ILaunchConfiguration[] lcs = lm.getLaunchConfigurations(lct);
+ ILaunchConfiguration lsForDelete = null;
+ for(int i = 0; i < lcs.length && lcs[i].exists(); i++) {
+ String lcProject = lcs[i].getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, (String)null);
+ if (project.getName().equals(lcProject)) {
+ lsForDelete = lcs[i];
+ break;
+ }
+ }
+ if (lsForDelete != null){
+ lsForDelete.delete();
+ }
+ try {
+ hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console_jpa.launch");//$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
//final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
15 years
JBoss Tools SVN: r19552 - in branches/jbosstools-3.1.0.RC1/seam/plugins: org.jboss.tools.seam.core/templates/hibernatetools and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-23 09:11:20 -0500 (Wed, 23 Dec 2009)
New Revision: 19552
Added:
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties
Modified:
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch
branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5570
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 13:47:51 UTC (rev 19551)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 14:11:20 UTC (rev 19552)
@@ -307,7 +307,7 @@
protected File webInfClassesMetaInf;
protected File persistenceFile;
protected File hibernateConsoleLaunchFile;
- //protected File hibernateConsolePropsFile;
+ protected File hibernateConsolePropsFile;
/**
*
@@ -498,10 +498,10 @@
viewFilterSetCollection, false);
}
- /*AntCopyUtils.copyFileToFolder(
+ AntCopyUtils.copyFileToFolder(
hibernateConsolePropsFile,
project.getLocation().toFile(),
- hibernateDialectFilterSet, false);*/
+ hibernateDialectFilterSet, false);
WtpUtils.setClasspathEntryAsExported(project, new Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
} else {
@@ -684,8 +684,8 @@
ejbProjectFolder, ejbProjectFolder.getName() + ".launch"), //$NON-NLS-1$
new FilterSetCollection(ejbFilterSet), false);
- /*AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
- ejbProjectFolder, hibernateDialectFilterSet, false);*/
+ AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
+ ejbProjectFolder, hibernateDialectFilterSet, false);
}
enum ProjectType {
@@ -763,6 +763,11 @@
dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ try {
+ hibernateConsolePropsFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
if (jpaVersion != null) {
IScopeContext context = new ProjectScope(project);
IEclipsePreferences prefs = context.getNode("org.eclipse.jpt.core");
@@ -774,7 +779,7 @@
hibernateConsoleLaunchFile = null;
} else {
try {
- hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console_jpa.launch");
+ hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console_jpa.launch");//$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
@@ -788,7 +793,6 @@
}
//hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
}
- //hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
//final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2009-12-23 13:47:51 UTC (rev 19551)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2009-12-23 14:11:20 UTC (rev 19552)
@@ -90,7 +90,7 @@
protected File seamGenResFolder;
protected File persistenceFile;
protected File hibernateConsoleLaunchFile;
- //protected File hibernateConsolePropsFile;
+ protected File hibernateConsolePropsFile;
protected FilterSet jdbcFilterSet;
protected FilterSet encodedJdbcFilterSet;
@@ -137,11 +137,11 @@
try {
hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.launch");
+ hibernateConsolePropsFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
//hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- //hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
IVirtualComponent component = ComponentCore.createComponent(seamWebProject);
@@ -443,10 +443,10 @@
new File(ejbProjectFolder, ejbProjectFolder.getName() + ".launch"), //$NON-NLS-1$
new FilterSetCollection(ejbFilterSet), true);
- /*AntCopyUtils.copyFileToFolder(
+ AntCopyUtils.copyFileToFolder(
hibernateConsolePropsFile,
ejbProjectFolder,
- hibernateDialectFilterSet, true);*/
+ hibernateDialectFilterSet, true);
}
protected void createEarProject() {
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch 2009-12-23 13:47:51 UTC (rev 19551)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch 2009-12-23 14:11:20 UTC (rev 19552)
@@ -10,4 +10,5 @@
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName@"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME" value="@connectionProfile@"/>
+<stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/@projectName(a)/hibernate-console.properties"/>
</launchConfiguration>
Added: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties (rev 0)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties 2009-12-23 14:11:20 UTC (rev 19552)
@@ -0,0 +1,4 @@
+#File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml
+hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
+hibernate.datasource=
+hibernate.transaction.manager_lookup_class=
\ No newline at end of file
Property changes on: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch 2009-12-23 13:47:51 UTC (rev 19551)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch 2009-12-23 14:11:20 UTC (rev 19552)
@@ -10,4 +10,5 @@
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName@"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
<stringAttribute key="org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE" value="true"/>
+<stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/@projectName(a)/hibernate-console.properties"/>
</launchConfiguration>
Modified: branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-12-23 13:47:51 UTC (rev 19551)
+++ branches/jbosstools-3.1.0.RC1/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-12-23 14:11:20 UTC (rev 19552)
@@ -114,7 +114,7 @@
// Database group
private IFieldEditor connProfileSelEditor;
- private IFieldEditor jBossHibernateDbTypeEditor ;
+ //private IFieldEditor jBossHibernateDbTypeEditor ;
private IFieldEditor dbSchemaName;
@@ -283,11 +283,11 @@
model.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, getJpaConnectionProfile());
}
- if (jBossHibernateDbTypeEditor != null) {
+ /*if (jBossHibernateDbTypeEditor != null) {
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE,
this.jBossHibernateDbTypeEditor.getValueAsString());
- }
+ }*/
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
@@ -468,23 +468,23 @@
}
public void createDatabaseGoupControl() {
- disposeControls(jBossHibernateDbTypeEditor);
+ //disposeControls(jBossHibernateDbTypeEditor);
disposeControls(connProfileSelEditor);
disposeControls(dbSchemaName);
disposeControls(dbCatalogName);
disposeControls(dbTablesExists);
disposeControls(recreateTablesOnDeploy);
if (!needToShowConnectionProfile){
- jBossHibernateDbTypeEditor = null;
+ //jBossHibernateDbTypeEditor = null;
connProfileSelEditor = null;
dbSchemaName = null;
dbCatalogName = null;
} else {
- jBossHibernateDbTypeEditor = IFieldEditorFactory.INSTANCE
+ /*jBossHibernateDbTypeEditor = IFieldEditorFactory.INSTANCE
.createComboEditor(ISeamFacetDataModelProperties.DB_TYPE,
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE_TYPE,
Arrays.asList(HIBERNATE_HELPER.getDialectNames()),
- getDefaultDbType(), false);
+ getDefaultDbType(), false);*/
connProfileSelEditor = SeamWizardFactory
.createConnectionProfileSelectionFieldEditor(
getConnectionProfileDefaultValue(), new IValidator() {
@@ -505,7 +505,7 @@
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE_CATALOG_NAME,
""); //$NON-NLS-1$
- jBossHibernateDbTypeEditor
+ /*jBossHibernateDbTypeEditor
.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
SeamInstallWizardPage.this.model
@@ -515,7 +515,7 @@
.getNewValue().toString()));
}
});
- registerEditor(jBossHibernateDbTypeEditor, databaseGroup, 4);
+ registerEditor(jBossHibernateDbTypeEditor, databaseGroup, 4);*/
registerEditor(connProfileSelEditor, databaseGroup, 4);
registerEditor(dbSchemaName, databaseGroup, 4);
registerEditor(dbCatalogName, databaseGroup, 4);
15 years
JBoss Tools SVN: r19551 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-23 08:47:51 -0500 (Wed, 23 Dec 2009)
New Revision: 19551
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5570
copy hibernate.properties into seam project
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 13:38:23 UTC (rev 19550)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 13:47:51 UTC (rev 19551)
@@ -763,6 +763,11 @@
dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
componentsFile = new File(seamGenResFolder, "WEB-INF/components" + (isWarConfiguration(model) ? "-war" : "") + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ try {
+ hibernateConsolePropsFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
if (jpaVersion != null) {
IScopeContext context = new ProjectScope(project);
IEclipsePreferences prefs = context.getNode("org.eclipse.jpt.core");
@@ -774,7 +779,7 @@
hibernateConsoleLaunchFile = null;
} else {
try {
- hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console_jpa.launch");
+ hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console_jpa.launch");//$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
@@ -783,7 +788,6 @@
} else {
try {
hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.launch");
- hibernateConsolePropsFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
15 years
JBoss Tools SVN: r19550 - in trunk/seam/plugins: org.jboss.tools.seam.core/templates/hibernatetools and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-12-23 08:38:23 -0500 (Wed, 23 Dec 2009)
New Revision: 19550
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch
trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5570
copy hibernate.properties into seam project
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 13:37:11 UTC (rev 19549)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2009-12-23 13:38:23 UTC (rev 19550)
@@ -307,7 +307,7 @@
protected File webInfClassesMetaInf;
protected File persistenceFile;
protected File hibernateConsoleLaunchFile;
- //protected File hibernateConsolePropsFile;
+ protected File hibernateConsolePropsFile;
/**
*
@@ -498,10 +498,10 @@
viewFilterSetCollection, false);
}
- /*AntCopyUtils.copyFileToFolder(
+ AntCopyUtils.copyFileToFolder(
hibernateConsolePropsFile,
project.getLocation().toFile(),
- hibernateDialectFilterSet, false);*/
+ hibernateDialectFilterSet, false);
WtpUtils.setClasspathEntryAsExported(project, new Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
} else {
@@ -684,8 +684,8 @@
ejbProjectFolder, ejbProjectFolder.getName() + ".launch"), //$NON-NLS-1$
new FilterSetCollection(ejbFilterSet), false);
- /*AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
- ejbProjectFolder, hibernateDialectFilterSet, false);*/
+ AntCopyUtils.copyFileToFolder(hibernateConsolePropsFile,
+ ejbProjectFolder, hibernateDialectFilterSet, false);
}
enum ProjectType {
@@ -783,12 +783,12 @@
} else {
try {
hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.launch");
+ hibernateConsolePropsFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
//hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
}
- //hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
//final File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
persistenceFile = new File(seamGenResFolder, "META-INF/persistence-" + (isWarConfiguration(model) ? DEV_WAR_PROFILE : DEV_EAR_PROFILE) + ".xml"); //$NON-NLS-1$ //$NON-NLS-2$
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2009-12-23 13:37:11 UTC (rev 19549)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2009-12-23 13:38:23 UTC (rev 19550)
@@ -90,7 +90,7 @@
protected File seamGenResFolder;
protected File persistenceFile;
protected File hibernateConsoleLaunchFile;
- //protected File hibernateConsolePropsFile;
+ protected File hibernateConsolePropsFile;
protected FilterSet jdbcFilterSet;
protected FilterSet encodedJdbcFilterSet;
@@ -137,11 +137,11 @@
try {
hibernateConsoleLaunchFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.launch");
+ hibernateConsolePropsFile = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
}
//hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
- //hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml"); //$NON-NLS-1$
IVirtualComponent component = ComponentCore.createComponent(seamWebProject);
@@ -443,10 +443,10 @@
new File(ejbProjectFolder, ejbProjectFolder.getName() + ".launch"), //$NON-NLS-1$
new FilterSetCollection(ejbFilterSet), true);
- /*AntCopyUtils.copyFileToFolder(
+ AntCopyUtils.copyFileToFolder(
hibernateConsolePropsFile,
ejbProjectFolder,
- hibernateDialectFilterSet, true);*/
+ hibernateDialectFilterSet, true);
}
protected void createEarProject() {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch 2009-12-23 13:37:11 UTC (rev 19549)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.launch 2009-12-23 13:38:23 UTC (rev 19550)
@@ -10,4 +10,5 @@
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName@"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONNECTION_PROFILE_NAME" value="@connectionProfile@"/>
+<stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/@projectName(a)/hibernate-console.properties"/>
</launchConfiguration>
Added: trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties 2009-12-23 13:38:23 UTC (rev 19550)
@@ -0,0 +1,4 @@
+#File used by hibernate tools to override <datasource> and other container specific settings in persistence.xml
+hibernate.connection.provider_class org.hibernate.connection.DriverManagerConnectionProvider
+hibernate.datasource=
+hibernate.transaction.manager_lookup_class=
\ No newline at end of file
Property changes on: trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console.properties
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:eol-style
+ native
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch 2009-12-23 13:37:11 UTC (rev 19549)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/hibernatetools/hibernate-console_jpa.launch 2009-12-23 13:38:23 UTC (rev 19550)
@@ -10,4 +10,5 @@
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="@projectName@"/>
<stringAttribute key="org.hibernate.eclipse.launch.CONFIGURATION_FACTORY" value="JPA"/>
<stringAttribute key="org.hibernate.eclipse.launch.USE_JPA_PROJECT_PROFILE" value="true"/>
+<stringAttribute key="org.hibernate.eclipse.launch.PROPERTY_FILE" value="/@projectName(a)/hibernate-console.properties"/>
</launchConfiguration>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-12-23 13:37:11 UTC (rev 19549)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2009-12-23 13:38:23 UTC (rev 19550)
@@ -115,7 +115,7 @@
// Database group
private IFieldEditor connProfileSelEditor;
- private IFieldEditor jBossHibernateDbTypeEditor ;
+ //private IFieldEditor jBossHibernateDbTypeEditor ;
private IFieldEditor dbSchemaName;
@@ -284,11 +284,11 @@
model.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE, getJpaConnectionProfile());
}
- if (jBossHibernateDbTypeEditor != null) {
+ /*if (jBossHibernateDbTypeEditor != null) {
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamProjectPreferences.HIBERNATE_DEFAULT_DB_TYPE,
this.jBossHibernateDbTypeEditor.getValueAsString());
- }
+ }*/
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
@@ -469,23 +469,23 @@
}
public void createDatabaseGoupControl() {
- disposeControls(jBossHibernateDbTypeEditor);
+ //disposeControls(jBossHibernateDbTypeEditor);
disposeControls(connProfileSelEditor);
disposeControls(dbSchemaName);
disposeControls(dbCatalogName);
disposeControls(dbTablesExists);
disposeControls(recreateTablesOnDeploy);
if (!needToShowConnectionProfile){
- jBossHibernateDbTypeEditor = null;
+ //jBossHibernateDbTypeEditor = null;
connProfileSelEditor = null;
dbSchemaName = null;
dbCatalogName = null;
} else {
- jBossHibernateDbTypeEditor = IFieldEditorFactory.INSTANCE
+ /*jBossHibernateDbTypeEditor = IFieldEditorFactory.INSTANCE
.createComboEditor(ISeamFacetDataModelProperties.DB_TYPE,
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE_TYPE,
Arrays.asList(HIBERNATE_HELPER.getDialectNames()),
- getDefaultDbType(), false);
+ getDefaultDbType(), false);*/
connProfileSelEditor = SeamWizardFactory
.createConnectionProfileSelectionFieldEditor(
getConnectionProfileDefaultValue(), new IValidator() {
@@ -506,7 +506,7 @@
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_DATABASE_CATALOG_NAME,
""); //$NON-NLS-1$
- jBossHibernateDbTypeEditor
+ /*jBossHibernateDbTypeEditor
.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
SeamInstallWizardPage.this.model
@@ -516,7 +516,7 @@
.getNewValue().toString()));
}
});
- registerEditor(jBossHibernateDbTypeEditor, databaseGroup, 4);
+ registerEditor(jBossHibernateDbTypeEditor, databaseGroup, 4);*/
registerEditor(connProfileSelEditor, databaseGroup, 4);
registerEditor(dbSchemaName, databaseGroup, 4);
registerEditor(dbCatalogName, databaseGroup, 4);
15 years
JBoss Tools SVN: r19549 - in trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model: converters and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-23 08:37:11 -0500 (Wed, 23 Dec 2009)
New Revision: 19549
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5547
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java 2009-12-23 13:23:18 UTC (rev 19548)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/SpecificPropertyConverter.java 2009-12-23 13:37:11 UTC (rev 19549)
@@ -57,8 +57,7 @@
public XModelObject convertBasicToSpecific(XModelObject parent, XModelObject basic) {
String entity = basic.getModelEntity().getName();
if("ESBFTPListener120".equals(entity)) {
- IPropertyConverter converter = new FTPListenerConverter();
- converter.toSpecific(basic, basic);
+ FTPListenerConverter.instance.toSpecific(basic, basic);
}
//returns null because no new object is created
return null;
@@ -69,8 +68,7 @@
XModelObject basic = specific;
if("ESBFTPListener120".equals(entity)) {
basic = basic.copy();
- IPropertyConverter converter = new FTPListenerConverter();
- converter.toBasic(basic, specific);
+ FTPListenerConverter.instance.toBasic(basic, specific);
}
return basic;
}
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java 2009-12-23 13:23:18 UTC (rev 19548)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java 2009-12-23 13:37:11 UTC (rev 19549)
@@ -17,6 +17,7 @@
* @author Viacheslav Kabanovich
*/
public class FTPListenerConverter implements IPropertyConverter {
+ public static FTPListenerConverter instance = new FTPListenerConverter();
public FTPListenerConverter() {}
@@ -26,6 +27,19 @@
return;
}
+ toBasicImpl(basic, specific);
+ }
+
+ public void toSpecific(XModelObject basic, XModelObject specific) {
+ XModelObject filter = specific.getChildByPath("Filter");
+ if(filter != null && !"true".equals(filter.getAttributeValue("read only"))) {
+ return;
+ }
+
+ toSpecificImpl(basic, specific);
+ }
+
+ public void toBasicImpl(XModelObject basic, XModelObject specific) {
XModelObject cache = specific.getChildByPath("Cache");
if(cache != null) {
SpecificActionLoader.copySpecificAtttributesToBasicProperties(cache, basic);
@@ -37,12 +51,7 @@
}
}
- public void toSpecific(XModelObject basic, XModelObject specific) {
- XModelObject filter = specific.getChildByPath("Filter");
- if(filter != null && !"true".equals(filter.getAttributeValue("read only"))) {
- return;
- }
-
+ public void toSpecificImpl(XModelObject basic, XModelObject specific) {
XModelObject cache = specific.getChildByPath("Cache");
if(cache != null) {
SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, cache);
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java 2009-12-23 13:23:18 UTC (rev 19548)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java 2009-12-23 13:37:11 UTC (rev 19549)
@@ -10,10 +10,12 @@
******************************************************************************/
package org.jboss.tools.esb.core.model.impl;
+import org.jboss.tools.common.model.XModelException;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.event.XModelTreeEvent;
import org.jboss.tools.common.model.impl.XModelImpl;
import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+import org.jboss.tools.esb.core.model.converters.FTPListenerConverter;
/**
* @author Viacheslav Kabanovich
@@ -41,4 +43,17 @@
}
}
+ protected void onAttributeValueEdit(String name, String oldValue, String newValue) throws XModelException {
+ if("read only".equals(name)) {
+ XModelObject p = getParent();
+ if(p != null) {
+ if("true".equals(newValue)) {
+ FTPListenerConverter.instance.toSpecificImpl(p, p);
+ } else if("true".equals(oldValue)) {
+ FTPListenerConverter.instance.toBasicImpl(p, p);
+ }
+ }
+ }
+ }
+
}
15 years
JBoss Tools SVN: r19548 - in trunk/esb/plugins/org.jboss.tools.esb.core: META-INF and 4 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2009-12-23 08:23:18 -0500 (Wed, 23 Dec 2009)
New Revision: 19548
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-5547
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF 2009-12-23 13:18:52 UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/META-INF/MANIFEST.MF 2009-12-23 13:23:18 UTC (rev 19548)
@@ -9,7 +9,8 @@
Export-Package: org.jboss.tools.esb.core,
org.jboss.tools.esb.core.model,
org.jboss.tools.esb.core.model.converters,
- org.jboss.tools.esb.core.model.handlers
+ org.jboss.tools.esb.core.model.handlers,
+ org.jboss.tools.esb.core.model.impl
Require-Bundle: org.jboss.tools.jst.web;visibility:=reexport,
org.eclipse.ui
Bundle-Version: 2.0.0
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-23 13:18:52 UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2009-12-23 13:23:18 UTC (rev 19548)
@@ -33,6 +33,10 @@
class="org.jboss.tools.esb.core.model.ESBRouteToImpl"/>
<xclass id="org.jboss.tools.esb.core.model.EJBParamImpl"
class="org.jboss.tools.esb.core.model.EJBParamImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
+ class="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"/>
+ <xclass id="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"
+ class="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
@@ -45,6 +49,9 @@
<xclass id="org.jboss.tools.esb.core.model.ESBResourceTree"
class="org.jboss.tools.esb.core.model.ESBResourceTree"/>
+
+ <xclass id="org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"
+ class="org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"/>
</extension>
<extension point="org.eclipse.wst.xml.core.catalogContributions">
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-23 13:18:52 UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb.meta 2009-12-23 13:23:18 UTC (rev 19548)
@@ -680,7 +680,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;saveDefault=false"
XMLSUBPATH="ftp-message-filter" name="ESBFTPMessageFilter101">
<XChildrenEntities/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-23 13:18:52 UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb12.meta 2009-12-23 13:23:18 UTC (rev 19548)
@@ -7,6 +7,9 @@
<MAPPING name="FileVersions">
<PAIR name="ESB1.2.0" value="FileESB120"/>
</MAPPING>
+ <MAPPING name="FilteredTreeConstraints">
+ <PAIR name="FileSystems$158" value="org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"/>
+ </MAPPING>
</MAPPINGS>
<ICONS/>
<GlobalActions kind="list"/>
@@ -286,7 +289,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+ ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=converter" name="ESBFTPCache">
<XChildrenEntities/>
<XEntityRenderer>
@@ -361,7 +365,7 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity ImplementingClass="org.jboss.tools.esb.core.model.impl.FTPListenerSpecificPropertiesImpl"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;converter=converter" name="ESBFTPRemote">
<XChildrenEntities/>
<XEntityRenderer>
@@ -635,7 +639,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+ ImplementingClass="%ESB%"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData"
XMLSUBPATH="listener" name="ESBListener120">
<XChildrenEntities>
@@ -1114,7 +1119,7 @@
ImplementationLoadingClass="org.jboss.tools.esb.core.model.ESBFileLoader"
ImplementingClass="org.jboss.tools.esb.core.model.ESBFileImpl"
ObjectEditorClass="%XML%"
- PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
+ PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%;editorTreeConstraint=org.jboss.tools.esb.core.model.impl.ESBTreeConstraint"
XMLSUBPATH="jbossesb" name="FileESB120">
<XChildrenEntities>
<XChildEntity maxCount="1" name="ESBGlobals120" required="yes"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java 2009-12-23 13:18:52 UTC (rev 19547)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/converters/FTPListenerConverter.java 2009-12-23 13:23:18 UTC (rev 19548)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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.esb.core.model.converters;
import org.jboss.tools.common.model.XModelObject;
@@ -3,22 +13,43 @@
import org.jboss.tools.esb.core.model.SpecificActionLoader;
+/**
+ * @author Viacheslav Kabanovich
+ */
public class FTPListenerConverter implements IPropertyConverter {
public FTPListenerConverter() {}
public void toBasic(XModelObject basic, XModelObject specific) {
+ XModelObject filter = specific.getChildByPath("Filter");
+ if(filter != null && !"true".equals(filter.getAttributeValue("read only"))) {
+ return;
+ }
+
XModelObject cache = specific.getChildByPath("Cache");
- SpecificActionLoader.copySpecificAtttributesToBasicProperties(cache, basic);
+ if(cache != null) {
+ SpecificActionLoader.copySpecificAtttributesToBasicProperties(cache, basic);
+ }
XModelObject remote = specific.getChildByPath("Remote Filesystem Strategy");
- SpecificActionLoader.copySpecificAtttributesToBasicProperties(remote, basic);
+ if(remote != null) {
+ SpecificActionLoader.copySpecificAtttributesToBasicProperties(remote, basic);
+ }
}
public void toSpecific(XModelObject basic, XModelObject specific) {
+ XModelObject filter = specific.getChildByPath("Filter");
+ if(filter != null && !"true".equals(filter.getAttributeValue("read only"))) {
+ return;
+ }
+
XModelObject cache = specific.getChildByPath("Cache");
- SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, cache);
+ if(cache != null) {
+ SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, cache);
+ }
XModelObject remote = specific.getChildByPath("Remote Filesystem Strategy");
- SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, remote);
+ if(remote != null) {
+ SpecificActionLoader.copyBasicPropertiesToSpecificAtttributes(basic, remote);
+ }
}
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java 2009-12-23 13:23:18 UTC (rev 19548)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * 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.esb.core.model.impl;
+
+import org.jboss.tools.common.model.XFilteredTreeConstraint;
+import org.jboss.tools.common.model.XModel;
+import org.jboss.tools.common.model.XModelObject;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class ESBTreeConstraint implements XFilteredTreeConstraint {
+
+ public boolean accepts(XModelObject object) {
+ String entity = object.getModelEntity().getName();
+ if("ESBFTPCache".equals(entity) || "ESBFTPRemote".equals(entity)) {
+ XModelObject p = object.getParent();
+ if(p != null) {
+ XModelObject filter = p.getChildByPath("Filter");
+ if(filter != null && !"true".equals(filter.getAttributeValue("read only"))) {
+ return false;
+ }
+ }
+ }
+ return true;
+ }
+
+ public boolean isHidingAllChildren(XModelObject object) {
+ return false;
+ }
+
+ public boolean isHidingSomeChildren(XModelObject object) {
+ String entity = object.getModelEntity().getName();
+ if("ESBFTPListener120".equals(entity)) {
+ return true;
+ }
+ return false;
+ }
+
+ public void update(XModel model) {
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ESBTreeConstraint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java 2009-12-23 13:23:18 UTC (rev 19548)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * 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.esb.core.model.impl;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class FTPListenerSpecificPropertiesImpl extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public FTPListenerSpecificPropertiesImpl() {}
+
+ public boolean isObjectEditable() {
+ if(!super.isObjectEditable()) return false;
+ XModelObject p = getParent();
+ if(p != null) {
+ XModelObject c = p.getChildByPath("Filter");
+ if(c != null && !"true".equals(c.getAttributeValue("read only"))) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPListenerSpecificPropertiesImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java (rev 0)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java 2009-12-23 13:23:18 UTC (rev 19548)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * 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.esb.core.model.impl;
+
+import org.jboss.tools.common.model.XModelObject;
+import org.jboss.tools.common.model.event.XModelTreeEvent;
+import org.jboss.tools.common.model.impl.XModelImpl;
+import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+
+/**
+ * @author Viacheslav Kabanovich
+ */
+public class FTPMessageFilterImpl extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+
+ public FTPMessageFilterImpl() {}
+
+ public String setAttributeValue(String name, String value) {
+ if("read only".equals(name) && isActive()) {
+ String ov = getAttributeValue("read only");
+ boolean changed = (value != null && !value.equals(ov));
+ String result = super.setAttributeValue(name, value);
+ if(changed) {
+ XModelObject p = getParent();
+ if(p != null) {
+ XModelImpl m = (XModelImpl)getModel();
+ m.fireStructureChanged(p, XModelTreeEvent.STRUCTURE_CHANGED, p);
+ }
+ }
+ return result;
+ } else {
+ return super.setAttributeValue(name, value);
+ }
+ }
+
+}
Property changes on: trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/FTPMessageFilterImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
15 years