JBoss Tools SVN: r25561 - trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-07 10:26:33 -0400 (Thu, 07 Oct 2010)
New Revision: 25561
Modified:
trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties
Log:
JBIDE-7217
https://jira.jboss.org/browse/JBIDE-7217
Modified: trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties
===================================================================
--- trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties 2010-10-07 14:12:59 UTC (rev 25560)
+++ trunk/hibernatetools/plugins/org.jboss.tools.hibernate.xml/resources/help/keys-hibernate3.properties 2010-10-07 14:26:33 UTC (rev 25561)
@@ -8,75 +8,71 @@
FileFolder_CreateFileHibConfig3_0.WindowTitle=New File Hibernate Config 3.0
FileFolder_CreateFileHibConfig3_0.Title=File Hibernate Config 3.0
-FileHibConfig3_Properties.WindowTitle=Edit Properties
FileHibConfig3_Properties.Title=Hibernate Configuration File 3.0
FileHibConfig3_Rename.WindowTitle=Rename
FileHibConfig3_Rename.Title=Hibernate Configuration File 3.0
-HibConfig3SessionFactory_Properties.WindowTitle=Edit Properties
HibConfig3SessionFactory_Properties.Title=Session Factory Folder
-HibConfig3PropertiesFolder_Properties.WindowTitle=Edit Properties
HibConfig3PropertiesFolder_Properties.Title=Properties Folder
HibConfig3PropertiesFolder_AddProperty.WindowTitle=Add Property
HibConfig3PropertiesFolder_AddProperty.Title=Property
-HibConfig3Property_Properties.WindowTitle=Edit Properties
HibConfig3Property_Properties.Title=Property
-HibConfig3MappingsFolder_Properties.WindowTitle=Edit Properties
HibConfig3MappingsFolder_Properties.Title=Mappings Folder
HibConfig3MappingsFolder_AddMapping.WindowTitle=Add Mapping
HibConfig3MappingsFolder_AddMapping.Title=Mapping
-HibConfig3Mapping_Properties.WindowTitle=Edit Properties
HibConfig3Mapping_Properties.Title=Mapping
-HibConfig3CachesFolder_Properties.WindowTitle=Edit Properties
HibConfig3CachesFolder_Properties.Title=Caches Folder
HibConfig3CachesFolder_AddClassCache.WindowTitle=Add Class Cache
HibConfig3CachesFolder_AddClassCache.Title=Class Cache
-HibConfig3ClassCache_Properties.WindowTitle=Edit Properties
HibConfig3ClassCache_Properties.Title=Class Cache
HibConfig3CachesFolder_AddCollectionCache.WindowTitle=Add Collection Cache
HibConfig3CachesFolder_AddCollectionCache.Title=Collection Cache
-HibConfig3CollectionCache_Properties.WindowTitle=Edit Properties
HibConfig3CollectionCache_Properties.Title=Collection Cache
-HibConfig3EventsFolder_Properties.WindowTitle=Edit Properties
HibConfig3EventsFolder_Properties.Title=Events Folder
HibConfig3EventsFolder_AddEvent.WindowTitle=Add Event
HibConfig3EventsFolder_AddEvent.Title=Event
-HibConfig3Event_Properties.WindowTitle=Edit Properties
HibConfig3Event_Properties.Title=Event
-HibConfig3ListenersFolder_Properties.WindowTitle=Edit Properties
HibConfig3ListenersFolder_Properties.Title=Listeners Folder
HibConfig3ListenersFolder_AddListener.WindowTitle=Add Listener
HibConfig3ListenersFolder_AddListener.Title=Listener
-HibConfig3Listener_Properties.WindowTitle=Edit Properties
HibConfig3Listener_Properties.Title=Listener
-HibConfig3Security_Properties.WindowTitle=Edit Properties
HibConfig3Security_Properties.Title=Security Folder
HibConfig3Security_AddGrant.WindowTitle=Add Grant
HibConfig3Security_AddGrant.Title=Grant
-HibConfig3Grant_Properties.WindowTitle=Edit Properties
HibConfig3Grant_Properties.Title=Grant
+HibConfig3ObjectBytecode_Properties.Title=Bytecode Properties
+HibConfig3ObjectC3P0_Properties.Title=C3P0 Properties
+HibConfig3ObjectCache_Properties.Title=Cache Properties
+HibConfig3ObjectConnection_Properties.Title=Connection Properties
+HibConfig3ObjectHibernate_Properties.Title=Hibernate Properties
+HibConfig3ObjectJDBC_Properties.Title=JDBC Properties
+HibConfig3ObjectJNDI_Properties.Title=JNDI Properties
+HibConfig3ObjectProxool_Properties.Title=Proxool Properties
+HibConfig3ObjectQuery_Properties.Title=Query Properties
+HibConfig3ObjectTransaction_Properties.Title=Transaction Properties
+
### File Hibernate
FileHibernate3_Rename.WindowTitle=Rename
FileHibernate3_Rename.Title=Hibernate Mapping
13 years, 9 months
JBoss Tools SVN: r25560 - trunk/build/target-platform.
by jbosstools-commits@lists.jboss.org
Author: nickboldt
Date: 2010-10-07 10:12:59 -0400 (Thu, 07 Oct 2010)
New Revision: 25560
Modified:
trunk/build/target-platform/e361-wtp322.target
Log:
add org.eclipse.birt.chart.integration.wtp.feature.group to target platform
Modified: trunk/build/target-platform/e361-wtp322.target
===================================================================
--- trunk/build/target-platform/e361-wtp322.target 2010-10-07 14:05:45 UTC (rev 25559)
+++ trunk/build/target-platform/e361-wtp322.target 2010-10-07 14:12:59 UTC (rev 25560)
@@ -77,6 +77,7 @@
<unit version="2.6.1.v20100709a-9iF7A8FGLY4z0pxX3ORrsdrp6JXb" id="org.eclipse.birt.feature.group"/>
<unit version="2.6.1.v20100915-1750-35-7w31211A2602861" id="org.eclipse.birt.integration.wtp.feature.group"/>
<unit version="2.6.1.v20100709-7f9T7DFQCnv8nz0gRMa6NG1" id="org.eclipse.birt.chart.feature.group"/>
+ <unit version="2.6.1.v20100915-1750-3507w31211A2602861" id="org.eclipse.birt.chart.integration.wtp.feature.group"/>
<repository location="http://download.eclipse.org/birt/update-site/2.6/"/>
</location>
<location includeAllPlatforms="false" includeMode="planner" type="InstallableUnit">
13 years, 9 months
JBoss Tools SVN: r25559 - in trunk/jst/plugins/org.jboss.tools.jst.jsp: src/org/jboss/tools/jst/jsp/i18n/handlers and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2010-10-07 10:05:45 -0400 (Thu, 07 Oct 2010)
New Revision: 25559
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18Handler.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
Log:
Externalize string icon behaviour has been moved from vpe plugin, https://jira.jboss.org/browse/JBIDE-7060
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2010-10-07 13:52:41 UTC (rev 25558)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/plugin.xml 2010-10-07 14:05:45 UTC (rev 25559)
@@ -998,5 +998,4 @@
parentId="org.eclipse.ui.contexts.window">
</context>
</extension>
-
</plugin>
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18Handler.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18Handler.java 2010-10-07 13:52:41 UTC (rev 25558)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/i18n/handlers/I18Handler.java 2010-10-07 14:05:45 UTC (rev 25559)
@@ -11,15 +11,20 @@
package org.jboss.tools.jst.jsp.i18n.handlers;
+import java.util.Map;
+
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.commands.HandlerEvent;
import org.eclipse.jface.text.TextSelection;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.IElementUpdater;
import org.eclipse.ui.handlers.HandlerUtil;
+import org.eclipse.ui.menus.UIElement;
import org.eclipse.ui.texteditor.ITextEditor;
import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsDialog;
import org.jboss.tools.jst.jsp.i18n.ExternalizeStringsWizard;
@@ -30,7 +35,7 @@
* @author mareshkau
*
*/
-public class I18Handler extends AbstractHandler {
+public class I18Handler extends AbstractHandler implements IElementUpdater{
/* (non-Javadoc)
* @see org.eclipse.core.commands.AbstractHandler#isEnabled()
@@ -47,6 +52,12 @@
return false;
}
/**
+ *
+ */
+ public I18Handler() {
+ setBaseEnabled(true);
+ }
+ /**
* Calculates the state of ext command
* @param selection
* @return
@@ -111,4 +122,10 @@
}
return null;
}
+
+ @Override
+ public void updateElement(UIElement element, Map parameters) {
+ fireHandlerChanged(new HandlerEvent(this, true, false));
+
+ }
}
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2010-10-07 13:52:41 UTC (rev 25558)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditor.java 2010-10-07 14:05:45 UTC (rev 25559)
@@ -51,6 +51,8 @@
import org.eclipse.ui.IPropertyListener;
import org.eclipse.ui.IReusableEditor;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.commands.ICommandService;
import org.eclipse.ui.contexts.IContextActivation;
import org.eclipse.ui.contexts.IContextService;
import org.eclipse.ui.ide.IGotoMarker;
@@ -137,6 +139,16 @@
static IVisualEditorFactory visualEditorFactory;
private IContextActivation selBarContextActivation;
+ //added by Maksim Areshkau, notified externalize command that selection changed
+ private ISelectionChangedListener externalizeSelectionChangeListener = new ISelectionChangedListener() {
+
+ @Override
+ public void selectionChanged(SelectionChangedEvent event) {
+ ICommandService commandService = (ICommandService) PlatformUI
+ .getWorkbench().getService(ICommandService.class);
+ commandService.refreshElements("org.jboss.tools.jst.jsp.commands.i18", null); //$NON-NLS-1$
+ }
+ };
static {
// Fix For JBIDE-2674
@@ -369,6 +381,7 @@
if (selectionProvider != null) {
selectionProvider
.addSelectionChangedListener(getSelectionChangedListener());
+ selectionProvider.addSelectionChangedListener(externalizeSelectionChangeListener);
}
if (provider != null) {
@@ -384,6 +397,7 @@
if (provider != null) {
provider
.removeSelectionChangedListener(getSelectionChangedListener());
+ provider.removeSelectionChangedListener(externalizeSelectionChangeListener);
}
if (provider instanceof IPostSelectionProvider
&& postSelectionChangedListener != null) {
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2010-10-07 13:52:41 UTC (rev 25558)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/jspeditor/JSPMultiPageEditorSite.java 2010-10-07 14:05:45 UTC (rev 25559)
@@ -11,13 +11,11 @@
package org.jboss.tools.jst.jsp.jspeditor;
import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
+import org.eclipse.core.commands.IHandler;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.core.runtime.Assert;
import org.eclipse.jface.viewers.ILabelDecorator;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
@@ -36,13 +34,12 @@
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.contexts.IContextActivation;
-import org.eclipse.ui.contexts.IContextService;
-import org.eclipse.ui.handlers.IHandlerService;
+import org.eclipse.ui.handlers.HandlerUtil;
import org.eclipse.ui.internal.KeyBindingService;
import org.eclipse.ui.internal.PartSite;
import org.eclipse.ui.internal.PopupMenuExtender;
import org.eclipse.ui.internal.WorkbenchPlugin;
+import org.eclipse.ui.internal.handlers.HandlerProxy;
import org.eclipse.ui.internal.services.IServiceLocatorCreator;
import org.eclipse.ui.internal.services.IWorkbenchLocationService;
import org.eclipse.ui.internal.services.ServiceLocator;
@@ -211,7 +208,7 @@
parentProvider, event.getSelection());
((JSPMultiPageSelectionProvider) parentProvider)
.fireSelectionChanged(newEvent);
- }
+ }
}
public void registerContextMenu(String menuID, MenuManager menuMgr,
13 years, 9 months
JBoss Tools SVN: r25558 - in trunk/esb/tests/org.jboss.tools.esb.validator.test: src/org/jboss/tools/esb/validator/test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-07 09:52:41 -0400 (Thu, 07 Oct 2010)
New Revision: 25558
Modified:
trunk/esb/tests/org.jboss.tools.esb.validator.test/projects/esbTest/esbcontent/META-INF/jboss-esb-brp-broken.xml
trunk/esb/tests/org.jboss.tools.esb.validator.test/src/org/jboss/tools/esb/validator/test/ValidationTest.java
Log:
JBIDE-7235
https://jira.jboss.org/browse/JBIDE-7235
Modified: trunk/esb/tests/org.jboss.tools.esb.validator.test/projects/esbTest/esbcontent/META-INF/jboss-esb-brp-broken.xml
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.validator.test/projects/esbTest/esbcontent/META-INF/jboss-esb-brp-broken.xml 2010-10-07 13:51:52 UTC (rev 25557)
+++ trunk/esb/tests/org.jboss.tools.esb.validator.test/projects/esbTest/esbcontent/META-INF/jboss-esb-brp-broken.xml 2010-10-07 13:52:41 UTC (rev 25558)
@@ -55,6 +55,7 @@
<property name="object-paths">
<object-path esb="body.Driver"/>
<object-path esb="body.Policy"/>
+ <object-path esb="bod.Policy"/>
</property>
</action>
<action class="org.jboss.soa.esb.actions.BusinessRulesProcessor" name="PolicyPricingRuleService">
Modified: trunk/esb/tests/org.jboss.tools.esb.validator.test/src/org/jboss/tools/esb/validator/test/ValidationTest.java
===================================================================
--- trunk/esb/tests/org.jboss.tools.esb.validator.test/src/org/jboss/tools/esb/validator/test/ValidationTest.java 2010-10-07 13:51:52 UTC (rev 25557)
+++ trunk/esb/tests/org.jboss.tools.esb.validator.test/src/org/jboss/tools/esb/validator/test/ValidationTest.java 2010-10-07 13:52:41 UTC (rev 25558)
@@ -45,8 +45,9 @@
IFile file = project.getFile("esbcontent/META-INF/jboss-esb-brp-broken.xml");
AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, ESBValidatorMessages.INVALID_RULE_SET_FOR_RULE_LANGUAGE, 52);
AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, ESBValidatorMessages.INVALID_RULE_AUDIT_TYPE_AND_INTERVAL, 34);
+ AbstractResourceMarkerTest.assertMarkerIsCreated(file, AbstractResourceMarkerTest.MARKER_TYPE, ESBValidatorMessages.INVALID_OBJECT_PATH_WRONG_LOCATION, 58);
int markerNumbers = getMarkersNumber(file);
- assertEquals("jboss-esb-brp-broken.xml should have 2 error markers.", markerNumbers, 2);
+ assertEquals("jboss-esb-brp-broken.xml should have 2 error markers.", markerNumbers, 3);
}
/**
13 years, 9 months
JBoss Tools SVN: r25557 - in trunk/seam/plugins: org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-07 09:51:52 -0400 (Thu, 07 Oct 2010)
New Revision: 25557
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
https://jira.jboss.org/browse/JBIDE-7262 Fixed NPE for Seam Project Wizard
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2010-10-07 13:42:51 UTC (rev 25556)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2010-10-07 13:51:52 UTC (rev 25557)
@@ -7,11 +7,10 @@
*
* Contributors:
* Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
+ ******************************************************************************/
package org.jboss.tools.seam.internal.core.project.facet;
-import java.text.Format;
import java.util.Properties;
import org.eclipse.core.resources.IProject;
@@ -24,14 +23,15 @@
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IDelegate;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+
/**
* TBD
*
* @author eskimo
*/
public class SeamFacetPreInstallDelegate implements IDelegate {
-
-
+
/**
* Indentation for hibernate property declaration
*/
@@ -41,68 +41,97 @@
* Property declaration in persistence.xml
*/
public static final String PROP_DECL = "<property name=\"{0}\" value=\"{1}\"/>";
-
+
private static final String EMPTY_STRING = "";
-
+
/**
* Execute pre-install operations for installed facet
*
- * @param project created after finish pressed in wizard
- * @param fv -IProjectFacetversion described facet that will be installed
- * @param config - IDataModel that provide data collected from user
- * @param monitor - IProgressMonitor
- * @throws CoreException when meet the problems
+ * @param project
+ * created after finish pressed in wizard
+ * @param fv
+ * -IProjectFacetversion described facet that will be installed
+ * @param config
+ * - IDataModel that provide data collected from user
+ * @param monitor
+ * - IProgressMonitor
+ * @throws CoreException
+ * when meet the problems
*/
public void execute(IProject project, IProjectFacetVersion fv,
Object config, IProgressMonitor monitor) throws CoreException {
IDataModel model = (IDataModel) config;
- if (model.getProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE) != null) {
- IConnectionProfile connProfile = ProfileManager.getInstance().getProfileByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE).toString());
- if (connProfile!=null) {
- Properties props = connProfile.getBaseProperties(); //Properties("org.eclipse.datatools.connectivity.db.generic.connectionProfile");
-
+ if (model
+ .getProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE) != null) {
+ IConnectionProfile connProfile = ProfileManager
+ .getInstance()
+ .getProfileByName(
+ model.getProperty(
+ ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE)
+ .toString());
+ if (connProfile != null) {
+ Properties props = connProfile.getBaseProperties(); // Properties("org.eclipse.datatools.connectivity.db.generic.connectionProfile");
+
// Collect properties name from DTP Connection Profile
- model.setProperty(ISeamFacetDataModelProperties.DB_USER_NAME,
+ model.setProperty(
+ ISeamFacetDataModelProperties.DB_USER_NAME,
props.get("org.eclipse.datatools.connectivity.db.username") == null //$NON-NLS-1$
- ? "" : props.get("org.eclipse.datatools.connectivity.db.username").toString()); //$NON-NLS-1$ //$NON-NLS-2$
-
- model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME,
+ ? "" : props.get("org.eclipse.datatools.connectivity.db.username").toString()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ model.setProperty(
+ ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME,
props.get("org.eclipse.datatools.connectivity.db.driverClass") == null //$NON-NLS-1$
- ? "" : props.get("org.eclipse.datatools.connectivity.db.driverClass").toString()); //$NON-NLS-1$ //$NON-NLS-2$
-
- model.setProperty(ISeamFacetDataModelProperties.DB_USER_PASSWORD,
+ ? "" : props.get("org.eclipse.datatools.connectivity.db.driverClass").toString()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ model.setProperty(
+ ISeamFacetDataModelProperties.DB_USER_PASSWORD,
props.get("org.eclipse.datatools.connectivity.db.password") == null //$NON-NLS-1$
- ? "" : props.get("org.eclipse.datatools.connectivity.db.password").toString()); //$NON-NLS-1$ //$NON-NLS-2$
-
- model.setProperty(ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,
+ ? "" : props.get("org.eclipse.datatools.connectivity.db.password").toString()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ model.setProperty(
+ ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,
props.get("org.eclipse.datatools.connectivity.db.URL") == null //$NON-NLS-1$
- ? "" : props.get("org.eclipse.datatools.connectivity.db.URL").toString()); //$NON-NLS-1$ //$NON-NLS-2$
-
- model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
- DriverManager.getInstance().getDriverInstanceByID(
- props.get("org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray()); //$NON-NLS-1$
+ ? "" : props.get("org.eclipse.datatools.connectivity.db.URL").toString()); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if(props.get("org.eclipse.datatools.connectivity.driverDefinitionID")!=null) {
+ model.setProperty(
+ ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
+ DriverManager
+ .getInstance()
+ .getDriverInstanceByID(
+ props.get(
+ "org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray()); //$NON-NLS-1$
+ }
}
}
-
- String defaultSchema = (String) model.getProperty(ISeamFacetDataModelProperties.DB_DEFAULT_SCHEMA_NAME);
-
+
+ String defaultSchema = (String) model
+ .getProperty(ISeamFacetDataModelProperties.DB_DEFAULT_SCHEMA_NAME);
+
if (!EMPTY_STRING.equals(defaultSchema)) {
- model.setStringProperty(ISeamFacetDataModelProperties.DB_SCHEMA_NAME,
- PROP_INDENT + NLS.bind(PROP_DECL,
- new String[]{
- ISeamFacetDataModelProperties.DB_DEFAULT_SCHEMA_NAME,
- defaultSchema}));
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.DB_SCHEMA_NAME,
+ PROP_INDENT
+ + NLS.bind(
+ PROP_DECL,
+ new String[] {
+ ISeamFacetDataModelProperties.DB_DEFAULT_SCHEMA_NAME,
+ defaultSchema }));
}
- String defaultCatalog = (String) model.getProperty(ISeamFacetDataModelProperties.DB_DEFAULT_CATALOG_NAME);
-
+ String defaultCatalog = (String) model
+ .getProperty(ISeamFacetDataModelProperties.DB_DEFAULT_CATALOG_NAME);
+
if (!EMPTY_STRING.equals(defaultCatalog)) {
- model.setStringProperty(ISeamFacetDataModelProperties.DB_CATALOG_NAME,
- PROP_INDENT + NLS.bind(PROP_DECL,
- new String[]{
- ISeamFacetDataModelProperties.DB_DEFAULT_CATALOG_NAME,
- defaultCatalog}));
+ model.setStringProperty(
+ ISeamFacetDataModelProperties.DB_CATALOG_NAME,
+ PROP_INDENT
+ + NLS.bind(
+ PROP_DECL,
+ new String[] {
+ ISeamFacetDataModelProperties.DB_DEFAULT_CATALOG_NAME,
+ defaultCatalog }));
}
}
-}
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2010-10-07 13:42:51 UTC (rev 25556)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2010-10-07 13:51:52 UTC (rev 25557)
@@ -414,8 +414,10 @@
JBossServer jbs = (JBossServer) server.loadAdapter(JBossServer.class, new NullProgressMonitor());
if (jbs != null) {
String[] driverJars = (String[]) model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
- String configFolder = jbs.getConfigDirectory();
- AntCopyUtils.copyFiles(driverJars, new File(configFolder, "lib"), false);
+ if(driverJars!=null) {
+ String configFolder = jbs.getConfigDirectory();
+ AntCopyUtils.copyFiles(driverJars, new File(configFolder, "lib"), false);
+ }
}
RegistrationHelper.runRegisterInServerJob(warProject, server);
13 years, 9 months
JBoss Tools SVN: r25556 - trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2010-10-07 09:42:51 -0400 (Thu, 07 Oct 2010)
New Revision: 25556
Modified:
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidatorMessages.java
trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/messages.properties
Log:
JBIDE-7235
https://jira.jboss.org/browse/JBIDE-7235
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java 2010-10-07 13:30:26 UTC (rev 25555)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBCoreValidator.java 2010-10-07 13:42:51 UTC (rev 25556)
@@ -2,9 +2,11 @@
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
+import java.util.StringTokenizer;
import java.util.TreeSet;
import org.eclipse.core.resources.IFile;
@@ -24,6 +26,7 @@
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
import org.jboss.tools.esb.core.model.ESBConstants;
+import org.jboss.tools.esb.core.model.converters.ConverterConstants;
import org.jboss.tools.jst.web.kb.internal.validation.ContextValidationHelper;
import org.jboss.tools.jst.web.kb.internal.validation.ProjectValidationContext;
import org.jboss.tools.jst.web.kb.internal.validation.ValidatingProjectSet;
@@ -276,8 +279,34 @@
bindMarkerToPathAndAttribute(marker, object, ATTR_RULE_AUDIT_INTERVAL);
}
}
+
+ XModelObject[] ps = object.getChildren(ConverterConstants.OBJECT_PATH_ENTITY);
+ for (XModelObject path: ps) {
+ validateObjectPathForBusinessRulesProcessor(path, object, file);
+ }
}
+ static String ATTR_ESB = "esb"; //$NON-NLS-1$
+ static Set<String> OBJECT_PATH_LOCATIONS = new HashSet<String>();
+ static {
+ OBJECT_PATH_LOCATIONS.add("body"); //$NON-NLS-1$
+ OBJECT_PATH_LOCATIONS.add("header"); //$NON-NLS-1$
+ OBJECT_PATH_LOCATIONS.add("properties"); //$NON-NLS-1$
+ OBJECT_PATH_LOCATIONS.add("attachment"); //$NON-NLS-1$
+ }
+
+ void validateObjectPathForBusinessRulesProcessor(XModelObject path, XModelObject brp, IFile file) {
+ String esb = path.getAttributeValue(ATTR_ESB);
+ StringTokenizer st = new StringTokenizer(esb, ".");
+ if(!st.hasMoreTokens()) return;
+ String location = st.nextToken();
+ if(!OBJECT_PATH_LOCATIONS.contains(location)) {
+ IMarker marker = addError(ESBValidatorMessages.INVALID_OBJECT_PATH_WRONG_LOCATION,
+ ESBPreferences.BUSINESS_RULES_PROCESSOR_PROBLEMS, getSourceReference(path, ATTR_ESB), file);
+ bindMarkerToPathAndAttribute(marker, path, ATTR_ESB);
+ }
+ }
+
void bindMarkerToPathAndAttribute(IMarker marker, XModelObject object, String attr) {
if(marker != null) try {
marker.setAttribute(ATTR_PATH, object.getPath());
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidatorMessages.java
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidatorMessages.java 2010-10-07 13:30:26 UTC (rev 25555)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/ESBValidatorMessages.java 2010-10-07 13:42:51 UTC (rev 25556)
@@ -25,6 +25,8 @@
public static String INVALID_RULE_SET_FOR_RULE_LANGUAGE;
public static String INVALID_RULE_AUDIT_TYPE_AND_INTERVAL;
+
+ public static String INVALID_OBJECT_PATH_WRONG_LOCATION;
static {
NLS.initializeMessages(BUNDLE_NAME, ESBValidatorMessages.class);
Modified: trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/messages.properties
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/messages.properties 2010-10-07 13:30:26 UTC (rev 25555)
+++ trunk/esb/plugins/org.jboss.tools.esb.validator/src/org/jboss/tools/esb/validator/messages.properties 2010-10-07 13:42:51 UTC (rev 25556)
@@ -6,4 +6,5 @@
LISTENER_REFERENCES_INCOMPATIBLE_CHANNEL=Listener references incompatible channel
INVALID_RULE_SET_FOR_RULE_LANGUAGE=If "ruleLanguage" is specified, the file in "ruleSet" should be a ".dslr" file
-INVALID_RULE_AUDIT_TYPE_AND_INTERVAL=If "ruleAuditInterval" is specified, it only applies for a "ruleAuditType" of "THREADED_FILE"
\ No newline at end of file
+INVALID_RULE_AUDIT_TYPE_AND_INTERVAL=If "ruleAuditInterval" is specified, it only applies for a "ruleAuditType" of "THREADED_FILE"
+INVALID_OBJECT_PATH_WRONG_LOCATION=Invalid object-path: location should be one of body, header, properties, attachment
\ No newline at end of file
13 years, 9 months
JBoss Tools SVN: r25555 - in trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe: editor and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-10-07 09:30:26 -0400 (Thu, 07 Oct 2010)
New Revision: 25555
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/browse/JBIDE-7258 :
DnD in VPE does not work with rich:calendar
- VpeVisualDomBuilder and VpeDnD have been refactored
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-10-07 13:10:30 UTC (rev 25554)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/dnd/VpeDnD.java 2010-10-07 13:30:26 UTC (rev 25555)
@@ -23,7 +23,6 @@
import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.eclipse.wst.xml.core.internal.document.ElementImpl;
import org.eclipse.wst.xml.core.internal.document.NodeContainer;
-import org.eclipse.wst.xml.xpath.core.util.XSLTXPathHelper;
import org.jboss.tools.common.model.XModelObject;
import org.jboss.tools.common.model.filesystems.XFileObject;
import org.jboss.tools.common.model.options.PreferenceModelUtilities;
@@ -70,6 +69,7 @@
import org.mozilla.interfaces.nsITransferable;
import org.mozilla.xpcom.Mozilla;
import org.w3c.dom.Document;
+import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
/**
@@ -549,8 +549,8 @@
if (VpeDebug.PRINT_VISUAL_INNER_DRAGDROP_EVENT) {
System.out.print(" dragNode: " + element.getNodeName() + "(" + element + ")"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
}
-
- canDrag = vpeController.getVisualBuilder().canInnerDrag(element);
+
+ canDrag = canInnerDrag(element);
if (canDrag) {
Node sourceNode = getSourceNode(element);
if (sourceNode == null) {
@@ -564,6 +564,22 @@
return canDrag;
}
+ private boolean canInnerDrag(nsIDOMElement visualDragElement) {
+ VpeNodeMapping domMapping = vpeController.getDomMapping()
+ .getNodeMapping(visualDragElement);
+ if (domMapping instanceof VpeElementMapping) {
+ VpeElementMapping elementMapping = (VpeElementMapping) domMapping;
+ if (elementMapping.getSourceNode() instanceof Element) {
+ return elementMapping.getTemplate().canInnerDrag(
+ vpeController.getPageContext(),
+ (Element) elementMapping.getSourceNode(),
+ vpeController.getXulRunnerEditor().getDOMDocument(),
+ visualDragElement, elementMapping.getData());
+ }
+ }
+ return false;
+ }
+
private Node getSourceNode(nsIDOMNode visualNode) {
return vpeController.getDomMapping().getNearSourceNode(visualNode);
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-10-07 13:10:30 UTC (rev 25554)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-10-07 13:30:26 UTC (rev 25555)
@@ -1301,21 +1301,6 @@
return false;
}
- public boolean canInnerDrag(nsIDOMElement visualDragElement) {
- VpeNodeMapping node = domMapping.getNodeMapping(visualDragElement);
- if (node instanceof VpeElementMapping) {
- VpeElementMapping elementMapping = (VpeElementMapping) node;
- if (elementMapping != null
- && elementMapping.getSourceNode() instanceof Element) {
- return elementMapping.getTemplate().canInnerDrag(pageContext,
- (Element) elementMapping.getSourceNode(),
- getVisualDocument(), visualDragElement,
- elementMapping.getData());
- }
- }
- return false;
- }
-
public void innerDrop(Node dragNode, Node container, int offset) {
VpeNodeMapping mapping = domMapping.getNearNodeMapping(container);
if (mapping != null) {
13 years, 9 months
JBoss Tools SVN: r25554 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2010-10-07 09:10:30 -0400 (Thu, 07 Oct 2010)
New Revision: 25554
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
Log:
https://jira.jboss.org/browse/JBIDE-7269 fixed beans.xml validation
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2010-10-07 12:35:17 UTC (rev 25553)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/BeansXmlValidationDelegate.java 2010-10-07 13:10:30 UTC (rev 25554)
@@ -39,7 +39,6 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.jboss.tools.cdi.core.CDIConstants;
import org.jboss.tools.cdi.core.CDICorePlugin;
-import org.jboss.tools.cdi.core.ICDIProject;
import org.jboss.tools.cdi.core.IClassBean;
import org.jboss.tools.cdi.core.IDecorator;
import org.jboss.tools.cdi.core.IInterceptor;
@@ -69,28 +68,28 @@
private AlternativeClassValidator getAlternativeClassValidator() {
if(alternativeClassValidator==null) {
- alternativeClassValidator = new AlternativeClassValidator(validator.cdiProject);
+ alternativeClassValidator = new AlternativeClassValidator();
}
return alternativeClassValidator;
}
private AlternativeStereotypeValidator getAlternativeStereotypeValidator() {
if(alternativeStereotypeValidator==null) {
- alternativeStereotypeValidator = new AlternativeStereotypeValidator(validator.cdiProject);
+ alternativeStereotypeValidator = new AlternativeStereotypeValidator();
}
return alternativeStereotypeValidator;
}
private DecoratorTypeValidator getDecoratorTypeValidator() {
if(decoratorTypeValidator==null) {
- decoratorTypeValidator = new DecoratorTypeValidator(validator.cdiProject);
+ decoratorTypeValidator = new DecoratorTypeValidator();
}
return decoratorTypeValidator;
}
private InterceptorTypeValidator getInterceptorTypeValidator() {
if(interceptorTypeValidator==null) {
- interceptorTypeValidator = new InterceptorTypeValidator(validator.cdiProject);
+ interceptorTypeValidator = new InterceptorTypeValidator();
}
return interceptorTypeValidator;
}
@@ -386,13 +385,8 @@
String getDuplicateTypeErrorMessage();
}
- private static abstract class AbstractTypeValidator implements TypeValidator {
- ICDIProject cdiProject;
+ private abstract class AbstractTypeValidator implements TypeValidator {
- public AbstractTypeValidator(ICDIProject cdiProject) {
- this.cdiProject = cdiProject;
- }
-
public String getTypeElementName() {
return "class"; //$NON-NLS-1$
}
@@ -414,14 +408,10 @@
protected abstract String getAnnotationName();
}
- private static class AlternativeClassValidator extends AbstractTypeValidator {
+ private class AlternativeClassValidator extends AbstractTypeValidator {
- public AlternativeClassValidator(ICDIProject cdiProject) {
- super(cdiProject);
- }
-
public boolean validateSourceType(IType type) {
- IClassBean classBean = cdiProject.getBeanClass(type);
+ IClassBean classBean = validator.cdiProject.getBeanClass(type);
return classBean!=null && classBean.isAlternative();
}
@@ -447,14 +437,10 @@
}
}
- private static class AlternativeStereotypeValidator extends AbstractTypeValidator {
+ private class AlternativeStereotypeValidator extends AbstractTypeValidator {
- public AlternativeStereotypeValidator(ICDIProject cdiProject) {
- super(cdiProject);
- }
-
public boolean validateSourceType(IType type) {
- IStereotype stereotype = cdiProject.getStereotype(type);
+ IStereotype stereotype = validator.cdiProject.getStereotype(type);
return stereotype!=null && stereotype.isAlternative();
}
@@ -490,14 +476,10 @@
}
}
- private static class DecoratorTypeValidator extends AbstractTypeValidator {
+ private class DecoratorTypeValidator extends AbstractTypeValidator {
- public DecoratorTypeValidator(ICDIProject cdiProject) {
- super(cdiProject);
- }
-
public boolean validateSourceType(IType type) {
- IClassBean classBean = cdiProject.getBeanClass(type);
+ IClassBean classBean = validator.cdiProject.getBeanClass(type);
return classBean instanceof IDecorator;
}
@@ -523,14 +505,10 @@
}
}
- private static class InterceptorTypeValidator extends AbstractTypeValidator {
+ private class InterceptorTypeValidator extends AbstractTypeValidator {
- public InterceptorTypeValidator(ICDIProject cdiProject) {
- super(cdiProject);
- }
-
public boolean validateSourceType(IType type) {
- IClassBean classBean = cdiProject.getBeanClass(type);
+ IClassBean classBean = validator.cdiProject.getBeanClass(type);
return classBean instanceof IInterceptor;
}
13 years, 9 months
JBoss Tools SVN: r25553 - trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2010-10-07 08:35:17 -0400 (Thu, 07 Oct 2010)
New Revision: 25553
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
Log:
https://jira.jboss.org/browse/JBIDE-7258 :
DnD in VPE does not work with rich:calendar
- VpeVisualDomBuilder has been refactored
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-10-07 10:59:11 UTC (rev 25552)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2010-10-07 12:35:17 UTC (rev 25553)
@@ -21,7 +21,6 @@
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -30,20 +29,14 @@
import org.eclipse.core.resources.IStorage;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IFileEditorInput;
import org.eclipse.wst.sse.core.internal.provisional.INodeAdapter;
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.jboss.tools.common.resref.core.ResourceReference;
import org.jboss.tools.jst.jsp.JspEditorPlugin;
import org.jboss.tools.jst.jsp.preferences.IVpePreferencesPage;
-import org.jboss.tools.jst.jsp.preferences.VpePreference;
-import org.jboss.tools.jst.web.tld.TaglibData;
-import org.jboss.tools.vpe.VpeDebug;
import org.jboss.tools.vpe.VpePlugin;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -76,11 +69,9 @@
import org.mozilla.interfaces.nsIDOMElement;
import org.mozilla.interfaces.nsIDOMEvent;
import org.mozilla.interfaces.nsIDOMEventTarget;
-import org.mozilla.interfaces.nsIDOMHTMLDocument;
import org.mozilla.interfaces.nsIDOMNSEvent;
import org.mozilla.interfaces.nsIDOMNode;
import org.mozilla.interfaces.nsIDOMNodeList;
-import org.mozilla.interfaces.nsIDOMRange;
import org.mozilla.interfaces.nsIDOMText;
import org.mozilla.xpcom.XPCOMException;
import org.w3c.dom.Attr;
@@ -91,10 +82,6 @@
import org.w3c.dom.NodeList;
public class VpeVisualDomBuilder extends VpeDomBuilder {
- private static final String CURSOR_MOVE_STYLE_ID = "vpeCursorMoveStyle"; //$NON-NLS-1$
- private static final String CURSOR_MOVE_SELECTOR = "*{cursor: move !important}"; //$NON-NLS-1$
- public static final String SRC_NODE = "SRC_NODE"; //$NON-NLS-1$
- public static final String PARENT = "PARENT"; //$NON-NLS-1$
public static final String VPE_USER_TOGGLE_ID = "vpe-user-toggle-id"; //$NON-NLS-1$
public static final String VPE_USER_TOGGLE_LOOKUP_PARENT = "vpe-user-toggle-lookup-parent"; //$NON-NLS-1$
/*
@@ -103,13 +90,9 @@
*/
public static final String VPE_FACET = "VPE-FACET"; //$NON-NLS-1$
- private static final String PSEUDO_ELEMENT = "br"; //$NON-NLS-1$
private static final String PSEUDO_ELEMENT_ATTR = "vpe:pseudo-element"; //$NON-NLS-1$
- private static final String INIT_ELEMENT_ATTR = "vpe:init-element"; //$NON-NLS-1$
private static final String MOZ_ANONCLASS_ATTR = "_MOZ_ANONCLASS"; //$NON-NLS-1$
private static final String INCLUDE_ELEMENT_ATTR = "vpe:include-element"; //$NON-NLS-1$
- private static final int DRAG_AREA_WIDTH = 10;
- private static final int DRAG_AREA_HEIGHT = 10;
private static String DOTTED_BORDER = "border: 1px dotted #FF6600; padding: 5px;"; //$NON-NLS-1$
private static final String CSS_STYLE_FOR_BORDER_FOR_UNKNOWN_TAGS = ";border: 1px solid green;"; //$NON-NLS-1$
@@ -121,7 +104,7 @@
private VpePageContext pageContext;
// JBIDE-2170 Sergey Dzmitrovich
// private nsIDOMNode headNode;
- private List includeStack;
+ private List<VpeIncludeInfo> includeStack;
// TODO Max Areshkau JBIDE-1457
// boolean rebuildFlag = false;
@@ -132,18 +115,8 @@
private static final String ATTR_REL_STYLESHEET_VALUE = "stylesheet"; //$NON-NLS-1$
private static final String YES_STRING = "yes"; //$NON-NLS-1$
- private static final String ZERO_STRING = "0"; //$NON-NLS-1$
private static final String EMPTY_STRING = ""; //$NON-NLS-1$
- private static final String ATRIBUTE_BORDER = "border"; //$NON-NLS-1$
- private static final String ATRIBUTE_CELLSPACING = "cellspacing"; //$NON-NLS-1$
- private static final String ATRIBUTE_CELLPADDING = "cellpadding"; //$NON-NLS-1$
-
- private static final String DOTTED_BORDER_STYLE = "border : 1px dotted #808080"; //$NON-NLS-1$
- private static final String DOTTED_BORDER_STYLE_FOR_IMG = "1px dotted #808080"; //$NON-NLS-1$
- private static final String DOTTED_BORDER_STYLE_FOR_TD = "border-left : 1px dotted #808080; border-right : 1px dotted #808080; border-top : 1px dotted #808080; border-bottom : 0px; color:#0051DD; background-color:#ECF3FF; padding-left: 3px; padding-right: 3px; line-height : 10px; font-family : arial; font-size : 10px; text-align:top; margin : 1px; -moz-user-modify : read-only"; //$NON-NLS-1$
- private static final String DOTTED_BORDER_STYLE_FOR_SPAN = "border : 1px solid #0051DD; color:#0051DD; background-color:#ECF3FF; padding-left: 3px; padding-right: 3px; line-height : 10px; font-family : arial; font-size : 10px; text-align:top; margin : 1px; -moz-user-modify : read-only"; //$NON-NLS-1$
-
static private HashSet<String> unborderedSourceNodes = new HashSet<String>();
static {
unborderedSourceNodes.add(HTML.TAG_HTML);
@@ -202,9 +175,10 @@
VpeSourceDomBuilder sourceBuilder = pageContext.getSourceBuilder();
IDocument document = sourceBuilder.getStructuredTextViewer()
.getDocument();
- if (document == null)
+ if (document == null) {
return;
- includeStack = new ArrayList();
+ }
+ includeStack = new ArrayList<VpeIncludeInfo>();
IEditorInput input = pageContext.getEditPart().getEditorInput();
if (input instanceof IFileEditorInput) {
IFile file = ((IFileEditorInput) input).getFile();
@@ -333,127 +307,6 @@
}
/**
- * Creates border around each tag.
- *
- * @param sourceNode the source node
- * @param visualNode the visual node
- * @param block show if it is block or inline tag
- * @return the border element around visual tag
- */
- private nsIDOMElement createBorder(Node sourceNode,
- nsIDOMElement visualNode, boolean block) {
- nsIDOMElement border = null;
- if (visualNode == null)
- return null;
- if (unborderedSourceNodes.contains(sourceNode.getNodeName()
- .toLowerCase()))
- return null;
- if (unborderedVisualNodes.contains(visualNode.getNodeName()
- .toLowerCase()))
- return null;
- if (HTML.TAG_IMG.equalsIgnoreCase(visualNode.getNodeName())) {
- String width = visualNode.getAttribute(ATRIBUTE_BORDER);
- if (width == null || ZERO_STRING.equalsIgnoreCase(width)
- || EMPTY_STRING.equalsIgnoreCase(width)) {
- String style = visualNode
- .getAttribute(VpeStyleUtil.ATTRIBUTE_STYLE);
- style = VpeStyleUtil.setParameterInStyle(style,
- ATRIBUTE_BORDER, DOTTED_BORDER_STYLE_FOR_IMG);
- visualNode.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
- }
- return null;
- }
- if (block) {
- if (YES_STRING.equals(VpePreference.USE_DETAIL_BORDER.getValue())) {
- border = getVisualDocument().createElement(HTML.TAG_TABLE);
- border.setAttribute(ATRIBUTE_CELLSPACING, ZERO_STRING);
- border.setAttribute(ATRIBUTE_CELLPADDING, ZERO_STRING);
-
- nsIDOMElement tr1 = getVisualDocument().createElement(HTML.TAG_TR);
- border.appendChild(tr1);
- nsIDOMElement td1 = getVisualDocument().createElement(HTML.TAG_TD);
- td1.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE,
- DOTTED_BORDER_STYLE_FOR_TD);
- nsIDOMText text = getVisualDocument().createTextNode(sourceNode
- .getNodeName());
- td1.appendChild(text);
- tr1.appendChild(td1);
- nsIDOMElement tr2 = getVisualDocument().createElement(HTML.TAG_TR);
- border.appendChild(tr2);
- nsIDOMElement td2 = getVisualDocument().createElement(HTML.TAG_TD);
- tr2.appendChild(td2);
- nsIDOMElement p = getVisualDocument().createElement(HTML.TAG_P);
- p.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE,
- DOTTED_BORDER_STYLE);
- td2.appendChild(p);
-
- p.appendChild(visualNode);
-
- } else {
- border = getVisualDocument().createElement(HTML.TAG_TABLE);
- border.setAttribute(ATRIBUTE_CELLSPACING, ZERO_STRING);
- border.setAttribute(ATRIBUTE_CELLPADDING, ZERO_STRING);
-
- nsIDOMElement tr2 = getVisualDocument().createElement(HTML.TAG_TR);
- border.appendChild(tr2);
- nsIDOMElement td2 = getVisualDocument().createElement(HTML.TAG_TD);
- tr2.appendChild(td2);
- nsIDOMElement p = getVisualDocument().createElement(HTML.TAG_P);
- p.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE,
- DOTTED_BORDER_STYLE);
- td2.appendChild(p);
-
- p.appendChild(visualNode);
- }
- } else {
- border = getVisualDocument().createElement(HTML.TAG_SPAN);
- border.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE,
- DOTTED_BORDER_STYLE);
- if (YES_STRING.equals(VpePreference.USE_DETAIL_BORDER.getValue())) {
- nsIDOMElement name = getVisualDocument()
- .createElement(HTML.TAG_SPAN);
- name.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE,
- DOTTED_BORDER_STYLE_FOR_SPAN);
- nsIDOMText text = getVisualDocument().createTextNode(sourceNode
- .getNodeName());
- name.appendChild(text);
- border.appendChild(name);
- }
- border.appendChild(visualNode);
- }
- if (VpeStyleUtil.getAbsolute((Element) sourceNode)) {
- int top = VpeStyleUtil.getSizeFromStyle((Element) sourceNode,
- VpeStyleUtil.ATTRIBUTE_STYLE + VpeStyleUtil.DOT_STRING
- + VpeStyleUtil.PARAMETER_TOP);
- int left = VpeStyleUtil.getSizeFromStyle((Element) sourceNode,
- VpeStyleUtil.ATTRIBUTE_STYLE + VpeStyleUtil.DOT_STRING
- + VpeStyleUtil.PARAMETER_LEFT);
-
- String style = visualNode
- .getAttribute(VpeStyleUtil.ATTRIBUTE_STYLE);
- style = VpeStyleUtil.deleteFromString(style,
- VpeStyleUtil.PARAMETER_POSITION,
- VpeStyleUtil.SEMICOLON_STRING);
- style = VpeStyleUtil.deleteFromString(style,
- VpeStyleUtil.PARAMETER_TOP, VpeStyleUtil.SEMICOLON_STRING);
- style = VpeStyleUtil.deleteFromString(style,
- VpeStyleUtil.PARAMETER_LEFT, VpeStyleUtil.SEMICOLON_STRING);
- visualNode.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
-
- style = border.getAttribute(VpeStyleUtil.ATTRIBUTE_STYLE);
- style = VpeStyleUtil.setAbsolute(style);
- if (top != -1)
- style = VpeStyleUtil.setSizeInStyle(style,
- VpeStyleUtil.PARAMETER_TOP, top);
- if (left != -1)
- style = VpeStyleUtil.setSizeInStyle(style,
- VpeStyleUtil.PARAMETER_LEFT, left);
- border.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
- }
- return border;
- }
-
- /**
* Creates new visual node representing {@code sourceNode} and its descendants.
*
* @param sourceNode source node
@@ -535,8 +388,9 @@
nsIDOMNode visualNewNode = creationData.getNode();
- if (sourceNode.getNodeType() == Node.ELEMENT_NODE && visualNewNode == null && isShowInvisibleTags())
+ if (sourceNode.getNodeType() == Node.ELEMENT_NODE && visualNewNode == null && isShowInvisibleTags()) {
visualNewNode = createInvisbleElementLabel(sourceNode);
+ }
nsIDOMElement border = null;
@@ -633,10 +487,11 @@
getPageContext().setCurrentVisualNode(null);
- if (border != null)
+ if (border != null) {
return border;
- else
+ } else {
return visualNewNode;
+ }
}
protected void correctVisualAttribute(nsIDOMElement element) {
@@ -721,41 +576,6 @@
/**
*
- * @param containerTemplate
- * @param sourceContainer
- * @param visualContainer
- */
- protected nsIDOMNode addInvisibleChildren(Node sourceContainer,
- nsIDOMNode visualContainer) {
- nsIDOMElement wrapper = null;
- int count = 0;
- // node is not null
- if (visualContainer != null) {
-
- // wrap node to span
- wrapper = getVisualDocument().createElement(HTML.TAG_SPAN);
- wrapper.appendChild(visualContainer);
-
- // add all invisible tags to wrapper
- NodeList sourceNodes = sourceContainer.getChildNodes();
-
- for (int i = 0; i < sourceNodes.getLength(); i++) {
-
- Node child = sourceNodes.item(i);
-
- if (isInvisibleNode(child)) {
- addNode(child, null, wrapper);
- count++;
- }
- }
- }
-
- return count > 0 ? wrapper : visualContainer;
-
- }
-
- /**
- *
* @param node
* @return
*/
@@ -766,8 +586,9 @@
VpeTemplate template = getTemplateManager().getTemplate(pageContext, node,
ifDependencySet);
// check if invisible tag
- if (template.isInvisible())
+ if (template.isInvisible()) {
return true;
+ }
return false;
}
@@ -814,8 +635,7 @@
l = CSSReferenceList.getInstance().getAllResources(file);
}
if (l != null) {
- for (int i = 0; i < l.length; i++) {
- ResourceReference item = l[i];
+ for (ResourceReference item : l) {
addLinkNodeToHead("file:///" + item.getLocation(), YES_STRING, false); //$NON-NLS-1$
}
}
@@ -851,63 +671,6 @@
addExternalLinks();
}
- // ==========================================================
- void resetPseudoElement(nsIDOMNode visualNode) {
- if (visualNode != null) {
- nsIDOMNode visualParent = visualNode.getParentNode();
- if (visualParent != null) {
- PseudoInfo info = getPseudoInfo(visualParent);
- if (info.pseudoNode == null && !info.isElements) {
- addPseudoElementImpl(visualParent);
- } else if (info.pseudoNode != null && info.isElements) {
- visualParent.removeChild(info.pseudoNode);
- }
- }
- }
- }
-
- private PseudoInfo getPseudoInfo(nsIDOMNode visualParent) {
- nsIDOMNode pseudoNode = null;
- boolean isElements = false;
-
- if (visualParent == null)
- return new PseudoInfo();
- nsIDOMNodeList visualNodes = visualParent.getChildNodes();
- if (visualNodes == null)
- return new PseudoInfo();
-
- long length = visualNodes.getLength();
- for (long i = 0; i < length; i++) {
- nsIDOMNode visualNode = visualNodes.item(i);
- if (pseudoNode == null && isPseudoElement(visualNode)) {
- pseudoNode = visualNode;
- } else if (!isEmptyText(visualNode)) {
- isElements = true;
- }
- if (pseudoNode != null && isElements) {
- break;
- }
- }
- return new PseudoInfo(pseudoNode, isElements);
- }
-
- static boolean isInitElement(nsIDOMNode visualNode) {
- if (visualNode == null) {
- return false;
- }
-
- if (visualNode.getNodeType() != Node.ELEMENT_NODE) {
- return false;
- }
-
- if (YES_STRING.equalsIgnoreCase(((nsIDOMElement) visualNode)
- .getAttribute(INIT_ELEMENT_ATTR))) {
- return true;
- }
-
- return false;
- }
-
public static boolean isPseudoElement(nsIDOMNode visualNode) {
if (visualNode == null) {
return false;
@@ -944,20 +707,6 @@
}
- private void addPseudoElementImpl(nsIDOMNode visualParent) {
- if (!getTemplateManager().isWithoutPseudoElementContainer(visualParent
- .getNodeName())) {
- if (VpeDebug.VISUAL_ADD_PSEUDO_ELEMENT) {
- System.out.println("-------------------- addPseudoElement: " //$NON-NLS-1$
- + visualParent.getNodeName());
- }
- nsIDOMElement visualPseudoElement = getVisualDocument()
- .createElement(PSEUDO_ELEMENT);
- visualPseudoElement.setAttribute(PSEUDO_ELEMENT_ATTR, YES_STRING);
- visualParent.appendChild(visualPseudoElement);
- }
- }
-
public boolean isEmptyElement(nsIDOMNode visualParent) {
nsIDOMNodeList visualNodes = visualParent.getChildNodes();
long len = visualNodes.getLength();
@@ -997,8 +746,9 @@
// ==========================================================
public void updateNode(Node sourceNode) {
- if (sourceNode == null)
+ if (sourceNode == null) {
return;
+ }
switch (sourceNode.getNodeType()) {
case Node.DOCUMENT_NODE:
@@ -1174,8 +924,9 @@
}
public void stopToggle(Node sourceNode) {
- if (!(sourceNode instanceof Element))
+ if (!(sourceNode instanceof Element)) {
return;
+ }
Element sourceElement = (Element) sourceNode;
VpeElementMapping elementMapping = (VpeElementMapping) domMapping
@@ -1244,7 +995,7 @@
}
// end of fix
}
- Node sourceNode = (Node) domMapping.getSourceNode(selectedElem);
+ Node sourceNode = domMapping.getSourceNode(selectedElem);
if (sourceNode == null) {
return false;
}
@@ -1508,29 +1259,6 @@
}
- private static class PseudoInfo {
- private nsIDOMNode pseudoNode;
- private boolean isElements;
-
- private PseudoInfo() {
- this(null, false);
- }
-
- private PseudoInfo(nsIDOMNode pseudoNode, boolean isElements) {
- this.pseudoNode = pseudoNode;
- this.isElements = isElements;
- }
- }
-
- void showDragCaret(nsIDOMNode node, int offset) {
- xulRunnerEditor.showDragCaret(node, offset);
- }
-
- void hideDragCaret() {
-
- xulRunnerEditor.hideDragCaret();
- }
-
private int getResizerConstrains(nsIDOMNode visualNode) {
VpeNodeMapping nodeMapping = domMapping.getNodeMapping(visualNode);
if (nodeMapping != null
@@ -1625,29 +1353,6 @@
}
}
- nsIDOMElement getNearDragElement(Element visualElement) {
- VpeElementMapping elementMapping = domMapping
- .getNearElementMapping(visualElement);
- while (elementMapping != null) {
- if (canInnerDrag(elementMapping.getVisualElement())) {
- return elementMapping.getVisualElement();
- }
- elementMapping = domMapping.getNearElementMapping(elementMapping
- .getVisualNode().getParentNode());
- }
- return null;
- }
-
- nsIDOMElement getDragElement(nsIDOMElement visualElement) {
- VpeElementMapping elementMapping = domMapping
- .getNearElementMapping(visualElement);
- if (elementMapping != null
- && canInnerDrag(elementMapping.getVisualElement())) {
- return elementMapping.getVisualElement();
- }
- return null;
- }
-
public static boolean isTextEditable(nsIDOMNode visualNode) {
if (visualNode != null) {
@@ -1682,8 +1387,9 @@
protected void setTooltip(Element sourceElement, nsIDOMElement visualElement) {
if (visualElement != null && sourceElement != null
&& !((IDOMElement) sourceElement).isJSPTag()) {
- if (HTML.TAG_HTML.equalsIgnoreCase(sourceElement.getNodeName()))
+ if (HTML.TAG_HTML.equalsIgnoreCase(sourceElement.getNodeName())) {
return;
+ }
String titleValue = getTooltip(sourceElement);
if (titleValue != null) {
@@ -1712,21 +1418,6 @@
}
}
- private void resetTooltip(nsIDOMElement visualElement, String titleValue) {
- visualElement.setAttribute(HTML.ATTR_TITLE, titleValue);
- nsIDOMNodeList children = visualElement.getChildNodes();
- long len = children.getLength();
- for (long i = 0; i < len; i++) {
- nsIDOMNode child = children.item(i);
- if (child.getNodeType() == nsIDOMNode.ELEMENT_NODE) {
- if (domMapping.getNodeMapping(child) == null) {
- resetTooltip(queryInterface(child, nsIDOMElement.class),
- titleValue);
- }
- }
- }
- }
-
private String getTooltip(Element sourceElement) {
StringBuffer buffer = new StringBuffer();
buffer.append(sourceElement.getNodeName());
@@ -1744,9 +1435,10 @@
+ attrs.item(i).getNodeValue().substring(
valueLength - 15, valueLength));
buffer.append("\n" + attrs.item(i).getNodeName() + ": " + temp); //$NON-NLS-1$ //$NON-NLS-2$
- } else
+ } else {
buffer.append("\n" + attrs.item(i).getNodeName() + ": " //$NON-NLS-1$ //$NON-NLS-2$
+ attrs.item(i).getNodeValue());
+ }
}
@@ -1767,16 +1459,6 @@
return visualLastChild;
}
- public nsIDOMRange createDOMRange() {
- return xulRunnerEditor.createDOMRange();
- }
-
- public nsIDOMRange createDOMRange(nsIDOMNode selectedNode) {
- nsIDOMRange range = createDOMRange();
- range.selectNode(selectedNode);
- return range;
- }
-
public static boolean isIncludeElement(nsIDOMElement visualElement) {
return YES_STRING.equalsIgnoreCase(visualElement
.getAttribute(INCLUDE_ELEMENT_ATTR));
@@ -1793,36 +1475,6 @@
node.setAttribute(VpeStyleUtil.ATTRIBUTE_STYLE, style);
}
- /**
- * Changes the mouse cursor icon in VPE to 'move'.
- */
- private void showMoveCursor(boolean show) {
- nsIDOMHTMLDocument document = queryInterface(xulRunnerEditor.getDOMDocument(),
- nsIDOMHTMLDocument.class);
-
- nsIDOMElement moveStyle = document.getElementById(CURSOR_MOVE_STYLE_ID);
- // If moveStyle == null then the move cursor icon is shown
- // otherwise it is not.
-
- if (show && moveStyle == null) {
- moveStyle = document.createElement(HTML.TAG_STYLE);
- moveStyle.setAttribute(HTML.ATTR_ID, CURSOR_MOVE_STYLE_ID);
- nsIDOMText selector = document.createTextNode(CURSOR_MOVE_SELECTOR);
- moveStyle.appendChild(selector);
- document.getBody().appendChild(moveStyle);
- } else if (!show && moveStyle != null) {
- moveStyle.getParentNode().removeChild(moveStyle);
- }
- }
-
-
- public static boolean inDragArea(Rectangle dragArea, Point mousePoint) {
- // TODO add drag and drop support
- return dragArea.contains(mousePoint)
- && mousePoint.x < (dragArea.x + DRAG_AREA_WIDTH)
- && mousePoint.y < (dragArea.y + DRAG_AREA_HEIGHT);
- }
-
public nsIDOMNode getOriginalTargetNode(nsIDOMEvent event) {
nsIDOMNode targetNode = VisualDomUtil.getTargetNode(event);
if (HTML.TAG_INPUT.equalsIgnoreCase(targetNode.getNodeName())) {
@@ -1840,7 +1492,7 @@
}
public nsIDOMText getOutputTextNode(Attr attr) {
- Element sourceElement = ((Attr) attr).getOwnerElement();
+ Element sourceElement = attr.getOwnerElement();
VpeElementMapping elementMapping = domMapping
.getNearElementMapping(sourceElement);
if (elementMapping != null) {
@@ -1863,17 +1515,17 @@
public VpeIncludeInfo popIncludeStack() {
VpeIncludeInfo includeInfo = null;
if (includeStack.size() > 0) {
- includeInfo = (VpeIncludeInfo) includeStack.remove(includeStack
- .size() - 1);
+ includeInfo = includeStack.remove(includeStack.size() - 1);
}
return includeInfo;
}
public boolean isFileInIncludeStack(IStorage file) {
- if (file == null)
+ if (file == null) {
return false;
+ }
for (int i = 0; i < includeStack.size(); i++) {
- if (file.equals(((VpeIncludeInfo) includeStack.get(i)).getStorage())) {
+ if (file.equals((includeStack.get(i)).getStorage())) {
return true;
}
}
@@ -1884,28 +1536,18 @@
return includeStack.size() <= 1;
}
- public int getCurrentMainIncludeOffset() {
- if (includeStack.size() <= 1)
- return -1;
- VpeIncludeInfo info = (VpeIncludeInfo) includeStack.get(1);
- return ((IndexedRegion) info.getElement()).getStartOffset();
- }
/**
* Can be a null in some cases, for example when we open an external file, see JBIDE-3030
* @return file include info
*/
public VpeIncludeInfo getCurrentIncludeInfo() {
- if (includeStack.size() <= 0)
+ if (includeStack.size() <= 0) {
return null;
- return (VpeIncludeInfo) includeStack.get(includeStack.size() - 1);
+ }
+ return includeStack.get(includeStack.size() - 1);
}
- public VpeIncludeInfo getRootIncludeInfo() {
- if (includeStack.size() <= 1)
- return null;
- return (VpeIncludeInfo) includeStack.get(1);
- }
-
+ @Override
public void dispose() {
clearIncludeDocuments();
includeDocuments = null;
@@ -1917,8 +1559,7 @@
private void clearIncludeDocuments() {
Collection<Document> documents = includeDocuments.values();
- for (Iterator iterator = documents.iterator(); iterator.hasNext();) {
- Document document = (Document) iterator.next();
+ for (Document document : documents) {
VpeCreatorUtil.releaseDocumentFromRead(document);
}
includeDocuments.clear();
@@ -1932,14 +1573,6 @@
}
/**
- * @param pageContext
- * the pageContext to set
- */
- protected void setPageContext(VpePageContext pageContext) {
- this.pageContext = pageContext;
- }
-
- /**
* @return the visualDocument
*/
protected nsIDOMDocument getVisualDocument() {
@@ -1953,14 +1586,6 @@
return xulRunnerEditor;
}
- /**
- * @param xulRunnerEditor
- * the xulRunnerEditor to set
- */
- public void setXulRunnerEditor(XulRunnerEditor xulRunnerEditor) {
- this.xulRunnerEditor = xulRunnerEditor;
- }
-
public Map<IStorage, Document> getIncludeDocuments() {
return includeDocuments;
}
@@ -2003,35 +1628,4 @@
return span;
}
-
-// this method is never used
-// void setMoveCursor(nsIDOMMouseEvent mouseEvent) {
-// nsIDOMElement selectedElement = xulRunnerEditor
-// .getLastSelectedElement();
-// if (selectedElement != null && canInnerDrag(selectedElement)
-// && inDragArea(getNodeBounds(selectedElement), VisualDomUtil
-// .getMousePoint(mouseEvent))) {
-// // change cursor
-// showMoveCursor(true);
-// //if mouse in drag area, and left button is pressed than we should
-// //start drag session manually.
-// } else {
-// // change cursor style to normal
-// showMoveCursor(false);
-// }
-// }
-
-// this method is never used
-// nsIDOMElement getDragElement(nsIDOMMouseEvent mouseEvent) {
-//
-// nsIDOMElement selectedElement = xulRunnerEditor
-// .getLastSelectedElement();
-// if (selectedElement != null && canInnerDrag(selectedElement)) {
-// if (inDragArea(getNodeBounds(selectedElement), VisualDomUtil
-// .getMousePoint(mouseEvent))) {
-// return selectedElement;
-// }
-// }
-// return null;
-// }
}
13 years, 9 months
JBoss Tools SVN: r25552 - trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions.
by jbosstools-commits@lists.jboss.org
Author: tfennelly
Date: 2010-10-07 06:59:11 -0400 (Thu, 07 Oct 2010)
New Revision: 25552
Modified:
trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java
Log:
https://jira.jboss.org/browse/JBIDE-7233
Empty selected task details when using Apply Template (XML/XSD) from Input Task
Modified: trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java
===================================================================
--- trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java 2010-10-07 10:55:47 UTC (rev 25551)
+++ trunk/smooks/plugins/org.jboss.tools.smooks.ui/src/org/jboss/tools/smooks/graphical/actions/AddTaskNodeAction.java 2010-10-07 10:59:11 UTC (rev 25552)
@@ -1,5 +1,7 @@
package org.jboss.tools.smooks.graphical.actions;
+import java.util.List;
+
import org.eclipse.ui.IEditorPart;
import org.jboss.tools.smooks.editor.ISmooksModelProvider;
import org.jboss.tools.smooks.graphical.editors.TaskTypeManager;
@@ -35,12 +37,16 @@
@Override
public void update() {
this.setEnabled(false);
- if (this.getCurrentSelectedTask() != null && this.getCurrentSelectedTask().size() == 1) {
- TaskType currentTask = this.getCurrentSelectedTask().get(0);
- String taskID = currentTask.getId();
- if (taskID != null) {
- if (taskID.equals(TaskTypeManager.TASK_ID_INPUT) || taskID.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING))
- this.setEnabled(true);
+ List<TaskType> currentSelectedTask = this.getCurrentSelectedTask();
+ if (currentSelectedTask != null && currentSelectedTask.size() == 1) {
+ TaskType currentTask = currentSelectedTask.get(0);
+
+ if(currentTask.getTask().isEmpty()) {
+ String taskID = currentTask.getId();
+ if (taskID != null) {
+ if (taskID.equals(TaskTypeManager.TASK_ID_INPUT) || taskID.equals(TaskTypeManager.TASK_ID_JAVA_MAPPING))
+ this.setEnabled(true);
+ }
}
}
}
13 years, 9 months