JBoss Tools SVN: r16980 - in trunk/hibernatetools/plugins: org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-08-06 08:26:44 -0400 (Thu, 06 Aug 2009)
New Revision: 16980
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4723
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java 2009-08-06 11:55:19 UTC (rev 16979)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJptPlugin.java 2009-08-06 12:26:44 UTC (rev 16980)
@@ -10,9 +10,14 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Plugin;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jpt.core.JpaProject;
+import org.osgi.service.prefs.Preferences;
/**
* @author Dmitry Geraskov
@@ -79,4 +84,16 @@
log(IStatus.INFO, message, null);
}
+ public static String getDefaultConsoleConfiguration(JpaProject jpaProject){
+ IProject project = jpaProject.getProject();
+ IScopeContext scope = new ProjectScope(project);
+
+ Preferences node = scope.getNode("org.hibernate.eclipse.console"); //$NON-NLS-1$
+
+ if(node!=null) {
+ return node.get("default.configuration", project.getName() ); //$NON-NLS-1$
+ }
+ return null;
+ }
+
}
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2009-08-06 11:55:19 UTC (rev 16979)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.ui/src/org/jboss/tools/hibernate/jpt/ui/wizard/GenerateInitWizardPage.java 2009-08-06 12:26:44 UTC (rev 16980)
@@ -48,6 +48,7 @@
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
import org.hibernate.tool.hbm2x.StringUtils;
import org.hibernate.util.StringHelper;
+import org.jboss.tools.hibernate.jpt.core.internal.HibernateJptPlugin;
import org.jboss.tools.hibernate.jpt.ui.HibernateJptUIPlugin;
/**
@@ -115,7 +116,7 @@
connectionProfileName.setEnabled(!selectMethod.getSelection());
schemaName.setEnabled(!selectMethod.getSelection());
dialectName.setEnabled(!selectMethod.getSelection());
- dialogChanged();
+ dialogChanged();
}});
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = numColumns;
@@ -130,14 +131,15 @@
names[i] = configuration.getName();
}
consoleConfigurationName.setItems(names);
+ consoleConfigurationName.setText(HibernateJptPlugin.getDefaultConsoleConfiguration(jpaProject));
consoleConfigurationName.setDialogFieldListener(fieldlistener);
- consoleConfigurationName.doFillIntoGrid(container, numColumns);
-
+ consoleConfigurationName.doFillIntoGrid(container, numColumns);
+
createDBGroup(container, numColumns);
-
+
setControl(container);
}
-
+
/**
* @param parent
*/
16 years, 4 months
JBoss Tools SVN: r16979 - trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-08-06 07:55:19 -0400 (Thu, 06 Aug 2009)
New Revision: 16979
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4722
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-08-06 11:35:59 UTC (rev 16978)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-08-06 11:55:19 UTC (rev 16979)
@@ -174,7 +174,9 @@
protected void refreshProfile(IConnectionProfile profile) {
// refresh profile (refresh jpa connection):
// get fresh information about current db structure and update error markers
- profile.disconnect();
+ if (profile.getConnectionState() == IConnectionProfile.CONNECTED_STATE){
+ profile.disconnect();
+ }
profile.connect(null);
}
16 years, 4 months
JBoss Tools SVN: r16978 - trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2009-08-06 07:35:59 -0400 (Thu, 06 Aug 2009)
New Revision: 16978
Modified:
trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java
Log:
JBIDE-4660: Update and correct the CA-related JUnit tests after the new-style CA is applied.
Test project data for SeamUiAllTests JUnit Test suite is updated to suite the new-style CA requirements:
SeamELContentAssistTestCase.testMessages test case is fixed
Modified: trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java 2009-08-06 10:41:50 UTC (rev 16977)
+++ trunk/seam/tests/org.jboss.tools.seam.ui.test/src/org/jboss/tools/seam/ui/test/ca/SeamELContentAssistTestCase.java 2009-08-06 11:35:59 UTC (rev 16978)
@@ -277,7 +277,7 @@
*/
public void testMessages() {
assertTrue("Test project \"" + PROJECT_NAME + "\" is not loaded", (project != null));
- checkProposals("/WebContent/messages.xhtml", 494, new String[]{"messages.Text1", "messages.Text2"}, true);
+ checkProposals("/WebContent/messages.xhtml", 494, new String[]{"messages.Text1", "messages.Text2"}, false); // exactly == false, because of current attribute value is also in the proposals list
}
/**
16 years, 4 months
JBoss Tools SVN: r16977 - in trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration: editors and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-08-06 06:41:50 -0400 (Thu, 06 Aug 2009)
New Revision: 16977
Added:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/OnlyReaderViewerFilter.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/TextEObjectModelFilter.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java
Log:
JBIDE-4712
add smooks navigator
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/OnlyReaderViewerFilter.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/OnlyReaderViewerFilter.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/OnlyReaderViewerFilter.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.jface.viewers.Viewer;
+import org.jboss.tools.smooks.model.smooks.AbstractReader;
+
+/**
+ * @author Dart
+ *
+ */
+public class OnlyReaderViewerFilter extends TextEObjectModelFilter {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ Object obj = element;
+ obj = AdapterFactoryEditingDomain.unwrap(obj);
+ if (obj instanceof AbstractReader) {
+ return true;
+ } else {
+ if (obj instanceof EObject) {
+ EObject parent = (EObject) obj;
+ while (parent != null && !(parent instanceof AbstractReader)) {
+ parent = parent.eContainer();
+ if (parent instanceof AbstractReader) {
+ return true;
+ }
+ }
+ }
+ }
+ return false;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/OnlyReaderViewerFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java 2009-08-06 10:32:46 UTC (rev 16976)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationFormPage.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -10,86 +10,57 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
-import java.io.IOException;
import java.util.Collection;
-import java.util.Collections;
import java.util.List;
import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.Section;
-import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
import org.jboss.tools.smooks.configuration.editors.wizard.StructuredDataSelectionWizard;
import org.jboss.tools.smooks.configuration.validate.ISmooksModelValidateListener;
-import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.editor.ISourceSynchronizeListener;
import org.jboss.tools.smooks.model.graphics.ext.ISmooksGraphChangeListener;
-import org.jboss.tools.smooks.model.graphics.ext.InputType;
import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
-import org.jboss.tools.smooks.model.smooks.DocumentRoot;
/**
* @author Dart Peng (dpeng(a)redhat.com) Date Apr 1, 2009
*/
-public class SmooksConfigurationFormPage extends FormPage implements ISmooksModelValidateListener , ISmooksGraphChangeListener , ISourceSynchronizeListener{
+public class SmooksConfigurationFormPage extends FormPage implements ISmooksModelValidateListener,
+ ISmooksGraphChangeListener, ISourceSynchronizeListener {
private SmooksMasterDetailBlock masterDetailBlock = null;
- private TableViewer inputDataViewer;
-
public SmooksConfigurationFormPage(FormEditor editor, String id, String title) {
super(editor, id, title);
- ((SmooksMultiFormEditor)editor).getSmooksGraphicsExt().addSmooksGraphChangeListener(this);
+ ((SmooksMultiFormEditor) editor).getSmooksGraphicsExt().addSmooksGraphChangeListener(this);
}
public SmooksConfigurationFormPage(String id, String title) {
super(id, title);
}
+ protected String getMainSectionTitle() {
+ return null;
+ }
+
+ protected String getMainSectionDescription() {
+ return null;
+ }
+
@Override
protected void createFormContent(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
FormToolkit toolkit = managedForm.getToolkit();
toolkit.decorateFormHeading(form.getForm());
- String title = getTitle();
- EObject smooksModel = ((ISmooksModelProvider) getEditor()).getSmooksModel();
- if (smooksModel != null) {
- EObject parent = smooksModel;
- while (parent != null) {
- EObject old = parent;
- parent = parent.eContainer();
- if (parent == null) {
- parent = old;
- break;
- }
- }
- if (parent instanceof DocumentRoot) {
- title = "Smooks 1.1 - " + title;
- }
- if (parent instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
- title = "Smooks 1.0 - " + title;
- }
- }
- form.setText(title);
+ setPageTitle(form);
// create master details UI
createMasterDetailBlock(managedForm);
GridLayout gridLayout = new GridLayout();
@@ -97,113 +68,38 @@
// gridLayout.numColumns = 2;
// gridLayout.makeColumnsEqualWidth = true;
form.getBody().setLayout(gridLayout);
- // create extention UI for add/remove extention data
- createExtentionArea(managedForm);
}
+ protected void setPageTitle(ScrolledForm form) {
+ String title = getTitle();
+ form.setText(title);
+ }
+
protected void createMasterDetailBlock(IManagedForm managedForm) {
masterDetailBlock = new SmooksMasterDetailBlock(getEditor(),
(AdapterFactoryEditingDomain) ((SmooksMultiFormEditor) getEditor()).getEditingDomain());
+ ViewerFilter[] filters = createViewerFilters();
+ masterDetailBlock.setViewerFilters(filters);
+ masterDetailBlock.setMainSectionDescription(getMainSectionDescription());
+ masterDetailBlock.setMainSectionTitle(getMainSectionTitle());
+ masterDetailBlock.setNewSmooksElementTitle(getNewSmooksElementTitle());
+ masterDetailBlock.setNewSmooksElementDescription(getNewSmooksElementDescription());
masterDetailBlock.createContent(managedForm);
}
- protected void createExtentionArea(IManagedForm managedForm) {
- FormToolkit toolkit = managedForm.getToolkit();
- final ScrolledForm form = managedForm.getForm();
- Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- section.setLayoutData(gd);
- section.setText("Input Data");
- FillLayout flayout = new FillLayout();
- section.setLayout(flayout);
+ protected String getNewSmooksElementTitle() {
+ return null;
+ }
- Composite mainComposite = toolkit.createComposite(section, SWT.NONE);
- GridLayout gl = new GridLayout();
- gl.numColumns = 2;
- mainComposite.setLayout(gl);
- section.setClient(mainComposite);
+ protected String getNewSmooksElementDescription() {
+ return null;
+ }
- Composite tableComposite = toolkit.createComposite(mainComposite, SWT.NONE);
- FillLayout fillLayout = new FillLayout();
- fillLayout.marginHeight = 1;
- fillLayout.marginWidth = 1;
- gd = new GridData(GridData.FILL_BOTH);
- tableComposite.setLayoutData(gd);
- tableComposite.setBackground(GraphicsConstants.BORDER_CORLOER);
- tableComposite.setLayout(fillLayout);
-
- inputDataViewer = new TableViewer(tableComposite, SWT.MULTI | SWT.FULL_SELECTION);
- TableColumn header = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
- header.setText("Type");
- header.setWidth(100);
- TableColumn pathColumn = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
- pathColumn.setText("Path");
- pathColumn.setWidth(300);
-
- TableColumn extColumn = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
- extColumn.setText("Extension Paramers");
- extColumn.setWidth(400);
-
-
- inputDataViewer.setContentProvider(new ExtentionInputContentProvider());
- inputDataViewer.setLabelProvider(new ExtentionInputLabelProvider());
- inputDataViewer.getTable().setHeaderVisible(true);
- inputDataViewer.getTable().setLinesVisible(true);
- SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
- if (extType != null) {
- inputDataViewer.setInput(extType);
- }
- Composite buttonComposite = toolkit.createComposite(mainComposite, SWT.NONE);
- gd = new GridData(GridData.FILL_VERTICAL);
- buttonComposite.setLayoutData(gd);
- GridLayout l = new GridLayout();
- buttonComposite.setLayout(l);
-
- Button addButton = toolkit.createButton(buttonComposite, "Add", SWT.FLAT);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- addButton.setLayoutData(gd);
- addButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- showInputDataWizard();
- }
-
- });
-
- Button removeButton = toolkit.createButton(buttonComposite, "Delete", SWT.FLAT);
- gd = new GridData(GridData.FILL_HORIZONTAL);
- removeButton.setLayoutData(gd);
- removeButton.addSelectionListener(new SelectionAdapter() {
-
- public void widgetSelected(SelectionEvent e) {
- IStructuredSelection selection = (IStructuredSelection) inputDataViewer.getSelection();
- if (selection != null) {
- SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
- if (extType != null) {
- boolean canSave = false;
- Object[] objs = selection.toArray();
- for (int i = 0; i < objs.length; i++) {
- Object obj = objs[i];
- if (obj instanceof InputType) {
- extType.getInput().remove(obj);
- canSave = true;
- }
- }
- if (!canSave)
- return;
- try {
- extType.eResource().save(Collections.emptyMap());
- inputDataViewer.refresh();
- } catch (IOException t) {
- SmooksConfigurationActivator.getDefault().log(t);
- }
- }
- }
- }
- });
+ protected ViewerFilter[] createViewerFilters() {
+ return new ViewerFilter[] { new TextEObjectModelFilter() };
}
- private SmooksGraphicsExtType getSmooksGraphicsExtType() {
+ protected SmooksGraphicsExtType getSmooksGraphicsExtType() {
SmooksGraphicsExtType extType = ((SmooksMultiFormEditor) getEditor()).getSmooksGraphicsExt();
return extType;
}
@@ -218,10 +114,10 @@
wizard.setSite(getEditorSite());
wizard.setForcePreviousAndNextButtons(true);
StructuredDataSelectionWizardDailog dialog = new StructuredDataSelectionWizardDailog(
- getEditorSite().getShell(), wizard , getSmooksGraphicsExtType(),(SmooksMultiFormEditor)getEditor());
+ getEditorSite().getShell(), wizard, getSmooksGraphicsExtType(), (SmooksMultiFormEditor) getEditor());
dialog.show();
}
-
+
public void setSelectionToViewer(final Collection<?> collection) {
if (masterDetailBlock != null && masterDetailBlock.getSmooksTreeViewer() != null) {
// I don't know if this should be run this deferred
@@ -241,7 +137,7 @@
}
}
};
-
+
runnable.run();
}
}
@@ -256,7 +152,6 @@
}
public void saveComplete(SmooksGraphicsExtType extType) {
- inputDataViewer.refresh();
}
public void sourceChange(Object model) {
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-08-06 10:32:46 UTC (rev 16976)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationOverviewPage.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -10,6 +10,10 @@
******************************************************************************/
package org.jboss.tools.smooks.configuration.editors;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
import java.util.List;
import org.eclipse.emf.common.command.Command;
@@ -35,20 +39,18 @@
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
+import org.eclipse.ui.forms.events.HyperlinkAdapter;
+import org.eclipse.ui.forms.events.HyperlinkEvent;
+import org.eclipse.ui.forms.widgets.FormText;
import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
@@ -779,29 +781,61 @@
gd.verticalAlignment = GridData.BEGINNING;
navigator.setLayoutData(gd);
- navigatorComposite.setLayout(new FormLayout());
+ FormText formText = toolkit.createFormText(navigatorComposite, true);
+ StringBuffer buf = new StringBuffer();
+ InputStream inputStream = this.getClass().getResourceAsStream(
+ "/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm");
+ BufferedReader reader = null;
+ if (inputStream != null) {
+ try {
+ reader = new BufferedReader(new InputStreamReader(inputStream));
+ String line = reader.readLine();
+ while (line != null) {
+ buf.append(line);
+ line = reader.readLine();
+ }
+ } catch (IOException e) {
- Label label1 = toolkit.createLabel(navigatorComposite, "Define the ");
- FormData data = new FormData ();
- data.left = new FormAttachment(label1);
- Hyperlink defaultSettingLink = toolkit.createHyperlink(navigatorComposite, "default setting", SWT.NONE);
- defaultSettingLink.setLayoutData(data);
-
- Label label2 = toolkit.createLabel(navigatorComposite, " and ");
- data = new FormData ();
- data.left = new FormAttachment(defaultSettingLink);
- label2.setLayoutData(data);
-
- data = new FormData ();
- data.left = new FormAttachment(label2);
- Hyperlink paramLink = toolkit.createHyperlink(navigatorComposite, "global paramters", SWT.NONE);
- paramLink.setLayoutData(data);
-
- data = new FormData ();
- data.left = new FormAttachment(paramLink);
- Label label3 = toolkit.createLabel(navigatorComposite, " at this page.");
- label3.setLayoutData(data);
+ } finally {
+ try {
+ if (reader != null) {
+ reader.close();
+ }
+ if (inputStream != null) {
+ inputStream.close();
+ }
+ } catch (Throwable t) {
+
+ }
+ }
+ }
+ formText.setWhitespaceNormalized(true);
+ String content = buf.toString();
+ if (content != null) {
+ try {
+ formText.setText(content, true, false);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ }
+ formText.addHyperlinkListener(new HyperlinkAdapter() {
+ public void linkActivated(HyperlinkEvent e) {
+ Object href = e.getHref();
+ if(href == null) return;
+ activeNavigatorLink(href.toString());
+ }
+ });
+ navigatorComposite.setLayout(new GridLayout());
+ gd = new GridData(GridData.FILL_BOTH);
+ formText.setLayoutData(gd);
}
+
+ protected void activeNavigatorLink(String href){
+ if(href == null)return;
+ if(href.equals("reader_page")){
+ this.getEditor().setActivePage("Reader");
+ }
+ }
private EObject getSmooksResourceList() {
if (smooksModelProvider != null) {
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -0,0 +1,190 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors;
+
+import java.io.IOException;
+import java.util.Collections;
+
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.TableViewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.FormToolkit;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.eclipse.ui.forms.widgets.Section;
+import org.jboss.tools.smooks.configuration.SmooksConfigurationActivator;
+import org.jboss.tools.smooks.model.graphics.ext.InputType;
+import org.jboss.tools.smooks.model.graphics.ext.SmooksGraphicsExtType;
+
+/**
+ * @author Dart
+ *
+ */
+public class SmooksConfigurationReaderPage extends SmooksConfigurationFormPage {
+
+ private TableViewer inputDataViewer;
+
+ public SmooksConfigurationReaderPage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ }
+
+ public SmooksConfigurationReaderPage(String id, String title) {
+ super(id, title);
+ }
+
+ @Override
+ protected ViewerFilter[] createViewerFilters() {
+ return new ViewerFilter[]{new OnlyReaderViewerFilter()};
+ }
+
+ @Override
+ protected String getNewSmooksElementDescription() {
+ return "create new smooks reader";
+ }
+
+ @Override
+ protected String getNewSmooksElementTitle() {
+ return "New Smooks Reader";
+ }
+
+ @Override
+ protected String getMainSectionDescription() {
+ return "Edit the smooks readers";
+ }
+
+ @Override
+ protected String getMainSectionTitle() {
+ return "Reader";
+ }
+
+ @Override
+ protected void setPageTitle(ScrolledForm form) {
+ form.setText("Reader/Input");
+ }
+
+ protected void createFormContent(IManagedForm managedForm) {
+ super.createFormContent(managedForm);
+ // create extention UI for add/remove extention data
+ createExtentionArea(managedForm);
+ }
+
+ protected void createExtentionArea(IManagedForm managedForm) {
+ FormToolkit toolkit = managedForm.getToolkit();
+ final ScrolledForm form = managedForm.getForm();
+ Section section = toolkit.createSection(form.getBody(), Section.TITLE_BAR | Section.TWISTIE | Section.EXPANDED);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ section.setLayoutData(gd);
+ section.setText("Input Data");
+ FillLayout flayout = new FillLayout();
+ section.setLayout(flayout);
+
+ Composite mainComposite = toolkit.createComposite(section, SWT.NONE);
+ GridLayout gl = new GridLayout();
+ gl.numColumns = 2;
+ mainComposite.setLayout(gl);
+ section.setClient(mainComposite);
+
+ Composite tableComposite = toolkit.createComposite(mainComposite, SWT.NONE);
+ FillLayout fillLayout = new FillLayout();
+ fillLayout.marginHeight = 1;
+ fillLayout.marginWidth = 1;
+ gd = new GridData(GridData.FILL_BOTH);
+ tableComposite.setLayoutData(gd);
+ tableComposite.setBackground(GraphicsConstants.BORDER_CORLOER);
+ tableComposite.setLayout(fillLayout);
+
+ inputDataViewer = new TableViewer(tableComposite, SWT.MULTI | SWT.FULL_SELECTION);
+ TableColumn header = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
+ header.setText("Type");
+ header.setWidth(100);
+ TableColumn pathColumn = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
+ pathColumn.setText("Path");
+ pathColumn.setWidth(300);
+
+ TableColumn extColumn = new TableColumn(inputDataViewer.getTable(), SWT.NONE);
+ extColumn.setText("Extension Paramers");
+ extColumn.setWidth(400);
+
+
+ inputDataViewer.setContentProvider(new ExtentionInputContentProvider());
+ inputDataViewer.setLabelProvider(new ExtentionInputLabelProvider());
+ inputDataViewer.getTable().setHeaderVisible(true);
+ inputDataViewer.getTable().setLinesVisible(true);
+ SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
+ if (extType != null) {
+ inputDataViewer.setInput(extType);
+ }
+ Composite buttonComposite = toolkit.createComposite(mainComposite, SWT.NONE);
+ gd = new GridData(GridData.FILL_VERTICAL);
+ buttonComposite.setLayoutData(gd);
+ GridLayout l = new GridLayout();
+ buttonComposite.setLayout(l);
+
+ Button addButton = toolkit.createButton(buttonComposite, "Add", SWT.FLAT);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ addButton.setLayoutData(gd);
+ addButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ showInputDataWizard();
+ }
+
+ });
+
+ Button removeButton = toolkit.createButton(buttonComposite, "Delete", SWT.FLAT);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ removeButton.setLayoutData(gd);
+ removeButton.addSelectionListener(new SelectionAdapter() {
+
+ public void widgetSelected(SelectionEvent e) {
+ IStructuredSelection selection = (IStructuredSelection) inputDataViewer.getSelection();
+ if (selection != null) {
+ SmooksGraphicsExtType extType = getSmooksGraphicsExtType();
+ if (extType != null) {
+ boolean canSave = false;
+ Object[] objs = selection.toArray();
+ for (int i = 0; i < objs.length; i++) {
+ Object obj = objs[i];
+ if (obj instanceof InputType) {
+ extType.getInput().remove(obj);
+ canSave = true;
+ }
+ }
+ if (!canSave)
+ return;
+ try {
+ extType.eResource().save(Collections.emptyMap());
+ inputDataViewer.refresh();
+ } catch (IOException t) {
+ SmooksConfigurationActivator.getDefault().log(t);
+ }
+ }
+ }
+ }
+ });
+ }
+
+ public void saveComplete(SmooksGraphicsExtType extType) {
+ inputDataViewer.refresh();
+ }
+
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationReaderPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -0,0 +1,109 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors;
+
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+import org.eclipse.ui.forms.editor.FormEditor;
+import org.eclipse.ui.forms.widgets.ScrolledForm;
+import org.jboss.tools.smooks.model.smooks.AbstractReader;
+import org.jboss.tools.smooks.model.smooks.ConditionsType;
+import org.jboss.tools.smooks.model.smooks.ParamsType;
+
+/**
+ * @author Dart
+ *
+ */
+public class SmooksConfigurationResourceConfigPage extends SmooksConfigurationFormPage {
+
+ public SmooksConfigurationResourceConfigPage(FormEditor editor, String id, String title) {
+ super(editor, id, title);
+ }
+
+ public SmooksConfigurationResourceConfigPage(String id, String title) {
+ super(id, title);
+ }
+
+ @Override
+ protected ViewerFilter[] createViewerFilters() {
+ ViewerFilter filter = new ViewerFilter() {
+
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ Object obj = element;
+ obj = AdapterFactoryEditingDomain.unwrap(obj);
+ if(obj instanceof ParamsType){
+ return false;
+ }
+ if(obj instanceof ConditionsType){
+ return false;
+ }
+ if(obj instanceof AbstractReader){
+ return false;
+ }
+ return true;
+ }
+ };
+
+ ViewerFilter[] filters = super.createViewerFilters();
+ ViewerFilter[] newFilters = new ViewerFilter[filters.length + 1];
+ newFilters[0] = filter;
+ System.arraycopy(filters, 0, newFilters,1, filters.length);
+ return newFilters;
+ }
+
+
+
+
+ @Override
+ protected void setPageTitle(ScrolledForm form) {
+// EObject smooksModel = ((ISmooksModelProvider) getEditor()).getSmooksModel();
+// if (smooksModel != null) {
+// EObject parent = smooksModel;
+// while (parent != null) {
+// EObject old = parent;
+// parent = parent.eContainer();
+// if (parent == null) {
+// parent = old;
+// break;
+// }
+// }
+// if (parent instanceof DocumentRoot) {
+// title = "Smooks 1.1 - " + title;
+// }
+// if (parent instanceof org.jboss.tools.smooks10.model.smooks.DocumentRoot) {
+// title = "Smooks 1.0 - " + title;
+// }
+// }
+ form.setText("Desgin");
+ }
+
+ @Override
+ protected String getNewSmooksElementDescription() {
+ return super.getNewSmooksElementDescription();
+ }
+
+ @Override
+ protected String getNewSmooksElementTitle() {
+ return super.getNewSmooksElementTitle();
+ }
+
+ @Override
+ protected String getMainSectionDescription() {
+ return super.getMainSectionDescription();
+ }
+
+ @Override
+ protected String getMainSectionTitle() {
+ return super.getMainSectionTitle();
+ }
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksConfigurationResourceConfigPage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-08-06 10:32:46 UTC (rev 16976)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMasterDetailBlock.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -17,9 +17,6 @@
import org.eclipse.emf.common.command.Command;
import org.eclipse.emf.common.command.CompoundCommand;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.BasicFeatureMapEntry;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
import org.eclipse.emf.edit.command.DeleteCommand;
import org.eclipse.emf.edit.command.MoveCommand;
import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
@@ -31,11 +28,11 @@
import org.eclipse.jface.viewers.DecoratingLabelProvider;
import org.eclipse.jface.viewers.IElementComparer;
import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.swt.SWT;
@@ -60,7 +57,6 @@
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.model.common.AbstractAnyType;
import org.jboss.tools.smooks.model.smooks.DocumentRoot;
-import org.jboss.tools.smooks.model.smooks.ParamsType;
/**
* @author Dart Peng (dpeng(a)redhat.com)
@@ -77,15 +73,31 @@
private Button upButton;
private Button downButton;
+ private String newSmooksElementTitle;
+
+ private String newSmooksElementDescription;
+
private AdapterFactoryEditingDomain editingDomain = null;
+ private ViewerFilter[] viewerFilters = null;
+
private FormEditor formEditor;
+ private String sectionTitle;
+ private String sectionDescription;
public SmooksMasterDetailBlock(FormEditor formEditor, AdapterFactoryEditingDomain editingDomain) {
this.editingDomain = editingDomain;
this.formEditor = formEditor;
}
+ public ViewerFilter[] getViewerFilters() {
+ return viewerFilters;
+ }
+
+ public void setViewerFilters(ViewerFilter[] viewerFilters) {
+ this.viewerFilters = viewerFilters;
+ }
+
/*
* (non-Javadoc)
*
@@ -143,10 +155,31 @@
smooksTreeViewer.refresh();
}
+ public void setMainSectionTitle(String sectionTitle) {
+ this.sectionTitle = sectionTitle;
+ }
+
+ public String getMainSectionTitle() {
+ return sectionTitle;
+ }
+
+ public String getMainSectionDescription() {
+ return sectionDescription;
+ }
+
+ public void setMainSectionDescription(String sectionDescription) {
+ this.sectionDescription = sectionDescription;
+ }
+
protected void createSmooksTreeViewer(FormToolkit tool, final IManagedForm managedForm, Composite rootMainControl) {
- configurationSection = tool.createSection(rootMainControl, Section.TITLE_BAR);
- configurationSection.setDescription("Define Smooks elements for configuration file in the following section.");
- configurationSection.setText("Message Filtering Resources");
+ configurationSection = tool.createSection(rootMainControl, Section.TITLE_BAR | Section.DESCRIPTION);
+ if (this.getMainSectionTitle() != null) {
+ configurationSection.setText(getMainSectionTitle());
+ }
+
+ if (this.getMainSectionDescription() != null) {
+ configurationSection.setDescription(getMainSectionDescription());
+ }
sectionPart = new SectionPart(configurationSection);
managedForm.addPart(sectionPart);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
@@ -217,8 +250,10 @@
}
});
+ if (this.getViewerFilters() != null) {
+ smooksTreeViewer.setFilters(getViewerFilters());
+ }
- smooksTreeViewer.setFilters(new ViewerFilter[] { new TextEObjectModelFilter() });
Object smooksModel = ((ISmooksModelProvider) this.formEditor).getSmooksModel();
if (smooksModel != null) {
setTreeViewerModel(smooksModel);
@@ -252,8 +287,8 @@
removeButton = tool.createButton(buttonComposite, "Remove", SWT.NONE);
gd = new GridData(GridData.FILL_HORIZONTAL);
removeButton.setLayoutData(gd);
-
- Composite sc= tool.createComposite(buttonComposite);
+
+ Composite sc = tool.createComposite(buttonComposite);
gd = new GridData(GridData.FILL_HORIZONTAL);
gd.heightHint = 40;
sc.setLayoutData(gd);
@@ -301,7 +336,7 @@
return null;
}
- protected List<?> getViewerSelections() {
+ public List<?> getViewerSelections() {
IStructuredSelection selections = (IStructuredSelection) smooksTreeViewer.getSelection();
if (selections == null)
return null;
@@ -314,14 +349,33 @@
// }
// return l;
}
+
+
+ public String getNewSmooksElementTitle() {
+ return newSmooksElementTitle;
+ }
+
+ public void setNewSmooksElementTitle(String newSmooksElementTitle) {
+ this.newSmooksElementTitle = newSmooksElementTitle;
+ }
+
+ public String getNewSmooksElementDescription() {
+ return newSmooksElementDescription;
+ }
+
+ public void setNewSmooksElementDescription(String newSmooksElementDescription) {
+ this.newSmooksElementDescription = newSmooksElementDescription;
+ }
+
private void hookButtons() {
addButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
super.widgetSelected(e);
- NewSmooksElementWizard wizard = new NewSmooksElementWizard(editingDomain, getTreeViewerInput());
+ NewSmooksElementWizard wizard = new NewSmooksElementWizard(editingDomain, getTreeViewerInput(),
+ getViewerFilters(),getNewSmooksElementTitle(), getNewSmooksElementDescription());
WizardDialog dialog = new WizardDialog(formEditor.getSite().getShell(), wizard);
dialog.open();
}
@@ -397,29 +451,6 @@
((IMenuListener) formEditor.getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager);
}
- private class TextEObjectModelFilter extends ViewerFilter {
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- Object obj = element;
- obj = AdapterFactoryEditingDomain.unwrap(obj);
- if(obj instanceof ParamsType){
- return false;
- }
- if (obj instanceof BasicFeatureMapEntry) {
- EStructuralFeature sf = ((BasicFeatureMapEntry) obj).getEStructuralFeature();
- if (sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT)
- || sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA)) {
- return false;
- }
- } else {
- if (obj.getClass() == String.class) {
- return false;
- }
- }
- return true;
- }
- }
-
public void setSmooksModel(Object model) {
if (model != null) {
setTreeViewerModel(model);
@@ -476,6 +507,10 @@
}
updateButtons(objList);
}
+
+ if(formEditor instanceof ISelectionProvider){
+ ((ISelectionProvider)formEditor).setSelection(event.getSelection());
+ }
}
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-08-06 10:32:46 UTC (rev 16976)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/SmooksMultiFormEditor.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -17,6 +17,10 @@
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.ui.PartInitException;
import org.jboss.tools.smooks.editor.AbstractSmooksFormEditor;
import org.jboss.tools.smooks.graphical.editors.SmooksGraphicalEditorPart;
@@ -25,7 +29,7 @@
*
* @author Dart Peng (dpeng(a)redhat.com) Date Apr 1, 2009
*/
-public class SmooksMultiFormEditor extends AbstractSmooksFormEditor {
+public class SmooksMultiFormEditor extends AbstractSmooksFormEditor implements ISelectionProvider{
public static final String EDITOR_ID = "org.jboss.tools.smooks.configuration.editors.MultiPageEditor";
@@ -35,6 +39,12 @@
private SmooksConfigurationOverviewPage overViewPage;
+ private SmooksConfigurationFormPage readerPage;
+
+ private ISelection selection;
+
+ private Collection<ISelectionChangedListener> selectionChangeListener = new ArrayList<ISelectionChangedListener>();
+
/*
* (non-Javadoc)
*
@@ -52,6 +62,16 @@
e.printStackTrace();
}
+ readerPage = createSmooksConfigurationReaderPage();
+ addValidateListener(readerPage);
+ addSourceSynchronizeListener(readerPage);
+ try {
+ int index = this.addPage(readerPage);
+ setPageText(index, "Reader");
+ } catch (PartInitException e) {
+ e.printStackTrace();
+ }
+
configurationPage = createSmooksConfigurationFormPage();
addValidateListener(configurationPage);
addSourceSynchronizeListener(configurationPage);
@@ -73,6 +93,10 @@
super.addPages();
}
+ private SmooksConfigurationReaderPage createSmooksConfigurationReaderPage() {
+ return new SmooksConfigurationReaderPage(this, "Reader", "Reader Page");
+ }
+
private SmooksConfigurationOverviewPage createSmooksConfigurationOverviewPage() {
return new SmooksConfigurationOverviewPage(this, "Overview", "Overview", this);
}
@@ -93,7 +117,7 @@
}
protected SmooksConfigurationFormPage createSmooksConfigurationFormPage() {
- return new SmooksConfigurationFormPage(this, "DesignPage", "Design Page");
+ return new SmooksConfigurationResourceConfigPage(this, "DesignPage", "Design Page");
}
/*
@@ -128,4 +152,30 @@
protected void createNewModelViaTextPage() {
super.createNewModelViaTextPage();
}
+
+ public void addSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangeListener.add(listener);
+ }
+
+ public ISelection getSelection() {
+ return this.selection;
+ }
+
+ public void removeSelectionChangedListener(ISelectionChangedListener listener) {
+ selectionChangeListener.remove(listener);
+ }
+
+ public void setSelection(ISelection selection) {
+ if(selection != null){
+ if(selection.equals(this.selection)){
+ return;
+ }
+ }
+ this.selection = selection;
+
+ for (Iterator<?> iterator = this.selectionChangeListener.iterator(); iterator.hasNext();) {
+ ISelectionChangedListener l = (ISelectionChangedListener) iterator.next();
+ l.selectionChanged(new SelectionChangedEvent(this, getSelection()));
+ }
+ }
}
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/TextEObjectModelFilter.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/TextEObjectModelFilter.java (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/TextEObjectModelFilter.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.smooks.configuration.editors;
+
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.EStructuralFeatureImpl.BasicFeatureMapEntry;
+import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
+
+/**
+ * @author Dart
+ *
+ */
+public class TextEObjectModelFilter extends ViewerFilter {
+ @Override
+ public boolean select(Viewer viewer, Object parentElement, Object element) {
+ Object obj = element;
+ obj = AdapterFactoryEditingDomain.unwrap(obj);
+ if (obj instanceof BasicFeatureMapEntry) {
+ EStructuralFeature sf = ((BasicFeatureMapEntry) obj).getEStructuralFeature();
+ if (sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__TEXT)
+ || sf.equals(XMLTypePackage.Literals.XML_TYPE_DOCUMENT_ROOT__CDATA)) {
+ return false;
+ }
+ } else {
+ if (obj.getClass() == String.class) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/editors/TextEObjectModelFilter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm (rev 0)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm 2009-08-06 10:41:50 UTC (rev 16977)
@@ -0,0 +1,11 @@
+<form>
+<p>On the 'Overview' page , user can define the <a
+ href="overview_default_setting">default setting</a> , edit the <a
+ href="overview_global_param">global paramters</a> and define the <a
+ href="overview_condition">condition</a>.</p>
+<p>User can edit the 'reader' of Smooks in the <a href="reader_page">Reader</a>
+page. Reader page can also add/remove <a href="reader_input_data">input
+message</a>. <br/>
+Smooks tools generate the 'selector' via the input data and smooks reader , open the <a href="selector_dialog">SelectorDialog</a>,
+User can<br/> select the element node to generate 'selector' for it.</p>
+</form>
\ No newline at end of file
Property changes on: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/navigator/DefaultSetting.htm
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java 2009-08-06 10:32:46 UTC (rev 16976)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizard.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -19,6 +19,7 @@
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.jface.wizard.Wizard;
import org.jboss.tools.smooks.configuration.editors.uitls.SmooksUIUtils;
@@ -34,10 +35,20 @@
private NewSmooksElementWizardPage page;
- public NewSmooksElementWizard(AdapterFactoryEditingDomain editingDomain, EObject parentElement) {
+ private ViewerFilter[] filters;
+
+ private String text;
+
+ private String description;
+
+ public NewSmooksElementWizard(AdapterFactoryEditingDomain editingDomain, EObject parentElement,
+ ViewerFilter[] filters, String text, String description) {
super();
this.parentElement = parentElement;
this.editingDomain = editingDomain;
+ this.filters = filters;
+ this.text = text;
+ this.description = description;
}
@Override
@@ -45,7 +56,7 @@
Collection<?> childDescriptors = editingDomain.getNewChildDescriptors(parentElement, null);
Collection<IAction> actions = SmooksUIUtils.generateCreateChildActions(editingDomain, childDescriptors,
new StructuredSelection(parentElement));
- page = new NewSmooksElementWizardPage("Smooks Elements", actions);
+ page = new NewSmooksElementWizardPage("Smooks Elements", actions , filters , text , description);
this.addPage(page);
}
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java 2009-08-06 10:32:46 UTC (rev 16976)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/configuration/wizards/NewSmooksElementWizardPage.java 2009-08-06 10:41:50 UTC (rev 16977)
@@ -17,6 +17,8 @@
import java.util.List;
import java.util.Map;
+import org.eclipse.emf.edit.command.CommandParameter;
+import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -29,6 +31,7 @@
import org.eclipse.jface.viewers.SelectionChangedEvent;
import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerFilter;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.GridData;
@@ -61,6 +64,38 @@
private TreeViewer actionViewer = null;
+ private ViewerFilter[] filters;
+
+ public NewSmooksElementWizardPage(String pageName, String title, ImageDescriptor titleImage,
+ Collection<IAction> childDescriptor, ViewerFilter[] filters, String text, String description) {
+ super(pageName, title, titleImage);
+ this.childDescriptor = childDescriptor;
+ this.setTitle("Add Child");
+ this.setDescription("Add Smooks Elements");
+ if (text != null) {
+ this.setTitle(text);
+ }
+ if (description != null) {
+ this.setDescription(description);
+ }
+ this.filters = filters;
+ }
+
+ public NewSmooksElementWizardPage(String pageName, Collection<IAction> childDescriptor, ViewerFilter[] filters,
+ String text, String description) {
+ super(pageName);
+ this.childDescriptor = childDescriptor;
+ this.setTitle("Add Child");
+ this.setDescription("Add Smooks Elements");
+ if (text != null) {
+ this.setTitle(text);
+ }
+ if (description != null) {
+ this.setDescription(description);
+ }
+ this.filters = filters;
+ }
+
/*
* (non-Javadoc)
*
@@ -105,7 +140,35 @@
}
}
+ private void filterAction() {
+ if (this.filters != null) {
+ for (Iterator<?> iterator = childDescriptor.iterator(); iterator.hasNext();) {
+ AddSmooksResourceAction action = (AddSmooksResourceAction) iterator.next();
+ if (!action.isEnabled()) {
+ continue;
+ }
+ for (int i = 0; i < filters.length; i++) {
+ ViewerFilter vf = filters[i];
+ Object descriptor = action.getDescriptor();
+ if (descriptor instanceof CommandParameter) {
+ CommandParameter parameter = (CommandParameter) descriptor;
+ if (parameter.getValue() != null) {
+ Object value = AdapterFactoryEditingDomain.unwrap(parameter.getValue());
+ boolean enable = vf.select(null, null, value);
+ action.setEnabled(enable);
+ if (!enable) {
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ }
+ }
+
private Collection<IAction> getActions() {
+ filterAction();
List<IAction> actions = new ArrayList<IAction>();
List<ISmooksActionGrouper> grouperList = getSmooksActionGrouper();
for (Iterator<?> iterator = grouperList.iterator(); iterator.hasNext();) {
@@ -150,21 +213,6 @@
}
}
- public NewSmooksElementWizardPage(String pageName, String title, ImageDescriptor titleImage,
- Collection<IAction> childDescriptor) {
- super(pageName, title, titleImage);
- this.childDescriptor = childDescriptor;
- this.setTitle("Add Child");
- this.setDescription("Add Smooks Elements");
- }
-
- public NewSmooksElementWizardPage(String pageName, Collection<IAction> childDescriptor) {
- super(pageName);
- this.childDescriptor = childDescriptor;
- this.setTitle("Add Child");
- this.setDescription("Add Smooks Elements");
- }
-
private List<ISmooksActionGrouper> getSmooksActionGrouper() {
List<ISmooksActionGrouper> grouperList = new ArrayList<ISmooksActionGrouper>();
16 years, 4 months
JBoss Tools SVN: r16976 - in trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal: context/java and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-08-06 06:32:46 -0400 (Thu, 06 Aug 2009)
New Revision: 16976
Added:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4716
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-08-06 08:42:43 UTC (rev 16975)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/HibernateJpaFactory.java 2009-08-06 10:32:46 UTC (rev 16976)
@@ -10,6 +10,7 @@
******************************************************************************/
package org.jboss.tools.hibernate.jpt.core.internal;
+import org.eclipse.jpt.core.context.java.JavaEmbeddable;
import org.eclipse.jpt.core.context.java.JavaEntity;
import org.eclipse.jpt.core.context.java.JavaIdMapping;
import org.eclipse.jpt.core.context.java.JavaJpaContextNode;
@@ -22,6 +23,7 @@
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedNativeQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernateNamedQuery;
import org.jboss.tools.hibernate.jpt.core.internal.context.HibernatePersistenceUnit;
+import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEmbeddable;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntity;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaEntityImpl;
import org.jboss.tools.hibernate.jpt.core.internal.context.java.HibernateJavaIdMapping;
@@ -76,5 +78,9 @@
HibernateJavaEntity hibernateJavaEntity) {
return new JavaDiscriminatorFormulaImpl(hibernateJavaEntity);
}
+
+ public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent) {
+ return new HibernateJavaEmbeddable(parent);
+ }
}
Added: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java (rev 0)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java 2009-08-06 10:32:46 UTC (rev 16976)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2009 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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.hibernate.jpt.core.internal.context.java;
+
+import org.eclipse.jpt.core.MappingKeys;
+import org.eclipse.jpt.core.context.java.JavaPersistentType;
+import org.eclipse.jpt.core.internal.context.java.AbstractJavaEmbeddable;
+
+/**
+ * @author Dmitry Geraskov
+ *
+ */
+public class HibernateJavaEmbeddable extends AbstractJavaEmbeddable
+{
+ public HibernateJavaEmbeddable(JavaPersistentType parent) {
+ super(parent);
+ }
+
+ @Override
+ public boolean attributeMappingKeyAllowed(String attributeMappingKey) {
+ //hibernate allows basic, transient and many-to-one within an Embeddable
+ return attributeMappingKey == MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY
+ || attributeMappingKey == MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY
+ || attributeMappingKey == MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
+ }
+}
Property changes on: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.jpt.core/src/org/jboss/tools/hibernate/jpt/core/internal/context/java/HibernateJavaEmbeddable.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Name: svn:keywords
+ Author Id Revision Date
Name: svn:eol-style
+ native
16 years, 4 months
JBoss Tools SVN: r16975 - trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2009-08-06 04:42:43 -0400 (Thu, 06 Aug 2009)
New Revision: 16975
Modified:
trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-4721
Modified: trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java
===================================================================
--- trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-08-06 08:15:34 UTC (rev 16974)
+++ trunk/hibernatetools/plugins/org.hibernate.eclipse/src/org/hibernate/console/ConsoleConfiguration.java 2009-08-06 08:42:43 UTC (rev 16975)
@@ -684,7 +684,7 @@
private Configuration configureConnectionProfile(Configuration localCfg) {
String connectionProfile = prefs.getConnectionProfileName();
- if(connectionProfile==null) {
+ if(connectionProfile==null || "".equals(connectionProfile)) {//$NON-NLS-1$
return localCfg;
}
16 years, 4 months
JBoss Tools SVN: r16974 - in trunk/jst/plugins: org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-08-06 04:15:34 -0400 (Thu, 06 Aug 2009)
New Revision: 16974
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4678
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties 2009-08-06 08:12:26 UTC (rev 16973)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties 2009-08-06 08:15:34 UTC (rev 16974)
@@ -1 +1 @@
-CSSPreview_DefaultBrowserText=Double click to edit preview
\ No newline at end of file
+CSSPreview_DefaultBrowserText=Double click to edit preview.
\ No newline at end of file
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2009-08-06 08:12:26 UTC (rev 16973)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/messages/messages.properties 2009-08-06 08:15:34 UTC (rev 16974)
@@ -80,7 +80,7 @@
PADDING=Padding:
DEFAULT_PREVIEW_TEXT=CSS file to edit will be displayed here
-DEFAULT_TEXT_FOR_BROWSER_PREVIEW=Double click to edit preview. To save changes press Enter button.
+DEFAULT_TEXT_FOR_BROWSER_PREVIEW=Double click to edit preview.
JspContentAssistProcessor_CloseELExpression=Close JSF EL Expression
JspContentAssistProcessor_CloseELExpressionInfo=}
JspContentAssistProcessor_NewELExpression=New JSF EL Expression - Create a new attribute value with #{}
16 years, 4 months
JBoss Tools SVN: r16973 - trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages.
by jbosstools-commits@lists.jboss.org
Author: sdzmitrovich
Date: 2009-08-06 04:12:26 -0400 (Thu, 06 Aug 2009)
New Revision: 16973
Modified:
trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties
Log:
https://jira.jboss.org/jira/browse/JBIDE-4678
Modified: trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties 2009-08-06 05:20:30 UTC (rev 16972)
+++ trunk/jst/plugins/org.jboss.tools.jst.css/src/org/jboss/tools/jst/css/messages/messages.properties 2009-08-06 08:12:26 UTC (rev 16973)
@@ -1 +1 @@
-CSSPreview_DefaultBrowserText=Double click to edit preview. To save changes press Enter button.
\ No newline at end of file
+CSSPreview_DefaultBrowserText=Double click to edit preview
\ No newline at end of file
16 years, 4 months
JBoss Tools SVN: r16972 - trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util.
by jbosstools-commits@lists.jboss.org
Author: DartPeng
Date: 2009-08-06 01:20:30 -0400 (Thu, 06 Aug 2009)
New Revision: 16972
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
Log:
JBIDE-4712
add new tab
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-08-05 22:47:57 UTC (rev 16971)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.core/src/org/jboss/tools/smooks10/model/smooks/util/SmooksModelUtils.java 2009-08-06 05:20:30 UTC (rev 16972)
@@ -50,9 +50,9 @@
public class SmooksModelUtils {
public static final String INPUT_TYPE_JAVA = "java";
-
+
public static final String INPUT_TYPE_JSON = "json";
-
+
public static final String INPUT_TYPE_CSV = "csv";
public static final String PARAM_NAME_CLASS = "class";
@@ -377,7 +377,11 @@
if (addCommand != null && addCommand.canExecute()) {
ccommand.append(addCommand);
}
- editingDomain.getCommandStack().execute(ccommand);
+ if (smooksModel.eContainer() == null) {
+ ccommand.execute();
+ } else {
+ editingDomain.getCommandStack().execute(ccommand);
+ }
}
public static void setCommentToSmooksType(EditingDomain editingDomain, AnyType smooksModel, String comment) {
@@ -402,7 +406,11 @@
if (addCommand != null && addCommand.canExecute()) {
ccommand.append(addCommand);
}
- editingDomain.getCommandStack().execute(ccommand);
+ if (smooksModel.eContainer() == null) {
+ ccommand.execute();
+ } else {
+ editingDomain.getCommandStack().execute(ccommand);
+ }
}
public static void setCDATAToSmooksType(EditingDomain editingDomain, AnyType smooksModel, String cdata) {
@@ -427,7 +435,11 @@
if (addCommand != null && addCommand.canExecute()) {
ccommand.append(addCommand);
}
- editingDomain.getCommandStack().execute(ccommand);
+ if (smooksModel.eContainer() == null) {
+ ccommand.execute();
+ } else {
+ editingDomain.getCommandStack().execute(ccommand);
+ }
}
public static void appendCDATAToSmooksType(AnyType smooksModel, String text) {
@@ -491,8 +503,7 @@
List<org.jboss.tools.smooks.model.graphics.ext.ParamType> list = input.getParam();
if (INPUT_TYPE_JAVA.equals(input.getType()) || INPUT_TYPE_XML.equals(input.getType())
|| INPUT_TYPE_XSD.equals(input.getType()) || INPUT_TYPE_JSON.equals(input.getType())
- || INPUT_TYPE_CSV.equals(input.getType())
- || INPUT_TYPE_EDI.equals(input.getType())) {
+ || INPUT_TYPE_CSV.equals(input.getType()) || INPUT_TYPE_EDI.equals(input.getType())) {
for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
org.jboss.tools.smooks.model.graphics.ext.ParamType paramType = (org.jboss.tools.smooks.model.graphics.ext.ParamType) iterator
.next();
@@ -506,12 +517,12 @@
}
return null;
}
-
- public static FigureType findFigureType(GraphType graph , String figureId){
+
+ public static FigureType findFigureType(GraphType graph, String figureId) {
List<FigureType> list = graph.getFigure();
for (Iterator<?> iterator = list.iterator(); iterator.hasNext();) {
FigureType figureType = (FigureType) iterator.next();
- if(figureId.equals(figureType.getId())){
+ if (figureId.equals(figureType.getId())) {
return figureType;
}
}
16 years, 4 months
JBoss Tools SVN: r16971 - trunk/jsf/features/org.jboss.tools.richfaces.feature.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2009-08-05 18:47:57 -0400 (Wed, 05 Aug 2009)
New Revision: 16971
Modified:
trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
Log:
https://jira.jboss.org/jira/browse/JBIDE-3445 CSS Properties view plug-in included in build
Modified: trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml
===================================================================
--- trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2009-08-05 22:31:56 UTC (rev 16970)
+++ trunk/jsf/features/org.jboss.tools.richfaces.feature/feature.xml 2009-08-05 22:47:57 UTC (rev 16971)
@@ -507,4 +507,11 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.jboss.tools.jst.css"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ unpack="false"/>
+
</feature>
16 years, 4 months