JBoss Tools SVN: r12154 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-30 18:21:49 -0500 (Sun, 30 Nov 2008)
New Revision: 12154
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties
Log:
JBIDE-3272 Users cannot change projects from Seam 2.0 to Seam 2.1
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties 2008-11-30 23:18:24 UTC (rev 12153)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties 2008-11-30 23:21:49 UTC (rev 12154)
@@ -4,7 +4,7 @@
SeamFacetVersionChangeDialog_Libraries_to_be_removed=Libraries to be removed:
SeamFacetVersionChangeDialog_New_Seam_Runtime=New Seam Runtime:
SeamFacetVersionChangeDialog_Note=Note
-SeamFacetVersionChangeDialog_Note_description=Seam config files and their XSDs won't be changed.
+SeamFacetVersionChangeDialog_Note_description=Seam configuration files and their XSDs won't be changed.
SeamFacetVersionChangeDialog_Old_Seam_Runtime=Old Seam Runtime:
SeamFacetVersionChangeDialog_Project=Project\: {0}
SeamFacetVersionChangeDialog_Seam_Runtime_Settings=Seam Runtime Settings
16 years
JBoss Tools SVN: r12153 - in trunk/seam/plugins/org.jboss.tools.seam.ui: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-30 18:18:24 -0500 (Sun, 30 Nov 2008)
New Revision: 12153
Added:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/AbstractFileSetContentProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/EarFileSetProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/FileSetLabelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/Messages.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/RemovedFileSetProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/WarFileSetProvider.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
Log:
JBIDE-3272 Users cannot change projects from Seam 2.0 to Seam 2.1
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-11-30 23:17:57 UTC (rev 12152)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2008-11-30 23:18:24 UTC (rev 12153)
@@ -80,3 +80,4 @@
org.jboss.tools.seam.ui.widget.field,
org.jboss.tools.seam.ui.wizard
Bundle-Vendor: Red Hat, Inc.
+Import-Package: com.ibm.icu.text
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-11-30 23:17:57 UTC (rev 12152)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2008-11-30 23:18:24 UTC (rev 12153)
@@ -639,4 +639,13 @@
<provider class="org.jboss.tools.seam.ui.views.properties.SeamELAttributeContentProposalProvider"/>
</extension>
+
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <action facet="jst.seam" type="version-change">
+ <delegate class="org.jboss.tools.seam.ui.dialog.SeamFacetVersionChangeDelegate"/>
+ </action>
+ </extension>
+
+
</plugin>
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/AbstractFileSetContentProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/AbstractFileSetContentProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/AbstractFileSetContentProvider.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.Comparator;
+
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+
+import com.ibm.icu.text.Collator;
+
+/**
+ *
+ * @author snjeza
+ */
+public abstract class AbstractFileSetContentProvider implements
+ IStructuredContentProvider {
+
+ protected static File[] ZERO_ARRAY = new File[0];
+ protected Object[] elements = ZERO_ARRAY;
+ private final Comparator comparer = new Comparator() {
+ private Collator collator = Collator.getInstance();
+
+ public int compare(Object arg0, Object arg1) {
+ String s1 = ((File) arg0).getName();
+ String s2 = ((File) arg1).getName();
+ return collator.compare(s1, s2);
+ }
+ };
+ public Object[] getElements(Object inputElement) {
+ return elements;
+ }
+
+ public void dispose() {
+
+ }
+
+ public void sort() {
+ File[] results = new File[elements.length];
+ System.arraycopy(elements, 0, results, 0, elements.length);
+ Collections.sort(Arrays.asList(results), comparer);
+ elements = results;
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/EarFileSetProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/EarFileSetProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/EarFileSetProvider.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.internal.core.project.facet.Seam2FacetInstallDelegate;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegate;
+import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils.FileSet;
+import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils.FileSetFileFilter;
+
+/**
+ *
+ * @author snjeza
+ */
+public class EarFileSetProvider extends AbstractFileSetContentProvider {
+
+ private SeamVersion version;
+
+ public EarFileSetProvider(SeamVersion version) {
+ super();
+ this.version = version;
+ }
+
+ private FileSet getFileSet() {
+ if (SeamVersion.SEAM_1_2.equals(version)) {
+ return SeamFacetInstallDelegate.JBOSS_EAR_CONTENT;
+ } else {
+ return Seam2FacetInstallDelegate.JBOSS_EAR_CONTENT;
+ }
+ }
+
+ private String getDroolsLibPath() {
+ if (SeamVersion.SEAM_1_2.equals(version)) {
+ return SeamFacetInstallDelegate.DROOLS_LIB_SEAM_RELATED_PATH;
+ } else {
+ return Seam2FacetInstallDelegate.DROOLS_LIB_SEAM_RELATED_PATH;
+ }
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (newInput instanceof File) {
+ Set<File> set = new TreeSet<File>();
+ File seamHomePath = (File) newInput;
+ set.addAll(getFiles(seamHomePath));
+ File seamLibFolder = new File(seamHomePath,
+ SeamFacetAbstractInstallDelegate.SEAM_LIB_RELATED_PATH);
+ set.addAll(getFiles(seamLibFolder));
+ File droolsLibFolder = new File(seamHomePath, getDroolsLibPath());
+ set.addAll(getFiles(droolsLibFolder));
+ elements = set.toArray(new File[0]);
+ } else {
+ elements = ZERO_ARRAY;
+ }
+ sort();
+ }
+
+ private List<File> getFiles(File dir) {
+ List<File> list = new ArrayList<File>();
+ if (dir == null || !dir.isDirectory()) {
+ return list;
+ }
+ FileSet set = getFileSet().dir(dir);
+ FileSetFileFilter filter = new FileSetFileFilter(set);
+ File[] files = dir.listFiles(filter);
+ for (int i = 0; i < files.length; i++) {
+ list.add(files[i]);
+ }
+ return list;
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/FileSetLabelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/FileSetLabelProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/FileSetLabelProvider.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,30 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import java.io.File;
+
+import org.eclipse.jface.viewers.LabelProvider;
+
+/**
+ *
+ * @author snjeza
+ */
+public class FileSetLabelProvider extends LabelProvider {
+
+ public String getText(Object element) {
+ if (element instanceof File) {
+ return ((File) element).getName();
+ } else {
+ return ""; //$NON-NLS-1$
+ }
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/Messages.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/Messages.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/Messages.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,26 @@
+package org.jboss.tools.seam.ui.dialog;
+
+import org.eclipse.osgi.util.NLS;
+
+public class Messages extends NLS {
+ private static final String BUNDLE_NAME = "org.jboss.tools.seam.ui.dialog.messages"; //$NON-NLS-1$
+ public static String SeamFacetVersionChangeDialog_Add;
+ public static String SeamFacetVersionChangeDialog_Libraries;
+ public static String SeamFacetVersionChangeDialog_Libraries_to_be_added;
+ public static String SeamFacetVersionChangeDialog_Libraries_to_be_removed;
+ public static String SeamFacetVersionChangeDialog_New_Seam_Runtime;
+ public static String SeamFacetVersionChangeDialog_Note;
+ public static String SeamFacetVersionChangeDialog_Note_description;
+ public static String SeamFacetVersionChangeDialog_Old_Seam_Runtime;
+ public static String SeamFacetVersionChangeDialog_Project;
+ public static String SeamFacetVersionChangeDialog_Seam_Runtime_Settings;
+ public static String SeamFacetVersionChangeDialog_Set_Seam_Runtime;
+ public static String SeamFacetVersionChangeDialog_Update_libraries;
+ static {
+ // initialize resource bundle
+ NLS.initializeMessages(BUNDLE_NAME, Messages.class);
+ }
+
+ private Messages() {
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/RemovedFileSetProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/RemovedFileSetProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/RemovedFileSetProvider.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import java.io.File;
+import java.io.FileFilter;
+
+import org.eclipse.jface.viewers.Viewer;
+
+/**
+ *
+ * @author snjeza
+ */
+public class RemovedFileSetProvider extends AbstractFileSetContentProvider {
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (newInput instanceof File) {
+ File dir = (File) newInput;
+ elements = dir.listFiles(new FileFilter() {
+
+ public boolean accept(File pathname) {
+ if (pathname.getName().endsWith(".jar") || pathname.getName().endsWith(".zip")) { //$NON-NLS-1$ //$NON-NLS-2$
+ return true;
+ }
+ return false;
+ }
+
+ });
+ } else {
+ elements = ZERO_ARRAY;
+ }
+ sort();
+ }
+
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDelegate.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDelegate.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+
+/**
+ * This delegate changes Seam facet version
+ *
+ * @author snjeza
+ */
+public class SeamFacetVersionChangeDelegate implements IDelegate {
+
+ /**
+ * @see
+ * IDelegate.execute(IProject,IProjectFacetVersion,Object,IProgressMonitor
+ * )
+ */
+ public void execute(final IProject project, final IProjectFacetVersion fv,
+ final Object config, final IProgressMonitor monitor) throws CoreException {
+
+ Display.getDefault().syncExec(new Runnable() {
+
+ public void run() {
+ try {
+ Shell shell = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getShell();
+ //Shell shell = null;
+ IFacetedProject fproj = ProjectFacetsManager
+ .create(project);
+ SeamFacetVersionChangeDialog dialog = new SeamFacetVersionChangeDialog(
+ shell, fproj, fv);
+ dialog.open();
+ } catch (CoreException e) {
+ log(e);
+ } finally {
+ if (monitor != null) {
+ monitor.done();
+ }
+ }
+ }
+
+ });
+ }
+
+ private static void log(Throwable e) {
+ IStatus status = new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID, e
+ .getLocalizedMessage(), e);
+ SeamCorePlugin.getDefault().getLog().log(status);
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/SeamFacetVersionChangeDialog.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,572 @@
+/*************************************************************************************
+ * Copyright (c) 2008 JBoss, a division of Red Hat and others.
+ * All rights reserved. This program and the accompanying materials
+ * are 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:
+ * JBoss, a division of Red Hat - Initial implementation.
+ ************************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import java.io.File;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspaceRunnable;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.Assert;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.jface.dialogs.TitleAreaDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.CheckStateChangedEvent;
+import org.eclipse.jface.viewers.CheckboxTableViewer;
+import org.eclipse.jface.viewers.IBaseLabelProvider;
+import org.eclipse.jface.viewers.ICheckStateListener;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.ListViewer;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
+import org.eclipse.ui.wizards.datatransfer.FileSystemStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.IImportStructureProvider;
+import org.eclipse.ui.wizards.datatransfer.ImportOperation;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.ui.widget.editor.SeamRuntimeListFieldEditor.SeamRuntimeNewWizard;
+import org.jboss.tools.seam.ui.wizard.SeamFormWizard;
+import org.jboss.tools.seam.ui.wizard.SeamWizardUtils;
+
+/**
+ * @author snjeza
+ *
+ */
+public class SeamFacetVersionChangeDialog extends TitleAreaDialog {
+ private IProjectFacetVersion fv;
+ private IEclipsePreferences preferences;
+ private IProject warProject;
+ private Image _dlgTitleImage;
+ private Combo seamRuntimeCombo;
+ private Text seamRuntimeNameText;
+ private CheckboxTableViewer removed;
+ private ListViewer added;
+ private ListViewer addedEar;
+ private CheckboxTableViewer removedEar;
+ private Button updateLibs;
+ private static IOverwriteQuery OVERWRITE_ALL = new IOverwriteQuery() {
+ public String queryOverwrite(String file) {
+ return ALL;
+ }
+ };
+ private static String[] filePattern = { "jboss-seam", "antlr-", //$NON-NLS-1$ //$NON-NLS-2$
+ "commons-beanutils", "commons-digester", "commons-jci" , //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "commons-collections", //$NON-NLS-1$
+ "core.", "drools-", "ajax4jsf", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ "jboss-el", "jbpm", "jsf-facelets", "jxl.jar", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+ "mvel", "richfaces" , //$NON-NLS-1$ //$NON-NLS-2$
+ "janino", "el-ri", "stringtemplate", "oscache-"}; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ /**
+ * @param parentShell
+ * @param newWizard
+ */
+ public SeamFacetVersionChangeDialog(Shell parentShell,
+ IFacetedProject facetedProject, IProjectFacetVersion fv) {
+ super(parentShell);
+ Assert.isNotNull(facetedProject);
+ setShellStyle(SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.MAX
+ | SWT.TITLE | SWT.BORDER | SWT.RESIZE | getDefaultOrientation());
+ this.fv = fv;
+ warProject = SeamWizardUtils.getRootSeamProject(facetedProject
+ .getProject());
+ Assert.isNotNull(warProject);
+ preferences = SeamCorePlugin.getSeamPreferences(warProject);
+ _dlgTitleImage = ImageDescriptor.createFromFile(SeamFormWizard.class,
+ "SeamWebProjectWizBan.png").createImage(); //$NON-NLS-1$
+ setTitleImage(_dlgTitleImage);
+ }
+
+ @Override
+ protected Control createDialogArea(Composite parent) {
+ Font mainFont = parent.getFont();
+ Composite area = (Composite) super.createDialogArea(parent);
+ Composite contents = new Composite(area, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_BOTH);
+ // gd.heightHint = 300;
+ contents.setLayoutData(gd);
+ contents.setLayout(new GridLayout(3, false));
+ setTitle(Messages.SeamFacetVersionChangeDialog_Seam_Runtime_Settings);
+ setMessage(Messages.SeamFacetVersionChangeDialog_Set_Seam_Runtime);
+ getShell().setText(Messages.SeamFacetVersionChangeDialog_Seam_Runtime_Settings);
+ applyDialogFont(contents);
+ initializeDialogUnits(area);
+
+ Label oldSeamRuntimeLabel = new Label(contents, SWT.NONE);
+ oldSeamRuntimeLabel.setText(Messages.SeamFacetVersionChangeDialog_Old_Seam_Runtime);
+ String seamRuntimeName = ""; //$NON-NLS-1$
+ if (preferences != null) {
+ seamRuntimeName = preferences.get(
+ ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, ""); //$NON-NLS-1$
+ }
+ seamRuntimeNameText = new Text(contents, SWT.BORDER);
+ seamRuntimeNameText.setText(seamRuntimeName);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ seamRuntimeNameText.setEnabled(false);
+ seamRuntimeNameText.setLayoutData(gd);
+
+ Label seamRuntimeLabel = new Label(contents, SWT.NONE);
+ seamRuntimeLabel.setText(Messages.SeamFacetVersionChangeDialog_New_Seam_Runtime);
+ seamRuntimeCombo = new Combo(contents, SWT.READ_ONLY);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ seamRuntimeCombo.setLayoutData(gd);
+ final SeamVersion version = SeamVersion.findByString(fv
+ .getVersionString());
+ String[] runtimeNames = getRuntimeNames(version);
+ seamRuntimeCombo.setItems(runtimeNames);
+ if (runtimeNames.length > 0) {
+ seamRuntimeCombo.select(0);
+ }
+
+ Button addSeamRuntime = new Button(contents, SWT.PUSH);
+ addSeamRuntime.setText(Messages.SeamFacetVersionChangeDialog_Add);
+ addSeamRuntime.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ List<SeamRuntime> added = new ArrayList<SeamRuntime>();
+ List<SeamVersion> versions = new ArrayList<SeamVersion>();
+ versions.add(version);
+ Wizard wiz = new SeamRuntimeNewWizard(
+ (List<SeamRuntime>) new ArrayList<SeamRuntime>(Arrays
+ .asList(SeamRuntimeManager.getInstance()
+ .getRuntimes())), added, versions);
+ WizardDialog dialog = new WizardDialog(Display.getCurrent()
+ .getActiveShell(), wiz);
+ dialog.open();
+ }
+
+ });
+
+ Group libraryGroup = new Group(contents, SWT.NONE);
+ libraryGroup.setText(Messages.SeamFacetVersionChangeDialog_Libraries);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan = 3;
+ libraryGroup.setLayoutData(gd);
+ libraryGroup.setLayout(new GridLayout(2, false));
+ updateLibs = new Button(libraryGroup, SWT.CHECK);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ gd.horizontalSpan = 2;
+ updateLibs.setLayoutData(gd);
+ updateLibs.setText(Messages.SeamFacetVersionChangeDialog_Update_libraries);
+ updateLibs.setSelection(false);
+
+ Label warProjectLabel = new Label(libraryGroup,SWT.NONE);
+ warProjectLabel.setText(NLS.bind(Messages.SeamFacetVersionChangeDialog_Project, warProject.getName()));
+ gd = new GridData(GridData.FILL_HORIZONTAL | GridData.CENTER);
+ gd.horizontalSpan=2;
+ warProjectLabel.setLayoutData(gd);
+ addLabels(libraryGroup);
+
+ removed = CheckboxTableViewer.newCheckList(
+ libraryGroup, SWT.SINGLE | SWT.TOP | SWT.BORDER);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 150;
+ removed.getTable().setLayoutData(gd);
+ removed.getTable().setFont(mainFont);
+ IBaseLabelProvider labelProvider = new FileSetLabelProvider();
+ removed.setLabelProvider(labelProvider);
+ File webLibFolder = getWebLibFolder();
+
+ IStructuredContentProvider rContentProvider = new RemovedFileSetProvider();
+ removed.setContentProvider(rContentProvider);
+ removed.setInput(webLibFolder);
+ removed.getTable().setEnabled(false);
+
+ removed.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ removed
+ .setSelection(new StructuredSelection(event
+ .getElement()));
+ }
+ });
+
+ check(removed, rContentProvider);
+ added = new ListViewer(libraryGroup, SWT.V_SCROLL
+ | SWT.H_SCROLL | SWT.BORDER);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 150;
+ added.getList().setLayoutData(gd);
+ added.getList().setFont(mainFont);
+ added.setLabelProvider(labelProvider);
+ SeamVersion newVersion = SeamRuntimeManager.getInstance()
+ .findRuntimeByName(seamRuntimeCombo.getText()).getVersion();
+ IStructuredContentProvider aContentProvider = new WarFileSetProvider(
+ isWarConfiguration(), newVersion);
+ added.setContentProvider(aContentProvider);
+
+ added.getList().setEnabled(false);
+
+ File earContentsFolder = getEarContentsFolder();
+ if (earContentsFolder != null && earContentsFolder.isDirectory()) {
+ Label earProjectLabel = new Label(libraryGroup,SWT.NONE);
+ String earProjectName = preferences.get(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, ""); //$NON-NLS-1$
+ earProjectLabel.setText(NLS.bind(Messages.SeamFacetVersionChangeDialog_Project, earProjectName));
+ gd = new GridData(GridData.FILL_HORIZONTAL | GridData.CENTER);
+ gd.horizontalSpan=2;
+ earProjectLabel.setLayoutData(gd);
+ addLabels(libraryGroup);
+ removedEar = CheckboxTableViewer
+ .newCheckList(libraryGroup, SWT.SINGLE | SWT.TOP
+ | SWT.BORDER);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 150;
+ removedEar.getTable().setLayoutData(gd);
+ removedEar.getTable().setFont(mainFont);
+ removedEar.setLabelProvider(labelProvider);
+
+ IStructuredContentProvider rEarContentProvider = new RemovedFileSetProvider();
+ removedEar.setContentProvider(rEarContentProvider);
+ removedEar.setInput(earContentsFolder);
+ removedEar.getTable().setEnabled(false);
+
+ removedEar.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ removedEar.setSelection(new StructuredSelection(event
+ .getElement()));
+ }
+ });
+
+ check(removedEar, rEarContentProvider);
+ addedEar = new ListViewer(libraryGroup,
+ SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.heightHint = 150;
+ addedEar.getList().setLayoutData(gd);
+ addedEar.getList().setFont(mainFont);
+ addedEar.setLabelProvider(labelProvider);
+ IStructuredContentProvider aEarContentProvider = new EarFileSetProvider(
+ newVersion);
+ addedEar.setContentProvider(aEarContentProvider);
+
+ addedEar.getList().setEnabled(false);
+
+ }
+ updateLibs.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ added.getList().setEnabled(updateLibs.getSelection());
+ removed.getTable().setEnabled(updateLibs.getSelection());
+ if (addedEar != null) {
+ removedEar.getTable().setEnabled(updateLibs.getSelection());
+ addedEar.getList().setEnabled(updateLibs.getSelection());
+ }
+ }
+
+ });
+ Group noteGroup = new Group(contents, SWT.NONE);
+ noteGroup.setText(Messages.SeamFacetVersionChangeDialog_Note);
+ noteGroup.setLayout(new GridLayout(2,false));
+ gd = new GridData(GridData.FILL_BOTH);
+ gd.horizontalSpan=3;
+ noteGroup.setLayoutData(gd);
+
+ Label noteImage = new Label(noteGroup,SWT.NONE);
+ Image image = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
+ noteImage.setImage(image);
+ Label noteLabel = new Label(noteGroup,SWT.NONE);
+ noteLabel.setText(Messages.SeamFacetVersionChangeDialog_Note_description);
+
+ seamRuntimeCombo.addSelectionListener(new SelectionAdapter() {
+
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ refresh();
+ }
+
+ });
+ refresh();
+ return area;
+ }
+
+ private void refresh() {
+ updateButton();
+ File seamHomePath = getSeamHomePath();
+ added.setInput(seamHomePath);
+ if (addedEar != null) {
+ addedEar.setInput(seamHomePath);
+ }
+ }
+
+ private void updateButton() {
+ Button okButton = getButton(IDialogConstants.OK_ID);
+ if (okButton != null) {
+ boolean ok = seamRuntimeCombo.getText().trim().length() > 0;
+ okButton.setEnabled(ok);
+ }
+ }
+
+ private void addLabels(Composite composite) {
+ Label removedLibs = new Label(composite, SWT.NONE);
+ GridData gd = new GridData(GridData.FILL_HORIZONTAL);
+ removedLibs.setLayoutData(gd);
+ removedLibs.setText(Messages.SeamFacetVersionChangeDialog_Libraries_to_be_removed);
+
+ Label addedLibs = new Label(composite, SWT.NONE);
+ addedLibs.setText(Messages.SeamFacetVersionChangeDialog_Libraries_to_be_added);
+ gd = new GridData(GridData.FILL_HORIZONTAL);
+ addedLibs.setLayoutData(gd);
+ }
+ private File getEarContentsFolder() {
+ IContainer earContentsFolder = getEarContentsEclipseFolder();
+ if (earContentsFolder == null) {
+ return null;
+ } else {
+ return earContentsFolder.getLocation().toFile();
+ }
+ }
+
+ private IContainer getEarContentsEclipseFolder() {
+ String earProjectName = preferences.get(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, ""); //$NON-NLS-1$
+ if (earProjectName != null && earProjectName.trim().length() > 0) {
+ IProject earProject = ResourcesPlugin.getWorkspace().getRoot().getProject(earProjectName);
+ if (earProject != null && earProject.isOpen()) {
+ IVirtualComponent component = ComponentCore.createComponent(earProject);
+ IVirtualFolder rootVirtFolder = component.getRootFolder().getFolder(new Path("/")); //$NON-NLS-1$
+ return rootVirtFolder.getUnderlyingFolder();
+ }
+ }
+ return null;
+
+ }
+
+ private void check(final CheckboxTableViewer removed,
+ IStructuredContentProvider rContentProvider) {
+ Object[] elements = rContentProvider.getElements(null);
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] instanceof File) {
+ File file = (File) elements[i];
+ removed.setChecked(elements[i], getChecked(file));
+
+ }
+ }
+ }
+
+ private boolean getChecked(File file) {
+ for (int i = 0; i < filePattern.length; i++) {
+ if (file.getName().startsWith(filePattern[i])) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private File getSeamHomePath() {
+ String selectedSeamName = seamRuntimeCombo.getText();
+ if (selectedSeamName != null && selectedSeamName.trim().length() > 0) {
+ SeamRuntime selectedSeamRuntime = SeamRuntimeManager.getInstance()
+ .findRuntimeByName(selectedSeamName);
+ if (selectedSeamRuntime != null) {
+ return new File(selectedSeamRuntime.getHomeDir());
+ }
+ }
+ return null;
+ }
+
+ private File getWebLibFolder() {
+ IContainer webLibFolder = getWebLibEclipseFolder();
+
+ return webLibFolder.getLocation().toFile();
+
+ }
+
+ private IContainer getWebLibEclipseFolder() {
+ IVirtualComponent component = ComponentCore
+ .createComponent(warProject);
+ IVirtualFolder libFolder = component.getRootFolder().getFolder(
+ new Path("/WEB-INF/lib")); //$NON-NLS-1$
+ IContainer webLibFolder = libFolder.getUnderlyingFolder();
+ return webLibFolder;
+ }
+
+ private String[] getRuntimeNames(SeamVersion seamVersion) {
+ SeamRuntime[] rts = SeamRuntimeManager.getInstance().getRuntimes(
+ seamVersion);
+ String[] names = new String[rts.length];
+ for (int i = 0; i < names.length; i++) {
+ names[i] = rts[i].getName();
+ }
+ return names;
+ }
+
+ @Override
+ public boolean close() {
+ if (_dlgTitleImage != null) {
+ _dlgTitleImage.dispose();
+ }
+ return super.close();
+ }
+
+ private boolean isWarConfiguration() {
+ if (preferences == null) {
+ return false;
+ }
+ return preferences.get(
+ ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
+ ISeamFacetDataModelProperties.DEPLOY_AS_WAR).equals(
+ ISeamFacetDataModelProperties.DEPLOY_AS_WAR);
+ }
+
+ @Override
+ protected void createButtonsForButtonBar(Composite parent) {
+ super.createButtonsForButtonBar(parent);
+ updateButton();
+ }
+
+ @Override
+ protected void okPressed() {
+
+ try {
+ ResourcesPlugin.getWorkspace().run(new IWorkspaceRunnable() {
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+ setSeamSettings();
+ updateLibraries();
+ }
+
+ }, new NullProgressMonitor());
+
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ super.okPressed();
+ }
+
+ protected void setSeamSettings() {
+ IEclipsePreferences prefs = preferences;
+ if(prefs==null) {
+ IScopeContext projectScope = new ProjectScope(warProject);
+ prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
+ }
+ prefs.put(ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION,
+ ISeamFacetDataModelProperties.SEAM_SETTINGS_VERSION_1_1);
+ prefs.put(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
+ seamRuntimeCombo.getText());
+
+ }
+
+ private void updateLibraries() throws CoreException {
+ if (updateLibs.getSelection()) {
+ IContainer webLibContainer = getWebLibEclipseFolder();
+ processProject(webLibContainer,removed,added);
+ if (removedEar != null) {
+ IContainer earContentsFolder = getEarContentsEclipseFolder();
+ processProject(earContentsFolder, removedEar, addedEar);
+ }
+ }
+ }
+
+ private void processProject(IContainer container,
+ CheckboxTableViewer cbtViewer, ListViewer listViewer)
+ throws CoreException {
+ if (container != null) {
+ removeFiles(container, cbtViewer.getCheckedElements());
+ IStructuredContentProvider structuredProvider = (IStructuredContentProvider) listViewer
+ .getContentProvider();
+ Object[] addedElements = structuredProvider.getElements(null);
+ Map<File, List<File>> parentMaps = getImportMaps(addedElements);
+ IPath containerPath = container.getFullPath();
+ IImportStructureProvider provider = FileSystemStructureProvider.INSTANCE;
+ for (File parent : parentMaps.keySet()) {
+ try {
+ ImportOperation op = new ImportOperation(containerPath,
+ parent, provider, OVERWRITE_ALL, parentMaps
+ .get(parent));
+ op.setCreateContainerStructure(false);
+ op.run(new NullProgressMonitor());
+ } catch (InvocationTargetException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ } catch (InterruptedException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+ }
+
+ private void removeFiles(IContainer container, Object[] elements) throws CoreException {
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] instanceof File) {
+ File file = (File) elements[i];
+ String name = file.getName();
+ IResource resource = container.findMember(name);
+ resource.delete(true, null);
+ }
+ }
+ }
+
+ private Map<File, List<File>> getImportMaps(Object[] elements) {
+ Map<File, List<File>> parentMaps = new HashMap<File, List<File>>();
+ for (int i = 0; i < elements.length; i++) {
+ if (elements[i] instanceof File) {
+ File file = (File) elements[i];
+ File parent = file.getParentFile();
+ Set<File> parents = parentMaps.keySet();
+ if (parents.contains(parent)) {
+ List<File> files = parentMaps.get(parent);
+ files.add(file);
+ } else {
+ List<File> files = new ArrayList<File>();
+ files.add(file);
+ parentMaps.put(parent, files);
+ }
+ }
+ }
+ return parentMaps;
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/WarFileSetProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/WarFileSetProvider.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/WarFileSetProvider.java 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.ui.dialog;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.eclipse.jface.viewers.Viewer;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
+import org.jboss.tools.seam.internal.core.project.facet.Seam2FacetInstallDelegate;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegate;
+import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils.FileSet;
+import org.jboss.tools.seam.internal.core.project.facet.AntCopyUtils.FileSetFileFilter;
+
+/**
+ *
+ * @author snjeza
+ */
+public class WarFileSetProvider extends AbstractFileSetContentProvider {
+
+ private boolean isWarConfiguration;
+ private SeamVersion version;
+
+ public WarFileSetProvider(boolean isWarConfiguration, SeamVersion version) {
+ super();
+ this.isWarConfiguration = isWarConfiguration;
+ this.version = version;
+ }
+
+ private FileSet getFileSet() {
+ if (isWarConfiguration) {
+ if (SeamVersion.SEAM_1_2.equals(version)) {
+ return SeamFacetInstallDelegate.JBOSS_WAR_LIB_FILESET_WAR_CONFIG;
+ } else {
+ return Seam2FacetInstallDelegate.JBOSS_WAR_LIB_FILESET_WAR_CONFIG;
+ }
+ } else {
+ if (SeamVersion.SEAM_1_2.equals(version)) {
+ return SeamFacetInstallDelegate.JBOSS_WAR_LIB_FILESET_EAR_CONFIG;
+ } else {
+ return Seam2FacetInstallDelegate.JBOSS_WAR_LIB_FILESET_EAR_CONFIG;
+ }
+ }
+ }
+
+ private String getDroolsLibPath() {
+ if (SeamVersion.SEAM_1_2.equals(version)) {
+ return SeamFacetInstallDelegate.DROOLS_LIB_SEAM_RELATED_PATH;
+ } else {
+ return Seam2FacetInstallDelegate.DROOLS_LIB_SEAM_RELATED_PATH;
+ }
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if (newInput instanceof File) {
+ Set<File> set = new TreeSet<File>();
+ File seamHomePath = (File) newInput;
+ set.addAll(getFiles(seamHomePath));
+ File seamLibFolder = new File(seamHomePath, SeamFacetAbstractInstallDelegate.SEAM_LIB_RELATED_PATH);
+ set.addAll(getFiles(seamLibFolder));
+ File droolsLibFolder = new File(seamHomePath, getDroolsLibPath());
+ set.addAll(getFiles(droolsLibFolder));
+ elements = set.toArray(new File[0]);
+ } else {
+ elements = ZERO_ARRAY;
+ }
+ sort();
+ }
+
+ private List<File> getFiles(File dir) {
+ List<File> list = new ArrayList<File>();
+ if (dir == null || !dir.isDirectory()) {
+ return list;
+ }
+ FileSet set = getFileSet().dir(dir);
+ FileSetFileFilter filter = new FileSetFileFilter(set);
+ File[] files = dir.listFiles(filter);
+ for (int i = 0; i < files.length; i++) {
+ list.add(files[i]);
+ }
+ return list;
+ }
+}
Added: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/dialog/messages.properties 2008-11-30 23:18:24 UTC (rev 12153)
@@ -0,0 +1,12 @@
+SeamFacetVersionChangeDialog_Add=Add...
+SeamFacetVersionChangeDialog_Libraries=Libraries
+SeamFacetVersionChangeDialog_Libraries_to_be_added=Libraries to be added:
+SeamFacetVersionChangeDialog_Libraries_to_be_removed=Libraries to be removed:
+SeamFacetVersionChangeDialog_New_Seam_Runtime=New Seam Runtime:
+SeamFacetVersionChangeDialog_Note=Note
+SeamFacetVersionChangeDialog_Note_description=Seam config files and their XSDs won't be changed.
+SeamFacetVersionChangeDialog_Old_Seam_Runtime=Old Seam Runtime:
+SeamFacetVersionChangeDialog_Project=Project\: {0}
+SeamFacetVersionChangeDialog_Seam_Runtime_Settings=Seam Runtime Settings
+SeamFacetVersionChangeDialog_Set_Seam_Runtime=Set Seam Runtime
+SeamFacetVersionChangeDialog_Update_libraries=Update libraries
16 years
JBoss Tools SVN: r12152 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-30 18:17:57 -0500 (Sun, 30 Nov 2008)
New Revision: 12152
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetVersionChangeDelegate.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
Log:
JBIDE-3272 Users cannot change projects from Seam 2.0 to Seam 2.1
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-11-29 20:44:55 UTC (rev 12151)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-11-30 23:17:57 UTC (rev 12152)
@@ -180,9 +180,7 @@
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetUninstallDelegate">
</delegate>
</action>
- <action facet="jst.seam" type="version-change">
- <delegate class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetVersionChangeDelegate"/>
- </action>
+
<event-handler
facet="jst.seam"
type="POST_INSTALL"
Deleted: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetVersionChangeDelegate.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetVersionChangeDelegate.java 2008-11-29 20:44:55 UTC (rev 12151)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetVersionChangeDelegate.java 2008-11-30 23:17:57 UTC (rev 12152)
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.internal.core.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.internal.dialogs.PropertyDialog;
-import org.eclipse.wst.common.project.facet.core.IDelegate;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * This delegate changes Seam facet version
- *
- * @author snjeza
- */
-public class SeamFacetVersionChangeDelegate implements IDelegate {
-
- /**
- * @see
- * IDelegate.execute(IProject,IProjectFacetVersion,Object,IProgressMonitor
- * )
- */
- public void execute(final IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
-
- Display.getDefault().asyncExec(new Runnable() {
-
- public void run() {
- Shell shell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
- IResource resource = project;
- PropertyDialog dialog = PropertyDialog.createDialogOn(shell, "org.jboss.tools.seam.ui.propertyPages.SeamSettingsPreferencePage", resource);
-
- if (dialog != null) {
- dialog.open();
- }
- }
-
- });
-
- }
-
-}
16 years
JBoss Tools SVN: r12151 - in trunk: as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-11-29 15:44:55 -0500 (Sat, 29 Nov 2008)
New Revision: 12151
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF
Log:
moved a test dependency to jmx, which I actually keep in my workspace
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2008-11-29 19:39:10 UTC (rev 12150)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/META-INF/MANIFEST.MF 2008-11-29 20:44:55 UTC (rev 12151)
@@ -7,7 +7,6 @@
Require-Bundle: org.eclipse.core.runtime,
org.junit,
org.eclipse.core.resources,
- org.jboss.tools.common.test,
org.eclipse.jdt.core,
org.eclipse.jdt.core.manipulation,
org.jboss.ide.eclipse.as.core,
@@ -18,6 +17,7 @@
org.eclipse.debug.core,
org.eclipse.jdt.launching,
org.eclipse.jst.jee;bundle-version="1.0.100",
- org.eclipse.jst.server.core;bundle-version="1.1.0"
+ org.eclipse.jst.server.core;bundle-version="1.1.0",
+ org.jboss.tools.jmx.core.test;bundle-version="0.2.2"
Eclipse-LazyStart: true
Bundle-ClassPath: jbossastest.jar
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java 2008-11-29 19:39:10 UTC (rev 12150)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JBIDE1657Test.java 2008-11-29 20:44:55 UTC (rev 12151)
@@ -35,7 +35,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.jboss.ide.eclipse.as.test.ASTest;
import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
-import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jmx.core.tests.util.TestProjectProvider;
/**
* This test will test whether the old classpath container,
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java 2008-11-29 19:39:10 UTC (rev 12150)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/JEEClasspathContainerTest.java 2008-11-29 20:44:55 UTC (rev 12151)
@@ -37,7 +37,7 @@
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
-import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jmx.core.tests.util.TestProjectProvider;
/**
* This class tests the jee classpath containers
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java 2008-11-29 19:39:10 UTC (rev 12150)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/classpath/ProjectRuntimeTest.java 2008-11-29 20:44:55 UTC (rev 12151)
@@ -37,7 +37,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.jboss.ide.eclipse.as.test.ASTest;
import org.jboss.ide.eclipse.as.test.util.ProjectRuntimeUtil;
-import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jmx.core.tests.util.TestProjectProvider;
public class ProjectRuntimeTest extends TestCase {
private TestProjectProvider provider;
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2008-11-29 19:39:10 UTC (rev 12150)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.test/src/org/jboss/ide/eclipse/as/test/publishing/AbstractDeploymentTest.java 2008-11-29 20:44:55 UTC (rev 12151)
@@ -29,7 +29,7 @@
import org.jboss.ide.eclipse.as.core.server.internal.DeployableServer;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.test.ASTest;
-import org.jboss.tools.common.test.util.TestProjectProvider;
+import org.jboss.tools.jmx.core.tests.util.TestProjectProvider;
import org.osgi.framework.Bundle;
public abstract class AbstractDeploymentTest extends TestCase {
Modified: trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF 2008-11-29 19:39:10 UTC (rev 12150)
+++ trunk/jmx/tests/org.jboss.tools.jmx.core.test/META-INF/MANIFEST.MF 2008-11-29 20:44:55 UTC (rev 12151)
@@ -12,3 +12,5 @@
org.jboss.tools.jmx.core;bundle-version="0.2.1",
org.eclipse.debug.core;bundle-version="3.4.0",
org.eclipse.jdt.launching;bundle-version="3.4.0"
+Export-Package: org.jboss.tools.jmx.core.tests,
+ org.jboss.tools.jmx.core.tests.util
16 years
JBoss Tools SVN: r12150 - trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-11-29 14:39:10 -0500 (Sat, 29 Nov 2008)
New Revision: 12150
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java
Log:
JBIDE-3319 Compile error in org.jboss.tools.portlet.ui
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java 2008-11-29 17:13:23 UTC (rev 12149)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/NewPortletClassOperation.java 2008-11-29 19:39:10 UTC (rev 12150)
@@ -53,4 +53,9 @@
emitter.addVariable(PortletUIActivator.PLUGIN_ID, PortletUIActivator.PLUGIN_ID);
return emitter.generate(monitor, new Object[] { tempModel });
}
+
+ @Override
+ protected Object getTemplateImplementation() {
+ return null;
+ }
}
16 years
JBoss Tools SVN: r12149 - in trunk/vpe/plugins/org.jboss.tools.vpe/resources: meta and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-29 12:13:23 -0500 (Sat, 29 Nov 2008)
New Revision: 12149
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
Log:
JBIDE-2773 adjustment
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-11-29 16:37:04 UTC (rev 12148)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/help/keys-vpe.properties 2008-11-29 17:13:23 UTC (rev 12149)
@@ -2,12 +2,18 @@
VpeCssReferencesDialog.Title=Visual Page Editor
VPECSSReference.location=CSS File Path
-VPECSSReference_AddItem.Title=Add References to CSS File
-VPECSSReference_EditItem.Title=Edit Existing References to CSS File
+VPECSSReferenceAddItem.Title=Add References to CSS File
+VPECSSReferenceEditItem.Title=Edit Existing References to CSS File
+VPECSSReferenceAddItem.Message=Add References to CSS File, which will be used for generation a preview
+VPECSSReferenceEditItem.Message=Edit Existing References to CSS File, which is used for generation a preview
-VPETLDReference_AddItem.Title=Add TLD Item
-VPETLDReference_EditItem.Title=Edit TLD Item
+
+VPETLDReferenceAddItem.Title=Add TLD Item
+VPETLDReferenceEditItem.Title=Edit TLD Item
+VPETLDReferenceAddItem.Message=Add TLD definition, which will be used in a visual part for generation a preview
+VPETLDReferenceEditItem.Message=Edit TLD Item, which is used in a visual part for generation a preview
+
VpeImageReferencesDialog.WindowTitle=References to Images Files
VpeImageReferencesDialog.Title=Visual Page Editor
VPEImageReference.location=Path to Folder
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-11-29 16:37:04 UTC (rev 12148)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/resources/meta/vpe.meta 2008-11-29 17:13:23 UTC (rev 12149)
@@ -35,7 +35,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport, key=VPECSSReferenceAddItem"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPECSSReference">
<AttributeData AttributeName="location"/>
@@ -45,7 +45,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport, key=VPECSSReferenceEditItem"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPECSSReference">
<AttributeData AttributeName="location"/>
@@ -85,7 +85,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport, key=VPECSSReferenceAddItem"
displayName="Add CSS Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPECSSReferenceExt">
<AttributeData AttributeName="location"/>
@@ -95,7 +95,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeCSSReferenceSupport, key=VPECSSReferenceEditItem"
displayName="Edit CSS Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPECSSReferenceExt">
<AttributeData AttributeName="location"/>
@@ -406,7 +406,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport, key=VPETLDReferenceAddItem"
displayName="Add Taglib Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -417,7 +417,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport, key=VPETLDReferenceEditItem"
displayName="Edit Taglib Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReference">
<AttributeData AttributeName="location"/>
@@ -457,7 +457,7 @@
<XActionItem kind="list">
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport, key=VPETLDReferenceAddItem"
displayName="Add TLD Reference..." kind="action" name="AddItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
@@ -468,7 +468,7 @@
</XActionItem>
<XActionItem kind="list" name="EditActions">
<XActionItem HandlerClassName="%SpecialWizard%" ICON="action.empty"
- PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport"
+ PROPERTIES="support=org.jboss.tools.vpe.resref.core.VpeTaglibReferenceSupport, key=VPETLDReferenceEditItem"
displayName="Edit TLD Reference..." kind="action" name="EditItem">
<EntityData EntityName="VPETLDReferenceExt">
<AttributeData AttributeName="location"/>
16 years
JBoss Tools SVN: r12148 - in trunk/vpe: tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2008-11-29 11:37:04 -0500 (Sat, 29 Nov 2008)
New Revision: 12148
Added:
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide3280/
trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide3280/jbide3280.html
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/jbide/
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/jbide/JBIDE3280Test.java
Modified:
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java
Log:
RESOLVED - issue JBIDE-3280: Styles crash in <body> tag after refresh button press.
https://jira.jboss.org/jira/browse/JBIDE-3280
- JUnit test has been written
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-11-29 15:58:03 UTC (rev 12147)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mozilla/MozillaEditor.java 2008-11-29 16:37:04 UTC (rev 12148)
@@ -86,7 +86,7 @@
public class MozillaEditor extends EditorPart implements IReusableEditor {
protected static final String INIT_URL = /*"file://" +*/ (new File(VpePlugin.getDefault().getResourcePath("ve"), "init.html")).getAbsolutePath(); //$NON-NLS-1$ //$NON-NLS-2$
- private static final String CONTENT_AREA_ID = "__content__area__"; //$NON-NLS-1$
+ public static final String CONTENT_AREA_ID = "__content__area__"; //$NON-NLS-1$
static String SELECT_BAR = "SELECT_LBAR"; //$NON-NLS-1$
private XulRunnerEditor xulRunnerEditor;
Added: trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide3280/jbide3280.html
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide3280/jbide3280.html (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/resources/htmlTest/WebContent/pages/jbide3280/jbide3280.html 2008-11-29 16:37:04 UTC (rev 12148)
@@ -0,0 +1,10 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
+<title>Insert title here</title>
+</head>
+<body style="color:red;">
+ Red Text
+</body>
+</html>
\ No newline at end of file
Modified: trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java 2008-11-29 15:58:03 UTC (rev 12147)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/HtmlAllTests.java 2008-11-29 16:37:04 UTC (rev 12148)
@@ -17,6 +17,7 @@
import junit.framework.TestSuite;
import org.jboss.tools.tests.ImportBean;
+import org.jboss.tools.vpe.html.test.jbide.JBIDE3280Test;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
@@ -36,6 +37,7 @@
TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); //$NON-NLS-1$
// $JUnit-BEGIN$
+ suite.addTestSuite(JBIDE3280Test.class);
suite.addTestSuite(HtmlComponentTest.class);
suite.addTestSuite(HtmlComponentContentTest.class);
Added: trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/jbide/JBIDE3280Test.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/jbide/JBIDE3280Test.java (rev 0)
+++ trunk/vpe/tests/org.jboss.tools.vpe.html.test/src/org/jboss/tools/vpe/html/test/jbide/JBIDE3280Test.java 2008-11-29 16:37:04 UTC (rev 12148)
@@ -0,0 +1,93 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.vpe.html.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.VpeDebug;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.editor.mozilla.MozillaEditor;
+import org.jboss.tools.vpe.editor.util.HTML;
+import org.jboss.tools.vpe.html.test.HtmlAllTests;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.jboss.tools.vpe.xulrunner.browser.util.DOMTreeDumper;
+import org.mozilla.interfaces.nsIDOMDocument;
+
+/**
+ * Check if style of body before refresh equals style of body after refresh
+ *
+ * @author yradtsevich
+ *
+ */
+public class JBIDE3280Test extends VpeTest {
+
+ private static final String TEST_PAGE_NAME="jbide3280/jbide3280.html"; //$NON-NLS-1$
+
+ public JBIDE3280Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE3280() throws Throwable {
+ setException(null);
+
+ IFile elementPageFile = (IFile) TestUtil.getComponentPath(
+ TEST_PAGE_NAME, HtmlAllTests.IMPORT_PROJECT_NAME);
+
+ IEditorInput input = new FileEditorInput(elementPageFile);
+
+ TestUtil.waitForJobs();
+
+ IEditorPart editor = PlatformUI.getWorkbench()
+ .getActiveWorkbenchWindow().getActivePage().openEditor(input,
+ EDITOR_ID, true);
+
+ assertNotNull(editor);
+
+ TestUtil.waitForJobs();
+
+ VpeController controller = getVpeController((JSPMultiPageEditor) editor);
+
+ final nsIDOMDocument oldDocument = controller.getXulRunnerEditor().getDOMDocument();
+ final String oldStyle = oldDocument
+ .getElementById(MozillaEditor.CONTENT_AREA_ID)
+ .getAttribute(HTML.ATTR_STYLE);
+
+ controller.visualRefresh();
+
+ TestUtil.waitForIdle();
+
+ final nsIDOMDocument newDocument = controller.getXulRunnerEditor().getDOMDocument();
+ final String newStyle = newDocument
+ .getElementById(MozillaEditor.CONTENT_AREA_ID)
+ .getAttribute(HTML.ATTR_STYLE);
+
+
+ // check if style of body before refresh equals style of body after refresh
+ assertEquals(oldStyle, newStyle);
+
+ if (getException() != null) {
+ throw getException();
+ }
+ }
+
+ protected String dump(nsIDOMDocument document) {
+ DOMTreeDumper dumper = new DOMTreeDumper(
+ VpeDebug.VISUAL_DUMP_PRINT_HASH);
+ dumper.setIgnoredAttributes(VpeDebug.VISUAL_DUMP_IGNORED_ATTRIBUTES);
+ dumper.dumpToStream(System.out, document);
+ return null;
+ }
+}
16 years
JBoss Tools SVN: r12147 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-29 10:58:03 -0500 (Sat, 29 Nov 2008)
New Revision: 12147
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml
Log:
junit for form was adjusted, JBIDE-3011
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp 2008-11-29 15:33:18 UTC (rev 12146)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp 2008-11-29 15:58:03 UTC (rev 12147)
@@ -9,9 +9,12 @@
<f:view>
<h1><h:outputText value="form" /></h1>
- <h:form id="form">
-
+ <div id="form_test">
+ <h:form style="background-color:Red;">
+ Test1Text<div style="background-color: green">Test2<h:form>TestText3</h:form></div>
+ <h:form>Test4Text</h:form>
</h:form>
+ </div>
</f:view>
</body>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml 2008-11-29 15:33:18 UTC (rev 12146)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml 2008-11-29 15:58:03 UTC (rev 12147)
@@ -1,6 +1,27 @@
<tests>
- <test id="form">
- <FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
- </FORM>
+ <test id="form_test">
+ <DIV STYLE="-moz-user-modify: read-write;">
+ <FORM
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; background-color: Red;">
+ <SPAN>
+ Test1Text
+</SPAN>
+ <DIV STYLE="background-color: green; -moz-user-modify: read-write;">
+ <SPAN>
+ Test2
+</SPAN>
+ <SPAN STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+ <SPAN>
+ TestText3
+</SPAN>
+ </SPAN>
+ </DIV>
+ <SPAN STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+ <SPAN>
+ Test4Text
+</SPAN>
+ </SPAN>
+ </FORM>
+ </DIV>
</test>
</tests>
\ No newline at end of file
16 years
JBoss Tools SVN: r12146 - in trunk: jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util and 7 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-29 10:33:18 -0500 (Sat, 29 Nov 2008)
New Revision: 12146
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfForm.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
Log:
JBIDE-3011
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/AbstractEditableJsfTemplate.java 2008-11-29 15:33:18 UTC (rev 12146)
@@ -14,16 +14,12 @@
import java.util.Map;
import java.util.Set;
-import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.IEditableTemplate;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
-import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Attr;
import org.w3c.dom.Element;
-import org.w3c.dom.Node;
/**
* general class for jsf templates.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfForm.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfForm.java 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/JsfForm.java 2008-11-29 15:33:18 UTC (rev 12146)
@@ -10,123 +10,54 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template;
-import java.util.ArrayList;
-import java.util.List;
-
+import org.jboss.tools.jsf.vpe.jsf.template.util.JSF;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
-import org.jboss.tools.vpe.editor.template.VpeChildrenInfo;
import org.jboss.tools.vpe.editor.template.VpeCreationData;
import org.jboss.tools.vpe.editor.util.HTML;
-import org.jboss.tools.vpe.editor.util.VpeStyleUtil;
import org.mozilla.interfaces.nsIDOMDocument;
import org.mozilla.interfaces.nsIDOMElement;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
/**
- * @author dmaliarevich
+ * @author mareshkau
*
*/
public class JsfForm extends VpeAbstractTemplate {
- private static String CONTENT_DIV_STYLE = "width: 100%; display: table; "; //$NON-NLS-1$
-
- private static final String DIR_VALUE_RTL = "RTL"; //$NON-NLS-1$
- private static final String DIR_VALUE_LTR = "LTR"; //$NON-NLS-1$
-
- private static final String SPACE = " "; //$NON-NLS-1$
- private static final String STYLE_CLASS = "styleClass"; //$NON-NLS-1$
-
- private String dir;
- private String style;
- private String styleClass;
-
- /**
- * Instantiates a new jsf form.
- */
- public JsfForm() {
- }
-
/* (non-Javadoc)
* @see org.jboss.tools.vpe.editor.template.VpeTemplate#create(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Node, org.mozilla.interfaces.nsIDOMDocument)
*/
public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
nsIDOMDocument visualDocument) {
- Element sourceElement = (Element)sourceNode;
- readAttributes(sourceElement);
-
- nsIDOMElement content_div = visualDocument.createElement(HTML.TAG_DIV);
- content_div.setAttribute(HTML.ATTR_STYLE, CONTENT_DIV_STYLE + SPACE + style);
-
- if (attrPresents(styleClass)) {
- content_div.setAttribute(HTML.ATTR_CLASS, styleClass);
- }
- if (attrPresents(dir)
- && (dir.equalsIgnoreCase(DIR_VALUE_RTL)
- || dir.equalsIgnoreCase(DIR_VALUE_LTR))) {
- content_div.setAttribute(HTML.ATTR_DIR, dir);
- }
-
-
- VpeCreationData creationData = new VpeCreationData(content_div);
- VpeChildrenInfo divInfo = new VpeChildrenInfo(content_div);
- creationData.addChildrenInfo(divInfo);
-
- for (Node child : getChildren(sourceElement)) {
- divInfo.addSourceChild(child);
- }
-
+ nsIDOMElement content_form= null;
+ if(!isExistingInParent(sourceNode)) {
+ content_form = visualDocument.createElement(HTML.TAG_FORM);
+ // copy jsf attributes to html, util function hasn't been founded, mareshkat
+ Element form = (Element) sourceNode;
+ if(form.hasAttribute(JSF.ATTR_STYLE)) {
+ content_form.setAttribute(HTML.ATTR_STYLE, form.getAttribute(JSF.ATTR_STYLE));
+ }
+ if(form.hasAttribute(JSF.ATTR_STYLE_CLASS)) {
+ content_form.setAttribute(HTML.ATTR_CLASS, form.getAttribute(JSF.ATTR_STYLE_CLASS));
+ }
+ } else {
+ content_form = visualDocument.createElement(HTML.TAG_SPAN);
+ }
+ VpeCreationData creationData = new VpeCreationData(content_form);
return creationData;
}
-
- /**
- * Gets the children.
- *
- * @param sourceElement the source element
- *
- * @return the children
- */
- public static List<Node> getChildren(Element sourceElement) {
- ArrayList<Node> children = new ArrayList<Node>();
- NodeList nodeList = sourceElement.getChildNodes();
- for (int i = 0; i < nodeList.getLength(); i++) {
- Node child = nodeList.item(i);
- children.add(child);
+ //mareshkau, fir for JBIDE-3011
+ private static boolean isExistingInParent(Node sourceNode) {
+ String nodeName=sourceNode.getNodeName();
+ Node parentNode = sourceNode.getParentNode();
+ while((parentNode!=null)&&(parentNode instanceof Node)){
+ if(nodeName.equals(parentNode.getNodeName())) {
+ return true;
+ }
+ parentNode = parentNode.getParentNode();
}
- return children;
+ return false;
}
-
- /* (non-Javadoc)
- * @see org.jboss.tools.vpe.editor.template.VpeAbstractTemplate#isRecreateAtAttrChange(org.jboss.tools.vpe.editor.context.VpePageContext, org.w3c.dom.Element, org.mozilla.interfaces.nsIDOMDocument, org.mozilla.interfaces.nsIDOMElement, java.lang.Object, java.lang.String, java.lang.String)
- */
- public boolean isRecreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
-
- /**
- * Read attributes from the source element.
- *
- * @param sourceNode
- * the source node
- */
- private void readAttributes(Element sourceElement) {
- style = sourceElement.getAttribute(HTML.ATTR_STYLE);
- styleClass = sourceElement.getAttribute(STYLE_CLASS);
- dir = sourceElement.getAttribute(HTML.ATTR_DIR);
- }
-
- /**
- * Checks is attribute presents.
- *
- * @param attr the attribute
- *
- * @return true, if successful
- */
- private boolean attrPresents(String attr) {
- return ((null != attr) && (!"".equals(attr))); //$NON-NLS-1$
- }
}
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/src/org/jboss/tools/jsf/vpe/jsf/template/util/ComponentUtil.java 2008-11-29 15:33:18 UTC (rev 12146)
@@ -10,12 +10,6 @@
******************************************************************************/
package org.jboss.tools.jsf.vpe.jsf.template.util;
-import java.io.File;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMAttr;
-import org.jboss.tools.jsf.vpe.jsf.JsfTemplatePlugin;
import org.jboss.tools.vpe.editor.bundle.BundleMap;
import org.jboss.tools.vpe.editor.context.VpePageContext;
import org.jboss.tools.vpe.editor.util.HTML;
@@ -123,8 +117,7 @@
*/
public static String getBundleValue(VpePageContext pageContext, Attr attr) {
- return getBundleValue(pageContext, attr.getNodeValue(),
- ((IDOMAttr) attr).getValueRegionStartOffset());
+ return getBundleValue(pageContext, attr.getNodeValue());
}
@@ -136,7 +129,7 @@
* @return
*/
public static String getBundleValue(VpePageContext pageContext,
- String value, int offfset) {
+ String value) {
BundleMap bundle = pageContext.getBundle();
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.jsf/templates/vpe-templates-jsf.xml 2008-11-29 15:33:18 UTC (rev 12146)
@@ -753,25 +753,7 @@
<vpe:drag start-enable="yes" />
<vpe:drop container="yes" />
</vpe:dnd>
- <vpe:textFormatting>
- <vpe:format type="BoldFormat">
- <vpe:formatAttribute type="style" />
- </vpe:format>
- <vpe:format type="ItalicFormat">
- <vpe:formatAttribute type="style" />
- </vpe:format>
- <vpe:format type="FontNameFormat">
- <vpe:formatAttribute type="style" />
- </vpe:format>
- <vpe:format type="FontSizeFormat">
- <vpe:formatAttribute type="style" />
- </vpe:format>
- <vpe:format type="BackgroundColorFormat">
- <vpe:formatAttribute type="style" />
- </vpe:format>
- <vpe:format type="ForegroundColorFormat">
- <vpe:formatAttribute type="style" />
- </vpe:format>
+ <vpe:textFormatting use-default-formats="yes">
</vpe:textFormatting>
</vpe:template>
</vpe:tag>
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesGMapTemplate.java 2008-11-29 15:33:18 UTC (rev 12146)
@@ -125,13 +125,4 @@
VpeCreationData creationData = new VpeCreationData(mapImg);
return creationData;
}
-
- public boolean isRecreateAtAttrChange(VpePageContext pageContext,
- Element sourceElement, nsIDOMDocument visualDocument,
- nsIDOMElement visualNode, Object data, String name, String value) {
- return true;
- }
-
-
-
}
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3144/test.xhtml.xml 2008-11-29 15:33:18 UTC (rev 12146)
@@ -1,7 +1,7 @@
<tests>
<test id="test_el">
-<DIV
- STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%; display: table;">
+<FORM
+ STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
<SPAN CLASS="message" STYLE="-moz-user-modify: read-only;">
Error Messages
</SPAN>
@@ -24,6 +24,6 @@
</SPAN>
</DIV>
</DIV>
-</DIV>
+</FORM>
</test>
</tests>
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/components/form.jsp.xml 2008-11-29 15:33:18 UTC (rev 12146)
@@ -1,14 +1,6 @@
<tests>
<test id="form">
- <TABLE
- STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px; width: 100%;">
- <TR>
- <TD>
- <DIV>
- </DIV>
- <BR />
- </TD>
- </TR>
- </TABLE>
+ <FORM STYLE="border: 1px dotted rgb(255, 102, 0); padding: 5px;">
+ </FORM>
</test>
</tests>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfComponentContentTest.java 2008-11-29 15:33:18 UTC (rev 12146)
@@ -215,6 +215,7 @@
performContentTest("components/view.jsp"); //$NON-NLS-1$
}
+ @Override
protected String getTestProjectName() {
return JsfAllTests.IMPORT_PROJECT_NAME;
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/util/HTML.java 2008-11-29 15:33:18 UTC (rev 12146)
@@ -59,6 +59,7 @@
public static final String TAG_LABEL = "LABEL"; //$NON-NLS-1$
public static final String TAG_A = "A"; //$NON-NLS-1$
public static final String TAG_H1 = "H1"; //$NON-NLS-1$
+ public static final String TAG_FORM = "FORM"; //$NON-NLS-1$
public static final String ATTR_ID = "ID"; //$NON-NLS-1$
public static final String ATTR_TYPE = "TYPE"; //$NON-NLS-1$
Modified: trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-11-29 13:00:23 UTC (rev 12145)
+++ trunk/vpe/plugins/org.jboss.tools.vpe.html/templates/vpe-templates-html.xml 2008-11-29 15:33:18 UTC (rev 12146)
@@ -799,7 +799,7 @@
<vpe:tag name="form" case-sensitive="no">
<vpe:template children="yes" modify="yes">
<vpe:copy attrs="id,style,class,align,dir" />
- <div />
+ <form />
<vpe:dnd>
<vpe:drag start-enable="yes" />
<vpe:drop container="yes" />
16 years
JBoss Tools SVN: r12145 - in trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test: resources/jsfTest/WebContent/pages/JBIDE/3163 and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-11-29 08:00:23 -0500 (Sat, 29 Nov 2008)
New Revision: 12145
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
Log:
JBIDE-3163
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/3163/jbide3163.html 2008-11-29 13:00:23 UTC (rev 12145)
@@ -0,0 +1 @@
+test1<h1>Test2</h1>Test3<input type="submit" value="Test Selection"></input>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-29 05:07:22 UTC (rev 12144)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-11-29 13:00:23 UTC (rev 12145)
@@ -43,6 +43,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3030Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3127Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3144Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE3163Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE924Test;
@@ -111,6 +112,7 @@
suite.addTestSuite(JBIDE3127Test.class);
suite.addTestSuite(JBIDE3144Test.class);
suite.addTestSuite(JBIDE2354Test.class);
+ suite.addTestSuite(JBIDE3163Test.class);
// $JUnit-END$
// added by Max Areshkau
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-29 05:07:22 UTC (rev 12144)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3144Test.java 2008-11-29 13:00:23 UTC (rev 12145)
@@ -80,7 +80,7 @@
}
public void testJBIDE3144Selection() throws Exception {
- IEditorInput input = new FileEditorInput(file);
+ IEditorInput input = new FileEditorInput(this.file);
JSPMultiPageEditor part = openEditor(input);
checkSourceSelection(part);
}
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE3163Test.java 2008-11-29 13:00:23 UTC (rev 12145)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2007-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
+ *
+ * Contributor:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.jboss.tools.vpe.xulrunner.editor.XulRunnerEditor;
+import org.mozilla.interfaces.nsIDOMNode;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE3163Test extends VpeTest{
+
+ public JBIDE3163Test(String name) {
+ super(name);
+ }
+
+ public void testJBIDE3163() throws Exception {
+ setException(null);
+ IFile file = (IFile) TestUtil.getComponentPath("JBIDE/3163/jbide3163.html", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ IEditorInput editorInput = new FileEditorInput(file);
+ JSPMultiPageEditor part = openEditor(editorInput);
+ VpeController controller = getVpeController(part);
+ XulRunnerEditor xulRunnerEditor = controller.getXulRunnerEditor();
+ int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 6);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Show be selected Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 7);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Element Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 15);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 20);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 25);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Text Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.TEXT_NODE); //$NON-NLS-1$
+ position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), 1, 26);
+ part.getSourceEditor().getTextViewer().setSelectedRange(position, 0);
+ assertTrue("Selected should be Element Node",xulRunnerEditor.getLastSelectedNode().getNodeType()==nsIDOMNode.ELEMENT_NODE); //$NON-NLS-1$
+
+ }
+}
16 years