JBoss Tools SVN: r3496 - trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2007-09-07 15:21:44 -0400 (Fri, 07 Sep 2007)
New Revision: 3496
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-825 Seam projects shold know what version and seam home library they are using
Create source folder method is fixed
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-09-07 18:31:25 UTC (rev 3495)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-09-07 19:21:44 UTC (rev 3496)
@@ -171,6 +171,8 @@
return null;
}
} catch (CoreException e) {
+ // Ignore if we cannot check that the file exists.
+ // Assume that it doesn't
}
}
}
@@ -194,7 +196,7 @@
if (projectEntryIndex != -1) {
newEntries.set(projectEntryIndex, newEntry);
} else {
- IClasspathEntry entry= JavaCore.newSourceEntry(path);
+ IClasspathEntry entry= JavaCore.newSourceEntry(newSourceFolderPath);
insertClasspathEntry(entry, newEntries);
}
@@ -216,7 +218,7 @@
IFolder newSourceFolder= javaProject.getProject().getFolder(newSourceFolderPath);
if (!newSourceFolder.exists()) {
- CoreUtility.createFolder(newSourceFolder, true, true, new SubProgressMonitor(new NullProgressMonitor(), 1));
+ CoreUtility.createFolder(newSourceFolder, true, true, null);
}
javaProject.setRawClasspath(newClasspathEntries, newOutputLocation, new NullProgressMonitor());
17 years, 4 months
JBoss Tools SVN: r3495 - 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: vrubezhny
Date: 2007-09-07 14:31:25 -0400 (Fri, 07 Sep 2007)
New Revision: 3495
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-825 Seam projects shold know what version and seam home library they are using
Create source folder method is added
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-09-07 18:26:01 UTC (rev 3494)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-09-07 18:31:25 UTC (rev 3495)
@@ -37,7 +37,8 @@
org.jboss.ide.eclipse.as.core,
org.eclipse.wst.server.core,
org.eclipse.jpt.core,
- org.eclipse.jpt.ui
+ org.eclipse.jpt.ui,
+ org.eclipse.core.filesystem
Provide-Package: org.jboss.tools.seam.core,
org.jboss.tools.seam.internal.core,
org.jboss.tools.seam.internal.core.scanner,
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-09-07 18:26:01 UTC (rev 3494)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/WtpUtils.java 2007-09-07 18:31:25 UTC (rev 3495)
@@ -11,22 +11,36 @@
package org.jboss.tools.seam.internal.core.project.facet;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.core.filesystem.EFS;
+import org.eclipse.core.filesystem.IFileStore;
import org.eclipse.core.resources.ICommand;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.SubProgressMonitor;
import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaModelStatus;
import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jdt.internal.ui.util.CoreUtility;
import org.eclipse.jdt.launching.JavaRuntime;
+import org.eclipse.jdt.ui.PreferenceConstants;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
@@ -114,4 +128,134 @@
}
return "";
}
+
+ public static IResource createSourceFolder (IProject project, IPath path) {
+ IJavaProject javaProject;
+ IClasspathEntry[] javaProjectEntries;
+ IPath outputLocation;
+ IWorkspaceRoot workspaceRoot;
+
+ if (project == null || !project.exists()) {
+ return null;
+ }
+ if (!project.isOpen()) {
+ return null;
+ }
+ try {
+ if (!project.hasNature(JavaCore.NATURE_ID))
+ return null;
+
+ javaProject= JavaCore.create(project);
+ javaProjectEntries= javaProject.getRawClasspath();
+ outputLocation= javaProject.getOutputLocation();
+ workspaceRoot= ResourcesPlugin.getWorkspace().getRoot();
+
+ IPath projPath= javaProject.getProject().getFullPath();
+ IPath newSourceFolderPath = projPath.append(path);
+
+ IStatus validate= workspaceRoot.getWorkspace().validatePath(newSourceFolderPath.toString(), IResource.FOLDER);
+ if (validate.matches(IStatus.ERROR))
+ return null;
+
+ IResource res= workspaceRoot.findMember(newSourceFolderPath);
+ if (res != null) {
+ if (res.getType() != IResource.FOLDER) {
+ return null;
+ }
+ } else {
+ URI projLocation= javaProject.getProject().getLocationURI();
+ if (projLocation != null) {
+ try {
+ IFileStore store= EFS.getStore(projLocation).getChild(path.toString());
+ if (store.fetchInfo().exists()) {
+ return null;
+ }
+ } catch (CoreException e) {
+ }
+ }
+ }
+ ArrayList newEntries= new ArrayList(javaProjectEntries.length + 1);
+ int projectEntryIndex= -1;
+
+ for (int i= 0; i < javaProjectEntries.length; i++) {
+ IClasspathEntry curr= javaProjectEntries[i];
+ if (curr.getEntryKind() == IClasspathEntry.CPE_SOURCE) {
+ if (newSourceFolderPath.equals(curr.getPath())) {
+ return null;
+ }
+ if (projPath.equals(curr.getPath())) {
+ projectEntryIndex= i;
+ }
+ }
+ newEntries.add(curr);
+ }
+
+ IClasspathEntry newEntry= JavaCore.newSourceEntry(newSourceFolderPath);
+ if (projectEntryIndex != -1) {
+ newEntries.set(projectEntryIndex, newEntry);
+ } else {
+ IClasspathEntry entry= JavaCore.newSourceEntry(path);
+ insertClasspathEntry(entry, newEntries);
+ }
+
+ IClasspathEntry[] newClasspathEntries= (IClasspathEntry[]) newEntries.toArray(new IClasspathEntry[newEntries.size()]);
+ IPath newOutputLocation= outputLocation;
+
+ IJavaModelStatus result= JavaConventions.validateClasspath(javaProject, newClasspathEntries, newOutputLocation);
+ if (!result.isOK()) {
+ if (outputLocation.equals(projPath)) {
+ newOutputLocation= projPath.append(PreferenceConstants.getPreferenceStore().getString(PreferenceConstants.SRCBIN_BINNAME));
+ result= JavaConventions.validateClasspath(javaProject, newClasspathEntries, newOutputLocation);
+ if (!result.isOK()) {
+ return null;
+ }
+ } else {
+ return null;
+ }
+ }
+
+ IFolder newSourceFolder= javaProject.getProject().getFolder(newSourceFolderPath);
+ if (!newSourceFolder.exists()) {
+ CoreUtility.createFolder(newSourceFolder, true, true, new SubProgressMonitor(new NullProgressMonitor(), 1));
+ }
+
+ javaProject.setRawClasspath(newClasspathEntries, newOutputLocation, new NullProgressMonitor());
+
+ return newSourceFolder;
+ } catch (CoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ return null;
+ }
+
+ static private void insertClasspathEntry(IClasspathEntry entry, List entries) {
+ int length= entries.size();
+ IClasspathEntry[] elements= (IClasspathEntry[])entries.toArray(new IClasspathEntry[length]);
+ int i= 0;
+ while (i < length && elements[i].getEntryKind() != entry.getEntryKind()) {
+ i++;
+ }
+ if (i < length) {
+ i++;
+ while (i < length && elements[i].getEntryKind() == entry.getEntryKind()) {
+ i++;
+ }
+ entries.add(i, entry);
+ return;
+ }
+
+ switch (entry.getEntryKind()) {
+ case IClasspathEntry.CPE_SOURCE:
+ entries.add(0, entry);
+ break;
+ case IClasspathEntry.CPE_CONTAINER:
+ case IClasspathEntry.CPE_LIBRARY:
+ case IClasspathEntry.CPE_PROJECT:
+ case IClasspathEntry.CPE_VARIABLE:
+ default:
+ entries.add(entry);
+ break;
+ }
+ }
+
}
17 years, 4 months
JBoss Tools SVN: r3494 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-07 14:26:01 -0400 (Fri, 07 Sep 2007)
New Revision: 3494
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
Log:
For a full publish, publish smart is not the correct API.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-07 17:40:21 UTC (rev 3493)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-07 18:26:01 UTC (rev 3494)
@@ -115,7 +115,7 @@
IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishSmart(members, moduleDeployPath, monitor);
+ PublishUtil.publishFull(members, moduleDeployPath, monitor);
IModule[] childModules = earModule.getModules();
for (int i = 0; i < childModules.length; i++) {
IModule module2 = childModules[i];
17 years, 4 months
JBoss Tools SVN: r3493 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-07 13:40:21 -0400 (Fri, 07 Sep 2007)
New Revision: 3493
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java
Log:
Removed catch(Throwable t) because I know max will kill me if he sees it.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java 2007-09-07 15:18:57 UTC (rev 3492)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/packages/ArchivesModelModuleContributor.java 2007-09-07 17:40:21 UTC (rev 3493)
@@ -50,24 +50,21 @@
}
protected void createModules(IProject project) {
- try {
- if( ArchivesModelCore.getProjectPackages(project.getLocation(), null, true).length > 0 ) {
- IModule module;
- IArchive[] packages = ArchivesModelCore.getProjectPackages(project.getLocation(), new NullProgressMonitor(), true);
- boolean requiresSave = ensureArchivesHaveIDs(project, packages);
- ArrayList mods = new ArrayList();
- for( int i = 0; i < packages.length; i++ ) {
- module = factory.createModule2(packages[i], project);
- modules.add(module);
- Object moduleDelegate = new PackagedModuleDelegate(packages[i]);
- packageToModule.put(packages[i], module);
- moduleDelegates.put(module, moduleDelegate);
- mods.add(module);
- }
- projectToModules.put(project.getLocation(), mods);
+ IArchive[] packs = ArchivesModelCore.getProjectPackages(project.getLocation(), null, false);
+ if( packs != null && packs.length > 0 ) {
+ IModule module;
+ IArchive[] packages = ArchivesModelCore.getProjectPackages(project.getLocation(), new NullProgressMonitor(), true);
+ boolean requiresSave = ensureArchivesHaveIDs(project, packages);
+ ArrayList mods = new ArrayList();
+ for( int i = 0; i < packages.length; i++ ) {
+ module = factory.createModule2(packages[i], project);
+ modules.add(module);
+ Object moduleDelegate = new PackagedModuleDelegate(packages[i]);
+ packageToModule.put(packages[i], module);
+ moduleDelegates.put(module, moduleDelegate);
+ mods.add(module);
}
- } catch( Throwable t ) {
- t.printStackTrace();
+ projectToModules.put(project.getLocation(), mods);
}
}
17 years, 4 months
JBoss Tools SVN: r3492 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: server and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-07 11:18:57 -0400 (Fri, 07 Sep 2007)
New Revision: 3492
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/IJBossServerLaunchDefaults.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/ServerLaunchDefaults.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java
Log:
Organized imports in previously-refactored JBossServer class
Deleted unused files that broke build.
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/IJBossServerLaunchDefaults.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/IJBossServerLaunchDefaults.java 2007-09-07 14:46:02 UTC (rev 3491)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/IJBossServerLaunchDefaults.java 2007-09-07 15:18:57 UTC (rev 3492)
@@ -1,45 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.launch;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-
-/**
- * Setting launch defaults. Each server can have it's own implementation
- * @author <a href="rob.stryker(a)redhat.com">Rob Stryker</a>
- *
- */
-public interface IJBossServerLaunchDefaults {
- public String getStartArgs();
- public String getStopArgs();
- public String getVMArgs();
- public List getRuntimeClasspath(String action);
- public String getStartJar();
- public String getShutdownJar();
- public String getStartMainType();
- public String getStopMainType();
-
- public void fillDefaults(ILaunchConfigurationWorkingCopy wc) throws CoreException;
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/ServerLaunchDefaults.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/ServerLaunchDefaults.java 2007-09-07 14:46:02 UTC (rev 3491)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/launch/ServerLaunchDefaults.java 2007-09-07 15:18:57 UTC (rev 3492)
@@ -1,293 +0,0 @@
-/**
- * JBoss, a Division of Red Hat
- * Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.ide.eclipse.as.core.launch;
-
-import java.io.File;
-import java.io.FilenameFilter;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.IVMInstall;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-
-/**
- * A class of launch defaults including how to start, stop, and twiddle a
- * server.
- *
- * @author <a href="rob.stryker(a)redhat.com">Rob Stryker</a>
- *
- */
-public class ServerLaunchDefaults implements IJBossServerLaunchDefaults {
-
- public void fillDefaults(ILaunchConfigurationWorkingCopy wc)
- throws CoreException {
- // TODO Auto-generated method stub
-
- }
-
- public List getRuntimeClasspath(String action) {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getShutdownJar() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getStartArgs() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getStartJar() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getStartMainType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getStopArgs() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getStopMainType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- public String getVMArgs() {
- // TODO Auto-generated method stub
- return null;
- }
-
-// /*
-// * Can be overwritten by subclasses
-// */
-// protected String startMainType = "org.jboss.Main";
-// protected String defaultShutdownArgs = "-S";
-// protected String runJar = "bin" + File.separator + "run.jar";
-// protected IServer server;
-// protected IJBossServerRuntime runtime;
-// protected JBossServer jbServer;
-//
-// public ServerLaunchDefaults(IServer server) {
-// this.server = server;
-// }
-//
-// protected JBossServer getJBServer() {
-// if (jbServer == null) {
-// try {
-// jbServer = (JBossServer) server.loadAdapter(JBossServer.class,
-// new NullProgressMonitor());
-// } catch (Exception e) {
-// }
-// }
-// return jbServer;
-// }
-//
-// protected IJBossServerRuntime getRuntime() {
-// if (runtime == null) {
-// try {
-// runtime = (IJBossServerRuntime) server.getRuntime()
-// .loadAdapter(IJBossServerRuntime.class,
-// new NullProgressMonitor());
-// } catch (Exception e) {
-// }
-// }
-// return runtime;
-// }
-//
-// public void fillDefaults(ILaunchConfigurationWorkingCopy workingCopy)
-// throws CoreException {
-// IJBossServerRuntime runtime = getRuntime();
-// String argsKey = IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS;
-// String vmArgsKey = IJavaLaunchConfigurationConstants.ATTR_VM_ARGUMENTS;
-//
-// String START_SUFFIX = JBossServerStartupLaunchConfiguration.PRGM_ARGS_START_SUFFIX;
-// String STOP_SUFFIX = JBossServerStartupLaunchConfiguration.PRGM_ARGS_STOP_SUFFIX;
-//
-// // START items
-// workingCopy.setAttribute(argsKey + START_SUFFIX, getStartArgs());
-// workingCopy.setAttribute(vmArgsKey + START_SUFFIX, getVMArgs());
-//
-// // STOP items
-// workingCopy.setAttribute(argsKey + STOP_SUFFIX, getStopArgs());
-// workingCopy.setAttribute(vmArgsKey + STOP_SUFFIX, getVMArgs());
-//
-// /* Now add in the main types */
-// String mainKey = IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME;
-// workingCopy.setAttribute(mainKey + START_SUFFIX, getStartMainType());
-// workingCopy.setAttribute(mainKey + STOP_SUFFIX, getStopMainType());
-//
-// String wdKey = IJavaLaunchConfigurationConstants.ATTR_WORKING_DIRECTORY;
-// String wdVal = getServerHome() + Path.SEPARATOR + "bin";
-// workingCopy.setAttribute(wdKey + START_SUFFIX, wdVal);
-// workingCopy.setAttribute(wdKey + STOP_SUFFIX, wdVal);
-//
-// workingCopy
-// .setAttribute(
-// IJavaLaunchConfigurationConstants.ATTR_DEFAULT_CLASSPATH,
-// false);
-// String cpKey = IJavaLaunchConfigurationConstants.ATTR_CLASSPATH;
-// workingCopy.setAttribute(cpKey + START_SUFFIX,
-// getRuntimeClasspath(JBossServerStartupLaunchConfiguration.START));
-// workingCopy.setAttribute(cpKey + STOP_SUFFIX,
-// getRuntimeClasspath(JBossServerStartupLaunchConfiguration.STOP));
-// }
-//
-// public String getStartArgs() {
-// IJBossServerRuntime rt = getRuntime();
-// if (rt != null) {
-// return "--configuration=" + rt.getJBossConfiguration();
-// }
-// return "";
-// }
-//
-// public String getServerHome() {
-// return server.getRuntime().getLocation().toOSString();
-// }
-//
-// public String getConfigurationPath() {
-// try {
-// return getServerHome() + Path.SEPARATOR + "server" + Path.SEPARATOR
-// + getRuntime().getJBossConfiguration();
-// } catch (Exception e) {
-// }
-// return "";
-// }
-//
-// public String getStartJar() {
-// return getServerHome() + Path.SEPARATOR + runJar;
-// }
-//
-// public String getShutdownJar() {
-// return getServerHome() + Path.SEPARATOR + shutdownJar;
-// }
-//
-// public String getStartMainType() {
-// return startMainType;
-// }
-//
-// public String getStopMainType() {
-// return stopMainType;
-// }
-//
-// public String getStopArgs() {
-// return defaultShutdownArgs;
-// }
-//
-// public String getVMArgs() {
-// return defaultVMArgs;
-// }
-//
-// public List getRuntimeClasspath(String action) {
-// String serverHome = getServerHome();
-// ArrayList classpath = new ArrayList();
-//
-// if (action.equals(JBossServerStartupLaunchConfiguration.START)) {
-// classpath.add(JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(
-// getStartJar())));
-// } else if (action.equals(JBossServerStartupLaunchConfiguration.STOP)) {
-// classpath.add(JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(
-// getShutdownJar())));
-// }
-// ArrayList runtimeClassPaths = convertClasspath(classpath, runtime
-// .getVM());
-// return runtimeClassPaths;
-// }
-//
-// private ArrayList convertClasspath(ArrayList cp, IVMInstall vmInstall) {
-// if (vmInstall != null) {
-// try {
-// cp
-// .add(JavaRuntime
-// .newRuntimeContainerClasspathEntry(
-// new Path(JavaRuntime.JRE_CONTAINER)
-// .append(
-// "org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType")
-// .append(vmInstall.getName()),
-// IRuntimeClasspathEntry.BOOTSTRAP_CLASSES));
-// } catch (Exception e) {
-// // ignore
-// }
-//
-// IPath jrePath = new Path(vmInstall.getInstallLocation()
-// .getAbsolutePath());
-// if (jrePath != null) {
-// IPath toolsPath = jrePath.append("lib").append("tools.jar");
-// if (toolsPath.toFile().exists()) {
-// cp.add(JavaRuntime
-// .newArchiveRuntimeClasspathEntry(toolsPath));
-// }
-// }
-// }
-//
-// Iterator cpi = cp.iterator();
-// ArrayList list = new ArrayList();
-// while (cpi.hasNext()) {
-// IRuntimeClasspathEntry entry = (IRuntimeClasspathEntry) cpi.next();
-// try {
-// list.add(entry.getMemento());
-// } catch (Exception e) {
-// // Trace.trace(Trace.SEVERE, "Could not resolve classpath entry:
-// // " + entry, e);
-// }
-// }
-//
-// return list;
-// }
-//
-// private void addDirectory(String serverHome, ArrayList classpath,
-// String dirName) {
-// String libPath = serverHome + File.separator + dirName;
-// File libDir = new File(libPath);
-// File libs[] = libDir.listFiles(new FilenameFilter() {
-// public boolean accept(File dir, String name) {
-// return (name != null && name.endsWith("jar"));
-// }
-// });
-//
-// if (libs == null)
-// return;
-//
-// for (int i = 0; i < libs.length; i++) {
-// classpath.add(JavaRuntime.newArchiveRuntimeClasspathEntry(new Path(
-// libPath + File.separator + libs[i].getName())));
-// }
-// } // end method
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java 2007-09-07 14:46:02 UTC (rev 3491)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/JBossServer.java 2007-09-07 15:18:57 UTC (rev 3492)
@@ -34,7 +34,6 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jst.server.core.IWebModule;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IRuntime;
@@ -44,9 +43,6 @@
import org.eclipse.wst.server.core.model.IURLProvider;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.launch.IJBossServerLaunchDefaults;
-import org.jboss.ide.eclipse.as.core.launch.JBossServerStartupLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.launch.ServerLaunchDefaults;
import org.jboss.ide.eclipse.as.core.model.descriptor.XPathModel;
import org.jboss.ide.eclipse.as.core.model.descriptor.XPathQuery;
import org.jboss.ide.eclipse.as.core.runtime.IJBossServerRuntime;
17 years, 4 months
JBoss Tools SVN: r3491 - in branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources: scrollableDataTable and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-09-07 10:46:02 -0400 (Fri, 07 Sep 2007)
New Revision: 3491
Added:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/scrollableDataTable/
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/scrollableDataTable/scrollableDataTable.css
Log:
http://jira.jboss.com/jira/browse/JBIDE-847 Add RichFaces scrollableDataTable template resources
Added: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/scrollableDataTable/scrollableDataTable.css
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/scrollableDataTable/scrollableDataTable.css (rev 0)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/resources/scrollableDataTable/scrollableDataTable.css 2007-09-07 14:46:02 UTC (rev 3491)
@@ -0,0 +1,117 @@
+.dr-table {
+ border-top: 1px solid;
+ border-left: 1px solid;
+ border-color: #C4C0B9;
+}
+
+.dr-table-cell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-subtable-cell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-header {
+ background-color: #D4CFC7;
+ background-position: top left;
+ background-repeat: repeat-x;
+}
+
+.dr-table-header-continue {
+ background-color: #D4CFC7;
+}
+
+.dr-table-headercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ color: #000000;
+ text-align: center;
+ font-weight: bold;
+ font-size: 11px;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-subheader {
+ background-color: #F1EEE9;
+}
+
+.dr-table-subheadercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: center;
+ font-size: 11px;
+ font-color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-footercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ color: #000000;
+ text-align: left;
+ font-weight: bold;
+ font-size: 11px;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-table-subfootercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: left;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-subtable-header {
+ background-color: #F1EEE9;
+}
+
+.dr-subtable-headercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: center;
+ font-size: 11px;
+ color: #000000;
+ font-family: Arial, Verdana, sans-serif;
+}
+
+.dr-subtable-footercell {
+ border-right: 1px solid;
+ border-bottom: 1px solid;
+ border-color: #C4C0B9;
+ padding: 4px 4px 4px 4px;
+ text-align: left;
+}
+
+.dr-spr {
+ display: block;
+}
+
+.dr-table-scroll {
+ overflow: scroll;
+ border: solid 1px #C4C0C9;
+}
\ No newline at end of file
17 years, 4 months
JBoss Tools SVN: r3490 - in branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces: src/org/jboss/tools/jsf/vpe/richfaces/template and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: dsakovich
Date: 2007-09-07 10:35:08 -0400 (Fri, 07 Sep 2007)
New Revision: 3490
Added:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesTemplate.java
Modified:
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
Log:
http://jira.jboss.com/jira/browse/JBIDE-847 Add RichFaces scrollableDataTable template
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2007-09-07 14:17:51 UTC (rev 3489)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/HtmlComponentUtil.java 2007-09-07 14:35:08 UTC (rev 3490)
@@ -23,6 +23,18 @@
/** HTML TAG BR */
public static final String HTML_TAG_BR = "br";
+
+ /** HTML TAG COLGROUP */
+ public static final String HTML_TAG_COLGROUP = "colgroup";
+
+ /** HTML TAG THEAD */
+ public static final String HTML_TAG_THEAD = "thead";
+
+ /** HTML TAG TFOOT */
+ public static final String HTML_TAG_TFOOT = "tfoot";
+
+ /** HTML TAG CAPTION */
+ public static final String HTML_TAG_CAPTION = "caption";
/** HTML TAG DT */
public static final String HTML_TAG_DT = "dt";
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2007-09-07 14:17:51 UTC (rev 3489)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesCalendarTemplate.java 2007-09-07 14:35:08 UTC (rev 3490)
@@ -283,7 +283,7 @@
days = 29;
}
- int start = day - (dayN % NUM_DAYS_IN_WEEK + 1);
+ int start = day - (dayN % NUM_DAYS_IN_WEEK + cal.getFirstDayOfWeek() - 1);
if (start < 0)
start += NUM_DAYS_IN_WEEK;
int weeks = (start + days) / NUM_DAYS_IN_WEEK;
Added: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java (rev 0)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesScrollableDataTableTemplate.java 2007-09-07 14:35:08 UTC (rev 3490)
@@ -0,0 +1,565 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.tools.jsf.vpe.richfaces.ComponentUtil;
+import org.jboss.tools.jsf.vpe.richfaces.HtmlComponentUtil;
+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.mozilla.interfaces.nsIDOMDocument;
+import org.mozilla.interfaces.nsIDOMElement;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Displays template for scrollableDataTable
+ *
+ * @author dsakovich(a)exadel.com
+ *
+ */
+public class RichFacesScrollableDataTableTemplate extends VpeAbstractTemplate {
+
+ final static String DEFAULT_HEIGHT = "500px";
+ final static String DEFAULT_WIDTH = "700px";
+ final static String HEADER = "header";
+ final static String HEADER_CLASS = "headerClass";
+ final static String FOOTER = "footer";
+ final static String FOOTER_CLASS = "footerClass";
+ final static String CAPTION_CLASS = "captionClass";
+ final static String CAPTION_STYLE = "captionStyle";
+ final static String SPACE = " ";
+
+ /**
+ * Creates a node of the visual tree on the node of the source tree. This
+ * visual node should not have the parent node This visual node can have
+ * child nodes.
+ *
+ * @param pageContext
+ * Contains the information on edited page.
+ * @param sourceNode
+ * The current node of the source tree.
+ * @param visualDocument
+ * The document of the visual tree.
+ * @return The information on the created node of the visual tree.
+ */
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+
+ Element sourceElement = (Element) sourceNode;
+
+ String width = sourceElement
+ .getAttribute(HtmlComponentUtil.HTML_WIDTH_ATTR);
+ String height = sourceElement
+ .getAttribute(HtmlComponentUtil.HTML_HEIGHT_ATTR);
+
+ nsIDOMElement div = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_DIV);
+
+ String divStyle = HtmlComponentUtil.HTML_WIDTH_ATTR + " : "
+ + (width == null ? DEFAULT_WIDTH : width) + ";"
+ + HtmlComponentUtil.HTML_HEIGHT_ATTR + " : "
+ + (height == null ? DEFAULT_HEIGHT : height) + ";";
+ div.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, divStyle);
+ div.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, "dr-table-scroll");
+ nsIDOMElement table = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TABLE);
+ ComponentUtil.copyAttributes(sourceNode, table);
+ div.appendChild(table);
+
+ VpeCreationData creationData = new VpeCreationData(div);
+
+ ComponentUtil.setCSSLink(pageContext,
+ "scrollableDataTable/scrollableDataTable.css",
+ "richFacesDataTable");
+ String tableClass = sourceElement
+ .getAttribute(HtmlComponentUtil.HTML_STYLECLASS_ATTR);
+ table
+ .setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-table rich-table "
+ + (tableClass == null ? "" : tableClass));
+
+ // Encode colgroup definition.
+ ArrayList<Element> columns = getColumns(sourceElement);
+ int columnsLength = getColumnsCount(sourceElement, columns);
+ nsIDOMElement colgroup = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_COLGROUP);
+ colgroup.setAttribute(HtmlComponentUtil.HTML_TAG_SPAN, String
+ .valueOf(columnsLength));
+ table.appendChild(colgroup);
+
+ // Encode Caption
+ encodeCaption(creationData, sourceElement, visualDocument, table);
+
+ // Encode Header
+ Element header = ComponentUtil.getFacet(sourceElement, HEADER);
+ ArrayList<Element> columnsHeaders = getColumnsWithFacet(columns, HEADER);
+ if (header != null || !columnsHeaders.isEmpty()) {
+ nsIDOMElement thead = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_THEAD);
+ table.appendChild(thead);
+ String headerClass = (String) sourceElement
+ .getAttribute(HEADER_CLASS);
+ if (header != null) {
+ encodeTableHeaderOrFooterFacet(creationData, thead,
+ columnsLength, visualDocument, header,
+ "dr-table-header rich-table-header",
+ "dr-table-header-continue rich-table-header-continue",
+ "dr-table-headercell rich-table-headercell",
+ headerClass, HtmlComponentUtil.HTML_TAG_TD);
+ }
+ if (!columnsHeaders.isEmpty()) {
+ nsIDOMElement tr = visualDocument.createElement("tr");
+ thead.appendChild(tr);
+ String styleClass = encodeStyleClass(null,
+ "dr-table-subheader rich-table-subheader", null,
+ headerClass);
+ if (styleClass != null) {
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ styleClass);
+ }
+ encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
+ columnsHeaders,
+ "dr-table-subheadercell rich-table-subheadercell",
+ headerClass, HEADER, HtmlComponentUtil.HTML_TAG_TD);
+ }
+ }
+
+ // Encode Footer
+ Element footer = ComponentUtil.getFacet(sourceElement, FOOTER);
+ ArrayList<Element> columnsFooters = getColumnsWithFacet(columns, FOOTER);
+ if (footer != null || !columnsFooters.isEmpty()) {
+ nsIDOMElement tfoot = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TFOOT);
+ table.appendChild(tfoot);
+ String footerClass = (String) sourceElement
+ .getAttribute(FOOTER_CLASS);
+ if (!columnsFooters.isEmpty()) {
+ nsIDOMElement tr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ tfoot.appendChild(tr);
+ String styleClass = encodeStyleClass(null,
+ "dr-table-subfooter rich-table-subfooter", null,
+ footerClass);
+ if (styleClass != null) {
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ styleClass);
+ }
+ encodeHeaderOrFooterFacets(creationData, tr, visualDocument,
+ columnsFooters,
+ "dr-table-subfootercell rich-table-subfootercell",
+ footerClass, FOOTER, HtmlComponentUtil.HTML_TAG_TD);
+ }
+ if (footer != null) {
+ encodeTableHeaderOrFooterFacet(creationData, tfoot,
+ columnsLength, visualDocument, footer,
+ "dr-table-footer rich-table-footer",
+ "dr-table-footer-continue rich-table-footer-continue",
+ "dr-table-footercell rich-table-footercell",
+ footerClass, HtmlComponentUtil.HTML_TAG_TD);
+ }
+ }
+
+ nsIDOMElement tbody = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TBODY);
+ table.appendChild(tbody);
+
+ // Create mapping to Encode body
+ List<Node> children = ComponentUtil.getChildren(sourceElement);
+ boolean firstRow = true;
+ nsIDOMElement tr = null;
+ VpeChildrenInfo trInfo = null;
+ for (Node child : children) {
+ if (child.getNodeName().endsWith(":column")) {
+ String breakBefore = ((Element) child)
+ .getAttribute("breakBefore");
+ if (breakBefore != null && breakBefore.equalsIgnoreCase("true")) {
+ tr = null;
+ }
+ if (tr == null) {
+ tr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ if (firstRow) {
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-table-firstrow rich-table-firstrow");
+ firstRow = false;
+ } else {
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ "dr-table-row rich-table-row");
+ }
+ trInfo = new VpeChildrenInfo(tr);
+ tbody.appendChild(tr);
+ creationData.addChildrenInfo(trInfo);
+ }
+ trInfo.addSourceChild(child);
+ } else if (child.getNodeName().endsWith(":columnGroup")) {
+ RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(
+ creationData, (Element) child, visualDocument, tbody);
+ tr = null;
+ } else if (child.getNodeName().endsWith(":subTable")) {
+ RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData,
+ (Element) child, visualDocument, tbody);
+ tr = null;
+ } else {
+ VpeChildrenInfo childInfo = new VpeChildrenInfo(tbody);
+ childInfo.addSourceChild(child);
+ creationData.addChildrenInfo(childInfo);
+ tr = null;
+ }
+ }
+
+ return creationData;
+ }
+
+ /**
+ *
+ * @param creationData
+ * @param sourceElement
+ * @param visualDocument
+ * @param table
+ */
+ protected void encodeCaption(VpeCreationData creationData,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMElement table) {
+ // Encode caption
+ Element captionFromFacet = ComponentUtil.getFacet(sourceElement,
+ HtmlComponentUtil.HTML_TAG_CAPTION);
+ if (captionFromFacet != null) {
+ String captionClass = (String) table.getAttribute(CAPTION_CLASS);
+ String captionStyle = (String) table.getAttribute(CAPTION_STYLE);
+
+ nsIDOMElement caption = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_CAPTION);
+ table.appendChild(caption);
+ if (captionClass != null && captionClass.length() > 0) {
+ captionClass = "dr-table-caption rich-table-caption "
+ + captionClass;
+ } else {
+ captionClass = "dr-table-caption rich-table-caption";
+ }
+ caption.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR,
+ captionClass);
+ if (captionStyle != null && captionStyle.length() > 0) {
+ caption.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR,
+ captionStyle);
+ }
+
+ VpeChildrenInfo cap = new VpeChildrenInfo(caption);
+ cap.addSourceChild(captionFromFacet);
+ creationData.addChildrenInfo(cap);
+ }
+
+ }
+
+ /**
+ *
+ * @param creationData
+ * @param parentTr
+ * @param visualDocument
+ * @param headersOrFooters
+ * @param skinCellClass
+ * @param headerClass
+ * @param facetName
+ * @param element
+ */
+ public static void encodeHeaderOrFooterFacets(VpeCreationData creationData,
+ nsIDOMElement parentTr, nsIDOMDocument visualDocument,
+ ArrayList<Element> headersOrFooters, String skinCellClass,
+ String headerClass, String facetName, String element) {
+ for (Element column : headersOrFooters) {
+ String classAttribute = facetName + "Class";
+ String columnHeaderClass = column.getAttribute(classAttribute);
+ nsIDOMElement td = visualDocument.createElement(element);
+ parentTr.appendChild(td);
+ String styleClass = encodeStyleClass(null, skinCellClass,
+ headerClass, columnHeaderClass);
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ td.setAttribute("scop", "col");
+ String colspan = column
+ .getAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN);
+ if (colspan != null && colspan.length() > 0) {
+ td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, colspan);
+ }
+ Element facetBody = ComponentUtil.getFacet(column, facetName);
+
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
+ child.addSourceChild(facetBody);
+ creationData.addChildrenInfo(child);
+ }
+ }
+
+ /**
+ *
+ * @param creationData
+ * @param parentTheadOrTfood
+ * @param columns
+ * @param visualDocument
+ * @param facetBody
+ * @param skinFirstRowClass
+ * @param skinRowClass
+ * @param skinCellClass
+ * @param facetBodyClass
+ * @param element
+ */
+ protected void encodeTableHeaderOrFooterFacet(VpeCreationData creationData,
+ nsIDOMElement parentTheadOrTfood, int columns,
+ nsIDOMDocument visualDocument, Element facetBody,
+ String skinFirstRowClass, String skinRowClass,
+ String skinCellClass, String facetBodyClass, String element) {
+ boolean isColumnGroup = facetBody.getNodeName()
+ .endsWith(":columnGroup");
+ boolean isSubTable = facetBody.getNodeName().endsWith(":subTable");
+ if (isColumnGroup) {
+ RichFacesColumnGroupTemplate.DEFAULT_INSTANCE.encode(creationData,
+ facetBody, visualDocument, parentTheadOrTfood);
+ } else if (isSubTable) {
+ RichFacesSubTableTemplate.DEFAULT_INSTANCE.encode(creationData,
+ facetBody, visualDocument, parentTheadOrTfood);
+ } else {
+ nsIDOMElement tr = visualDocument
+ .createElement(HtmlComponentUtil.HTML_TAG_TR);
+ parentTheadOrTfood.appendChild(tr);
+
+ String styleClass = encodeStyleClass(null, skinFirstRowClass,
+ facetBodyClass, null);
+ if (styleClass != null) {
+ tr.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ }
+ String style = ComponentUtil.getHeaderBackgoundImgStyle();
+ tr.setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+
+ nsIDOMElement td = visualDocument.createElement(element);
+ tr.appendChild(td);
+
+ styleClass = encodeStyleClass(null, skinCellClass, facetBodyClass,
+ null);
+ if (styleClass != null) {
+ td.setAttribute(HtmlComponentUtil.HTML_CLASS_ATTR, styleClass);
+ }
+
+ if (columns > 0) {
+ td.setAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN, String
+ .valueOf(columns));
+ }
+ td.setAttribute("scope", "colgroup");
+
+ VpeChildrenInfo child = new VpeChildrenInfo(td);
+ child.addSourceChild(facetBody);
+ creationData.addChildrenInfo(child);
+ }
+ }
+
+ /**
+ *
+ * @param parentSourceElement
+ * @return list of columns
+ */
+ public static ArrayList<Element> getColumns(Element parentSourceElement) {
+ ArrayList<Element> columns = new ArrayList<Element>();
+ NodeList children = parentSourceElement.getChildNodes();
+ for (int i = 0; i < children.getLength(); i++) {
+ Node child = children.item(i);
+ if ((child instanceof Element)
+ && child.getNodeName().endsWith(":column")) {
+ columns.add((Element) child);
+ }
+ }
+ return columns;
+ }
+
+ /**
+ *
+ * @param columns
+ * @param facetName
+ * @return list of columns with facet
+ */
+ public static ArrayList<Element> getColumnsWithFacet(
+ ArrayList<Element> columns, String facetName) {
+ ArrayList<Element> columnsWithFacet = new ArrayList<Element>();
+ for (Element column : columns) {
+ Element body = ComponentUtil.getFacet(column, facetName);
+ if (body != null) {
+ columnsWithFacet.add(column);
+ }
+ }
+ return columnsWithFacet;
+ }
+
+ /**
+ *
+ * @param parentPredefined
+ * @param predefined
+ * @param parent
+ * @param custom
+ * @return
+ */
+ public static String encodeStyleClass(Object parentPredefined,
+ Object predefined, Object parent, Object custom) {
+ StringBuffer styleClass = new StringBuffer();
+ // Construct predefined classes
+ if (null != parentPredefined) {
+ styleClass.append(parentPredefined).append(SPACE);
+ } else if (null != predefined) {
+ styleClass.append(predefined).append(SPACE);
+ }
+ // Append class from parent component.
+ if (null != parent) {
+ styleClass.append(parent).append(SPACE);
+ }
+ if (null != custom) {
+ styleClass.append(custom);
+ }
+ if (styleClass.length() > 0) {
+ return styleClass.toString();
+ }
+ return null;
+ }
+
+ /**
+ *
+ * @param sourceElement
+ * @param columns
+ * @return
+ */
+ protected int getColumnsCount(Element sourceElement,
+ ArrayList<Element> columns) {
+ int count = 0;
+ // check for exact value in component
+ Integer span = null;
+ try {
+ span = Integer.valueOf(sourceElement.getAttribute("columns"));
+ } catch (Exception e) {
+ // Ignore bad attribute
+ }
+ if (null != span && span.intValue() != Integer.MIN_VALUE) {
+ count = span.intValue();
+ } else {
+ // calculate max html columns count for all columns/rows children.
+ count = calculateRowColumns(sourceElement, columns);
+ }
+ return count;
+ }
+
+ /*
+ * Calculate max number of columns per row. For rows, recursive calculate
+ * max length.
+ */
+ private int calculateRowColumns(Element sourceElement,
+ ArrayList<Element> columns) {
+ int count = 0;
+ int currentLength = 0;
+ for (Element column : columns) {
+ if (ComponentUtil.isRendered(column)) {
+ if (column.getNodeName().endsWith(":columnGroup")) {
+ // Store max calculated value of previsous rows.
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ // Calculate number of columns in row.
+ currentLength = calculateRowColumns(sourceElement,
+ getColumns(column));
+ // Store max calculated value
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ } else if (column.getNodeName().equals(
+ sourceElement.getPrefix() + ":column")) {
+ String breakBeforeStr = column.getAttribute("breakBefore");
+ boolean breakBefore = false;
+ if (breakBeforeStr != null) {
+ try {
+ breakBefore = Boolean.getBoolean(breakBeforeStr);
+ } catch (Exception e) {
+ // Ignore bad attribute
+ }
+ }
+ // For new row, save length of previsous.
+ if (breakBefore) {
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ currentLength = 0;
+ }
+ String colspanStr = column
+ .getAttribute(HtmlComponentUtil.HTML_TABLE_COLSPAN);
+ Integer colspan = null;
+ try {
+ colspan = Integer.valueOf(colspanStr);
+ } catch (Exception e) {
+ // Ignore
+ }
+ // Append colspan of this column
+ if (null != colspan
+ && colspan.intValue() != Integer.MIN_VALUE) {
+ currentLength += colspan.intValue();
+ } else {
+ currentLength++;
+ }
+ } else if (column.getNodeName().endsWith(":column")) {
+ // UIColumn always have colspan == 1.
+ currentLength++;
+ }
+
+ }
+ }
+ if (currentLength > count) {
+ count = currentLength;
+ }
+ return count;
+ }
+
+ @Override
+ public void removeAttribute(VpePageContext pageContext,
+ Element sourceElement, nsIDOMDocument visualDocument,
+ nsIDOMNode visualNode, Object data, String name) {
+ nsIDOMElement visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ visualElement.removeAttribute(name);
+ }
+
+ @Override
+ public void setAttribute(VpePageContext pageContext, Element sourceElement,
+ nsIDOMDocument visualDocument, nsIDOMNode visualNode, Object data,
+ String name, String value) {
+ nsIDOMElement visualElement = (nsIDOMElement) visualNode
+ .queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
+ if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_WIDTH_ATTR)) {
+ String style = visualElement
+ .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ visualElement.removeAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ style += "; " + HtmlComponentUtil.HTML_WIDTH_ATTR + " : " + value
+ + ";";
+ visualElement
+ .setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+
+ }
+
+ if (name.equalsIgnoreCase(HtmlComponentUtil.HTML_HEIGHT_ATTR)) {
+ String style = visualElement
+ .getAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ visualElement.removeAttribute(HtmlComponentUtil.HTML_STYLE_ATTR);
+ style += "; " + HtmlComponentUtil.HTML_HEIGHT_ATTR + " : " + value
+ + ";";
+ visualElement
+ .setAttribute(HtmlComponentUtil.HTML_STYLE_ATTR, style);
+
+ }
+ visualElement.setAttribute(name, value);
+ }
+
+}
\ No newline at end of file
Added: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesTemplate.java
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesTemplate.java (rev 0)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesTreeNodesTemplate.java 2007-09-07 14:35:08 UTC (rev 3490)
@@ -0,0 +1,16 @@
+package org.jboss.tools.jsf.vpe.richfaces.template;
+
+import org.jboss.tools.vpe.editor.context.VpePageContext;
+import org.jboss.tools.vpe.editor.template.VpeAbstractTemplate;
+import org.jboss.tools.vpe.editor.template.VpeCreationData;
+import org.mozilla.interfaces.nsIDOMDocument;
+import org.w3c.dom.Node;
+
+public class RichFacesTreeNodesTemplate extends VpeAbstractTemplate {
+
+ public VpeCreationData create(VpePageContext pageContext, Node sourceNode,
+ nsIDOMDocument visualDocument) {
+ return null;
+ }
+
+}
Modified: branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml
===================================================================
--- branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2007-09-07 14:17:51 UTC (rev 3489)
+++ branches/jbosstools_xulrunner/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/templates/vpe-templates-richfaces.xml 2007-09-07 14:35:08 UTC (rev 3490)
@@ -269,7 +269,48 @@
</vpe:textFormating>
<vpe:pseudoContent defaultText="yes"/>
</vpe:template>
- </vpe:tag>
+ </vpe:tag>
+
+ <vpe:tag name="rich:scrollableDataTable" case-sensitive="yes">
+ <vpe:template children="yes" modify="no" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesScrollableDataTableTemplate">
+ <vpe:resize>
+ <vpe:width width-attr="width" />
+ <vpe:height height-attr="height" />
+ </vpe:resize>
+ <vpe:dnd>
+ <vpe:drag start-enable="yes" />
+ <vpe:drop container="yes">
+ <vpe:container-child tag-name="column"/>
+ </vpe:drop>
+ </vpe:dnd>
+ <vpe:textFormating>
+ <vpe:format type="BlockFormat" addChildren="deny"/>
+ <vpe:format type="UnderlineFormat">
+ <vpe:formatAttribute type="style"/>
+ </vpe:format>
+ <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:textFormating>
+ <vpe:pseudoContent defaultText="yes"/>
+ </vpe:template>
+ </vpe:tag>
+
<vpe:tag name="rich:column" case-sensitive="yes">
<vpe:template children="yes" modify="yes" class="org.jboss.tools.jsf.vpe.richfaces.template.RichFacesColumnTemplate">
17 years, 4 months
JBoss Tools SVN: r3489 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: core/project/facet and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-09-07 10:17:51 -0400 (Fri, 07 Sep 2007)
New Revision: 3489
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
Log:
JBIDE-825 Added method getRuntime() to ISeamProject, and runtime loaded from project preferences.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-09-07 13:54:39 UTC (rev 3488)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-09-07 14:17:51 UTC (rev 3489)
@@ -16,15 +16,24 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
public interface ISeamProject extends ISeamElement {
public static String NATURE_ID = "org.jboss.tools.seam.core.seamnature";
+ public static String RUNTIME_NAME = "seam.runtime.name";
+
/**
* Returns Eclipse project.
*/
public IProject getProject();
+
+ /**
+ * Returns Seam runtime object.
+ * @return
+ */
+ public SeamRuntime getRuntime();
/**
* Returns list of scope objects for all scope types.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-09-07 13:54:39 UTC (rev 3488)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamRuntimeManager.java 2007-09-07 14:17:51 UTC (rev 3489)
@@ -19,6 +19,7 @@
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.SeamPreferenceInitializer;
import org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer;
@@ -140,7 +141,8 @@
* @return
*/
public SeamRuntime getRuntimeForProject(IProject project) {
- return null;
+ ISeamProject seamProject = SeamCorePlugin.getSeamProject(project, false);
+ return (seamProject == null) ? null : seamProject.getRuntime();
}
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-07 13:54:39 UTC (rev 3488)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-09-07 14:17:51 UTC (rev 3489)
@@ -27,10 +27,13 @@
import org.eclipse.core.resources.IProjectDescription;
import org.eclipse.core.resources.IProjectNature;
import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ProjectScope;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
import org.jboss.tools.common.xml.XMLUtilities;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
@@ -48,9 +51,12 @@
import org.jboss.tools.seam.core.event.Change;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
import org.jboss.tools.seam.core.event.SeamProjectChangeEvent;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.lib.ClassPath;
import org.jboss.tools.seam.internal.core.validation.SeamValidationContext;
+import org.osgi.service.prefs.BackingStoreException;
import org.w3c.dom.Element;
/**
@@ -60,6 +66,8 @@
IProject project;
ClassPath classPath = new ClassPath(this);
+ SeamRuntime runtime = null;
+
Set<IPath> sourcePaths = new HashSet<IPath>();
private boolean isStorageResolved = false;
@@ -102,6 +110,10 @@
return project;
}
+ public SeamRuntime getRuntime() {
+ return runtime;
+ }
+
/**
* Returns list of scope objects for all scope types.
* @return
@@ -143,9 +155,27 @@
setSourcePath(project.getFullPath());
resource = project;
classPath.init();
+ loadRuntime();
// load();
}
+ void loadRuntime() {
+ IEclipsePreferences prefs = getSeamPreferences();
+ if(prefs == null) return;
+ String runtimeName = prefs.get(RUNTIME_NAME, null);
+ if(runtimeName != null) {
+ runtime = SeamRuntimeManager.getInstance().findRuntimeByName(runtimeName);
+ } else {
+ runtime = SeamRuntimeManager.getInstance().getDefaultRuntime();
+ storeRuntime();
+ }
+ }
+
+ public IEclipsePreferences getSeamPreferences() {
+ IScopeContext projectScope = new ProjectScope(project);
+ return projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
+ }
+
public void addSeamProject(SeamProject p) {
if(dependsOn.contains(p)) return;
dependsOn.add(p);
@@ -249,6 +279,26 @@
XMLUtilities.serialize(root, file.getAbsolutePath());
}
+ void storeRuntime() {
+ IEclipsePreferences prefs = getSeamPreferences();
+ String runtimeName = prefs.get(RUNTIME_NAME, null);
+ if((runtime == null || runtime.isDefault()) && runtimeName != null) {
+ prefs.remove(RUNTIME_NAME);
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ } else if(runtime != null && !runtime.isDefault() && !runtime.getName().equals(runtimeName)) {
+ prefs.put(RUNTIME_NAME, runtime.getName());
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+
private void storeSourcePaths(Element root) {
Element sourcePathsElement = XMLUtilities.createElement(root, "source-paths");
for (IPath path : sourcePaths) {
17 years, 4 months
JBoss Tools SVN: r3488 - trunk/documentation/qa.
by jbosstools-commits@lists.jboss.org
Author: aklimkovich
Date: 2007-09-07 09:54:39 -0400 (Fri, 07 Sep 2007)
New Revision: 3488
Added:
trunk/documentation/qa/Regression_report.doc
Log:
Added: trunk/documentation/qa/Regression_report.doc
===================================================================
(Binary files differ)
Property changes on: trunk/documentation/qa/Regression_report.doc
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
17 years, 4 months
JBoss Tools SVN: r3487 - trunk/documentation/GettingStartedGuide/docs/resources/styles/en.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-09-07 08:43:25 -0400 (Fri, 07 Sep 2007)
New Revision: 3487
Added:
trunk/documentation/GettingStartedGuide/docs/resources/styles/en/highlight.xsl
Modified:
trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html.xsl
trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html_chunk.xsl
Log:
http://jira.jboss.com/jira/browse/RHDS-149
the code highlighting is fixed
Added: trunk/documentation/GettingStartedGuide/docs/resources/styles/en/highlight.xsl
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/resources/styles/en/highlight.xsl (rev 0)
+++ trunk/documentation/GettingStartedGuide/docs/resources/styles/en/highlight.xsl 2007-09-07 12:43:25 UTC (rev 3487)
@@ -0,0 +1,18 @@
+<!DOCTYPE xsl:stylesheet>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ version="1.0" xmlns="http://www.w3.org/TR/xhtml1/transitional"
+ exclude-result-prefixes="#default">
+
+ <xsl:template match="programlisting[@role='XML']|programlisting[@role='JAVA']|programlisting[@role='XHTML']|programlisting[@role='JSP']">
+ <xsl:variable name="kidz">
+ <xsl:apply-templates></xsl:apply-templates>
+ </xsl:variable>
+ <pre class="{@role}">
+ <xsl:value-of
+ select="javahl:highlight(string($kidz), attribute::role)"
+ xmlns:javahl="java:com.exadel.docbook.colorer.HighLighter"
+ disable-output-escaping="yes"/>
+ </pre>
+ </xsl:template>
+
+</xsl:stylesheet>
Modified: trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html.xsl
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html.xsl 2007-09-07 11:24:41 UTC (rev 3486)
+++ trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html.xsl 2007-09-07 12:43:25 UTC (rev 3487)
@@ -25,6 +25,8 @@
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/docbook.xsl"/>
<xsl:include href="./collapsing-navigation.xsl"></xsl:include>
+<xsl:include href="./highlight.xsl"></xsl:include>
+
<!--###################################################
HTML Settings
Modified: trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html_chunk.xsl
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html_chunk.xsl 2007-09-07 11:24:41 UTC (rev 3486)
+++ trunk/documentation/GettingStartedGuide/docs/resources/styles/en/html_chunk.xsl 2007-09-07 12:43:25 UTC (rev 3487)
@@ -28,6 +28,7 @@
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/html/chunk.xsl"/>
<xsl:include href="./collapsing-navigation.xsl"></xsl:include>
+<xsl:include href="./highlight.xsl"></xsl:include>
<!--###################################################
17 years, 4 months