JBoss Tools SVN: r2342 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: akazakov
Date: 2007-07-06 10:08:17 -0400 (Fri, 06 Jul 2007)
New Revision: 2342
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/build.properties
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/internal/core/SeamComponentDeclaration.java
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/validation/SeamJavaValidator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
Log:
http://jira.jboss.com/jira/browse/EXIN-216 Validation of unique component name
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/build.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/build.properties 2007-07-06 13:52:48 UTC (rev 2341)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/build.properties 2007-07-06 14:08:17 UTC (rev 2342)
@@ -1,5 +1,6 @@
source.seam-core.jar = src/
bin.includes = plugin.xml,\
META-INF/,\
- seam-core.jar
+ seam-core.jar,\
+ plugin.properties
jars.compile.order = seam-core.jar
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-07-06 13:52:48 UTC (rev 2341)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamProject.java 2007-07-06 14:08:17 UTC (rev 2342)
@@ -13,6 +13,7 @@
import java.util.Set;
import org.eclipse.core.resources.IProjectNature;
+import org.eclipse.core.resources.IResource;
import org.jboss.tools.seam.core.event.ISeamProjectChangeListener;
public interface ISeamProject extends IProjectNature {
@@ -36,6 +37,12 @@
public Set<ISeamComponent> getComponentsByScope(ScopeType type);
/**
+ * @param resource of ISeamComponentDeclaration that belongs to component
+ * @return Set of ISeamComponents by resource.
+ */
+ public Set<ISeamComponent> getComponentsByResource(IResource resource);
+
+ /**
* @param className
* @return Set of ISeamComponents by class name.
*/
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2007-07-06 13:52:48 UTC (rev 2341)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamComponentDeclaration.java 2007-07-06 14:08:17 UTC (rev 2342)
@@ -113,7 +113,7 @@
// TODO
ISeamTextSourceReference reference = new ISeamTextSourceReference() {
public int getLength() {
- return 0;
+ return 10;
}
public IResource getResource() {
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-07-06 13:52:48 UTC (rev 2341)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-06 14:08:17 UTC (rev 2342)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
@@ -19,14 +20,15 @@
import java.util.Set;
import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.jboss.tools.seam.core.ISeamComponent;
import org.jboss.tools.seam.core.ISeamComponentDeclaration;
+import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamFactory;
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
-import org.jboss.tools.seam.core.ISeamContextVariable;
import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
import org.jboss.tools.seam.core.ScopeType;
import org.jboss.tools.seam.core.event.Change;
@@ -430,4 +432,20 @@
listeners.remove(listener);
}
-}
+ /* (non-Javadoc)
+ * @see org.jboss.tools.seam.core.ISeamProject#getComponentsByResource(org.eclipse.core.resources.IResource)
+ */
+ public Set<ISeamComponent> getComponentsByResource(IResource resource) {
+ Set<ISeamComponent> result = new HashSet<ISeamComponent>();
+ for (SeamComponent c: allComponents.values()) {
+ for (ISeamComponentDeclaration d: c.getAllDeclarations()) {
+ SeamComponentDeclaration di = (SeamComponentDeclaration)d;
+ if(resource.equals(di.getResource())) {
+ result.add(c);
+ break;
+ }
+ }
+ }
+ return result;
+ }
+}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-06 13:52:48 UTC (rev 2341)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-06 14:08:17 UTC (rev 2342)
@@ -11,6 +11,7 @@
package org.jboss.tools.seam.internal.core.validation;
import java.util.HashMap;
+import java.util.HashSet;
import java.util.Set;
import org.eclipse.core.resources.IFile;
@@ -27,13 +28,15 @@
import org.jboss.tools.seam.core.ISeamJavaComponentDeclaration;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.ISeamTextSourceReference;
-import org.jboss.tools.seam.core.SeamComponentPrecedenceType;
import org.jboss.tools.seam.internal.core.SeamComponentDeclaration;
+/**
+ * Validator for Java files.
+ * @author Alexey Kazakov
+ */
public class SeamJavaValidator extends SeamValidator {
- // TODO
- public static final String NONUNIQUE_COMPONENT_NAME_MESSAGE_ID="";
+ public static final String NONUNIQUE_COMPONENT_NAME_MESSAGE_ID="NONUNIQUE_COMPONENT_NAME_MESSAGE";
public ISchedulingRule getSchedulingRule(IValidationContext helper) {
// TODO
@@ -52,7 +55,10 @@
for (int i = 0; i < uris.length && !reporter.isCancelled(); i++) {
currentFile = root.getFile(new Path(uris[i]));
if (currentFile != null && currentFile.exists()) {
- System.out.println(currentFile);
+ Set<ISeamComponent> components = project.getComponentsByResource(currentFile);
+ for (ISeamComponent component : components) {
+ validateUniqueComponentName(project, component, helper, reporter);
+ }
// TODO
}
}
@@ -69,6 +75,7 @@
private IStatus validateAll(ISeamProject project, IValidationContext helper, IReporter reporter) {
Set<ISeamComponent> components = project.getComponents();
for (ISeamComponent component : components) {
+ validateUniqueComponentName(project, component, helper, reporter);
// TODO
}
return OK_STATUS;
@@ -81,10 +88,8 @@
ISeamJavaComponentDeclaration firstJavaDeclaration = component.getJavaDeclaration();
if(firstJavaDeclaration!=null) {
HashMap<Integer, ISeamJavaComponentDeclaration> usedPrecedences = new HashMap<Integer, ISeamJavaComponentDeclaration>();
+ Set<ISeamJavaComponentDeclaration> markedDeclarations = new HashSet<ISeamJavaComponentDeclaration>();
int firstJavaDeclarationPrecedence = firstJavaDeclaration.getPrecedence();
- if(firstJavaDeclarationPrecedence < 0) {
- firstJavaDeclarationPrecedence = ISeamJavaComponentDeclaration.DEFAULT_PRECEDENCE;
- }
usedPrecedences.put(firstJavaDeclarationPrecedence, firstJavaDeclaration);
Set<ISeamComponentDeclaration> declarations = component.getAllDeclarations();
for (ISeamComponentDeclaration declaration : declarations) {
@@ -92,11 +97,19 @@
// Component class with the same component name. Check precedence.
ISeamJavaComponentDeclaration javaDeclaration = (ISeamJavaComponentDeclaration)declaration;
int javaDeclarationPrecedence = javaDeclaration.getPrecedence();
- ISeamJavaComponentDeclaration usedDeclaration = usedPrecedences.get(javaDeclarationPrecedence);
- if(usedDeclaration==null) {
+ ISeamJavaComponentDeclaration checkedDeclaration = usedPrecedences.get(javaDeclarationPrecedence);
+ if(checkedDeclaration==null) {
usedPrecedences.put(javaDeclarationPrecedence, javaDeclaration);
} else {
// Mark nonunique name.
+ if(!markedDeclarations.contains(checkedDeclaration)) {
+ // Mark first wrong declaration
+ ISeamTextSourceReference target = ((SeamComponentDeclaration)checkedDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
+ addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, target);
+ markedDeclarations.add(checkedDeclaration);
+ }
+ // Mark next wrong declaration
+ markedDeclarations.add(javaDeclaration);
ISeamTextSourceReference target = ((SeamComponentDeclaration)javaDeclaration).getLocationFor(SeamComponentDeclaration.PATH_OF_NAME);
addError(NONUNIQUE_COMPONENT_NAME_MESSAGE_ID, target);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-07-06 13:52:48 UTC (rev 2341)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamValidator.java 2007-07-06 14:08:17 UTC (rev 2342)
@@ -20,14 +20,14 @@
import org.jboss.tools.seam.core.ISeamTextSourceReference;
/**
+ * Basic seam validator.
* @author Alexey Kazakov
- *
*/
public abstract class SeamValidator implements IValidatorJob {
private IValidationContext helper;
private IReporter reporter;
-
+
public IStatus validateInJob(IValidationContext helper, IReporter reporter) throws ValidationException {
this.helper = helper;
this.reporter = reporter;
@@ -42,13 +42,12 @@
validateInJob(helper, reporter);
}
- protected String getBundleName() {
- // TODO
- return "seamvalitation";
+ protected String getBaseName() {
+ return "org.jboss.tools.seam.internal.core.validation.messages";
}
protected void addError(String messageId, String[] messageArguments, ISeamTextSourceReference target) {
- IMessage message = new Message(getBundleName(), IMessage.HIGH_SEVERITY, messageId, messageArguments, target.getResource());
+ IMessage message = new Message(getBaseName(), IMessage.HIGH_SEVERITY, messageId, messageArguments, target.getResource());
message.setLength(target.getLength());
message.setOffset(target.getStartPosition());
reporter.addMessage(this, message);
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/messages.properties 2007-07-06 14:08:17 UTC (rev 2342)
@@ -0,0 +1,11 @@
+ /*******************************************************************************
+ * 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
+ ******************************************************************************/
+NONUNIQUE_COMPONENT_NAME_MESSAGE=Component name must be unique if it has the same precedence.
\ No newline at end of file
17 years, 5 months
JBoss Tools SVN: r2341 - in trunk/seam: plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet and 5 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-07-06 09:52:48 -0400 (Fri, 06 Jul 2007)
New Revision: 2341
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
Log:
http://jira.jboss.org/jira/browse/EXIN-221
now project deployed and started under Jboss AS
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-06 13:52:48 UTC (rev 2341)
@@ -50,7 +50,7 @@
</project-facet>
<project-facet-version
facet="jst.seam"
- version="1.2">
+ version="2.0">
<constraint>
<and>
<requires
@@ -61,14 +61,18 @@
facet="jst.jsf"
version="[1.1">
</requires>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
</and>
</constraint>
</project-facet-version>
<action
facet="jst.seam"
- id="jst.seam.1.2.install"
+ id="jst.seam.2.0.install"
type="install"
- version="1.2">
+ version="2.0">
<delegate
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDelegete">
</delegate>
@@ -78,9 +82,9 @@
</action>
<action
facet="jst.seam"
- id="jst.seam.1.2.uninstall"
+ id="jst.seam.2.0.uninstall"
type="uninstall"
- version="1.2">
+ version="2.0">
<delegate
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetUninstallDelegate">
</delegate>
@@ -91,13 +95,27 @@
<supported>
<facet
id="jst.seam"
- version="1.2">
+ version="2.0">
</facet>
<runtime-component
any="true">
</runtime-component>
</supported>
</extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.presets">
+ <static-preset
+ id="preset.jst.seam.v2_0">
+ <label>Seam 2.0 project</label>
+ <facet id="jst.java" version="5.0" />
+ <facet id="jst.web" version="2.4"/>
+ <facet id="jst.jsf" version="1.1" />
+ <facet id="jst.seam" version="2.0"/>
+ <description>
+ Seam 2.0 project
+ </description>
+ </static-preset>
+ </extension>
<extension
point="org.eclipse.wst.validation.validator"
@@ -130,4 +148,4 @@
type="org.eclipse.wst.validation.problemmarker">
</super>
</extension>
-</plugin>
\ No newline at end of file
+</plugin>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-07-06 13:52:48 UTC (rev 2341)
@@ -54,8 +54,8 @@
}
}
- public static void copyFile(File source, File dest, boolean override) {
- copyFileToFolder(source, new File(dest,source.getName()),new FilterSetCollection(),override);
+ public static void copyFileToFolder(File source, File dest, boolean override) {
+ copyFileToFolder(source, dest,new FilterSetCollection(),override);
}
public static void copyFileToFolder(File source, File dest, FilterSetCollection filterSetCollection, boolean override ) {
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java 2007-07-06 13:52:48 UTC (rev 2341)
@@ -27,6 +27,9 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.JavaModel;
+import org.eclipse.jdt.internal.core.JavaProject;
import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
import org.eclipse.wst.common.componentcore.ComponentCore;
import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
@@ -53,10 +56,26 @@
.include("img")
.exclude(".*/.*\\.ftl");
- public static FileSet SEAM_JARS = new FileSet()
- .include("jboss-seam.*\\.jar")
- .exclude("jboss-seam-gen\\.jar");
+ public static FileSet SEAM_THIRD_PARTY_JARS = new FileSet()
+ .include("ajax4jsf.*\\.jar")
+ .include("richfaces.*\\.jar")
+ .include("oscache.*\\.jar")
+ .include("jsf-facelets\\.jar")
+ .include("jboss-seam-.*\\.jar")
+ .exclude("jboss-seam-gen\\.jar")
+ .include("drools-.*\\.jar")
+ .include("janino-.*\\.jar")
+ .include("antlr-.*\\.jar")
+ .include("mvel.*\\.jar")
+ .include("groovy-.*\\.jar");
+ public static FileSet SEAM_JARS = new FileSet()
+ .include("jboss-seam\\.jar")
+ .include("jbpm*\\.jar")
+ .include("jboss-el\\.jar")
+ .include("commons-digester-.*\\.jar")
+ .include("commons-beanutils-.*\\.jar");
+
public static FileSet JAVA_LIBS = new FileSet()
.include(".[^/]*\\.jar")
.include(".[^/]*\\.zip");
@@ -72,6 +91,9 @@
.include("META-INF/persistence-" + PROFILE + "\\.xml" )
.include("import-" + PROFILE + "\\.sql");
+ public static FileSet JBOOS_WAR_RESOURCE_SET2 = new FileSet()
+ .include("WEB-INF/jboss-web\\.xml")
+ .include("META-INF/persistence-" + PROFILE + "\\.xml" );
public static String DROOLS_LIB_SEAM_RELATED_PATH = "drools/lib";
@@ -88,10 +110,12 @@
WebArtifactEdit.getWebArtifactEditForRead(project);
IVirtualComponent com = ComponentCore.createComponent(project);
IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new Path("/"));
+ IVirtualFolder srcRootFolder = com.getRootFolder().getFolder(new Path("/WEB-INF/classes"));
IContainer folder = webRootFolder.getUnderlyingFolder();
File webContentFolder = folder.getLocation().toFile();
-
+ File webInfFolder = new File(webContentFolder,"WEB-INF");
+ File srcFolder = srcRootFolder.getUnderlyingFolder().getLocation().toFile();
model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
String seamHomePath = model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
@@ -99,15 +123,18 @@
File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
- File seamGenViewSource = new File(seamHomePath,"seam-gen/view");
+ File securityDrools = new File(seamGenResFolder,"security.drl");
+ File seamGenHomeFolder = new File(seamHomePath,"seam-gen");
+ File seamGenViewSource = new File(seamGenHomeFolder,"view");
File jdbcDriverFile = new File(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH).toString());
- File hibernateConsoleLaunchFile = new File(seamHomeFolder, "seam-gen/hibernatetools/hibernate-console.launch");
- File hibernateConsolePropsFile = new File(seamHomeFolder, "seam-gen/hibernatetools/hibernate-console.properties");
+ File hibernateConsoleLaunchFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.launch");
+ File hibernateConsolePropsFile = new File(seamGenHomeFolder, "hibernatetools/hibernate-console.properties");
+ File hibernateConsolePref = new File(seamGenHomeFolder, "hibernatetools/.settings/org.hibernate.eclipse.console.prefs");
-
FilterSet jdbcFilterSet = FilterSetFactory.createJdbcFilterSet(model);
FilterSet projectFilterSet = FilterSetFactory.createProjectFilterSet(model);
+ FilterSet filtersFilterSet = FilterSetFactory.createFiltersFilterSet(model);
// ****************************************************************
// Copy view folder from seam-gen installation to WebContent folder
@@ -145,10 +172,15 @@
// TODO add copy for /hibernatetools/seam-gen.reveng.xml
- // *************************************
- // TODO modify existing faces-config.xml
- // *************************************
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(project.getLocation().toFile(),".settings"),
+ new FilterSetCollection(projectFilterSet), true);
+ AntCopyUtils.copyFileToFolder(
+ securityDrools,
+ srcFolder,
+ true);
// ********************************************************************************************
// TODO copy libraries/link libraries (seam jars, seam dependencies jars, drols jars, jdbc jar)
@@ -157,18 +189,51 @@
File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new FileSet(SEAM_JARS).dir(seamHomeFolder)));
copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new FileSet(SEAM_JARS).dir(seamLibFolder)));
- copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new FileSet(SEAM_JARS).dir(droolsLibFolder)));
-
+ copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new FileSet(SEAM_THIRD_PARTY_JARS).dir(droolsLibFolder)));
+ copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new FileSet(SEAM_THIRD_PARTY_JARS).dir(seamHomeFolder)));
+ copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new FileSet(SEAM_THIRD_PARTY_JARS).dir(seamLibFolder)));
+
if(jdbcDriverFile.exists())
- AntCopyUtils.copyFile(jdbcDriverFile, webLibFolder, true);
+ AntCopyUtils.copyFileToFolder(jdbcDriverFile, webLibFolder, true);
// TODO generate db support as seam-gen does
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"),
+ new File(project.getLocation().toFile(),"src/" + model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.', '/')+"/"+"Authenticator.java"),
+ new FilterSetCollection(filtersFilterSet), true);
+ // TODO copy sources to src
+
+
// TODO may be generate RHDS studio feature to show it on projects view
// TODO say JBoss AS adapter what kind of deployment to use
+ // copy war files
+ if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS).equals("war")) {
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenResFolder,"WEB-INF/components-war.xml"),
+ new File(webInfFolder,"components.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ AntCopyUtils.copyFileToFile(
+ new File(seamHomeFolder,"seam-gen/build-scripts/build-war.xml"),
+ new File(project.getLocation().toFile(),"build.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ FileSet web2FileSet = new FileSet(JBOOS_WAR_RESOURCE_SET2).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder, webContentFolder, new FileSetFileFilter(web2FileSet), viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"), srcFolder, true);
+
+ } else {
+ // copy ear files
+ AntCopyUtils.copyFileToFile(
+ new File(seamHomeFolder,"seam-gen/build-scripts/build.xml"),
+ new File(project.getLocation().toFile(),"build.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+ }
- // TODO generate build.xml
project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
}
@@ -176,6 +241,7 @@
public static void copyFiles(File source, File dest, FileFilter filter) {
dest.mkdir();
for (File file:source.listFiles(filter)) {
+ if(file.isDirectory())continue;
try {
FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new FilterSetCollection(),true);
} catch (IOException e) {
@@ -256,6 +322,13 @@
public List<Pattern> getIncluded() {
return Collections.unmodifiableList(include);
}
+
+ /**
+ * @return
+ */
+ public File getDir() {
+ return dir;
+ }
}
public static class FileSetFileFilter implements FileFilter {
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 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/META-INF/MANIFEST.MF 2007-07-06 13:52:48 UTC (rev 2341)
@@ -20,7 +20,12 @@
org.jboss.tools.seam.core,
org.apache.log4j,
org.hibernate.eclipse.console,
- org.eclipse.jst.j2ee
+ org.eclipse.jst.j2ee,
+ org.eclipse.wst.common.emfworkbench.integration,
+ org.eclipse.jem,
+ org.eclipse.jem.util,
+ org.eclipse.emf.ecore,
+ org.eclipse.jst.j2ee.web
Eclipse-LazyStart: true
Export-Package: org.jboss.tools.seam.ui,
org.jboss.tools.seam.ui.internal.project.facet;x-internal:=true,
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-07-06 13:52:48 UTC (rev 2341)
@@ -77,7 +77,7 @@
</extension>
<extension
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
- <wizard-pages action="jst.seam.1.2.install">
+ <wizard-pages action="jst.seam.2.0.install">
<page class="org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage"/>
</wizard-pages>
</extension>
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-06 13:52:48 UTC (rev 2341)
@@ -102,10 +102,10 @@
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
"Session Bean Package Name:","com.mydomain.projectname.session");
IFieldEditor entityBeanPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
- ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
+ ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
"Entity Bean Package Name:","com.mydomain.projectname.entity");
IFieldEditor testsPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
- ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
+ ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
"Session Bean Package Name:","com.mydomain.projectname.test");
/**
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/views/SeamComponentsView.java 2007-07-06 13:52:48 UTC (rev 2341)
@@ -12,16 +12,43 @@
import java.util.ArrayList;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.IToolBarManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.MessageDialog;
+import org.eclipse.jface.viewers.DoubleClickEvent;
+import org.eclipse.jface.viewers.IDoubleClickListener;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredContentProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.jface.viewers.ViewerSorter;
+import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.*;
-import org.eclipse.jface.viewers.*;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.jface.action.*;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.ui.*;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.SWT;
-import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.DrillDownAdapter;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
/**
@@ -275,7 +302,16 @@
private void makeActions() {
action1 = new Action() {
public void run() {
- showMessage("Action 1 executed");
+
+ IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("t9");
+ ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
+ WebArtifactEdit edit =
+ WebArtifactEdit.getWebArtifactEditForRead(project);
+ IVirtualComponent com = ComponentCore.createComponent(project);
+ IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new Path("/WEB-INF/classes"));
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ webRootFolder.getUnderlyingFolders();
+ showMessage(webRootFolder.getUnderlyingFolder().getLocation().toString());
}
};
action1.setText("Action 1");
Modified: trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java
===================================================================
--- trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2007-07-06 12:34:49 UTC (rev 2340)
+++ trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/ScannerTest.java 2007-07-06 13:52:48 UTC (rev 2341)
@@ -30,6 +30,7 @@
import org.jboss.tools.seam.core.SeamCoreBuilder;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.scanner.IFileScanner;
+import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
public class ScannerTest extends TestCase {
TestProjectProvider provider = null;
@@ -70,20 +71,20 @@
IFileScanner scanner = SeamCoreBuilder.getXMLScanner();
assertTrue("Scanner cannot recognise components.xml", scanner.isRelevant(f));
assertTrue("Scanner cannot recognise components.xml content", scanner.isLikelyComponentSource(f));
- ISeamComponentDeclaration[] cs = null;
+ LoadedDeclarations cs = null;
try {
cs = scanner.parse(f);
} catch (Exception e) {
fail("Error in xml scanner:" + e.getMessage());
}
- assertTrue("Components are not found in components.xml", cs != null && cs.length > 0);
+ assertTrue("Components are not found in components.xml", cs != null && cs.getComponents().size() > 0);
- assertTrue("First component name must be " + "myComponent", "myComponent".equals(cs[0].getName()));
+ assertTrue("First component name must be " + "myComponent", "myComponent".equals(cs.getComponents().get(0).getName()));
//After having tested details of xml scanner now let us check
// that it succeeded in build.
- Set<ISeamComponent> components = seamProject.getComponentsByName("myComponent");
+ Set<ISeamComponent> components = seamProject.getComponents();
assertTrue("Seam builder must put myComponent to project.", components.size() == 1);
@@ -121,20 +122,20 @@
IFileScanner scanner = SeamCoreBuilder.getJavaScanner();
assertTrue("Scanner cannot recognise User.java", scanner.isRelevant(f));
assertTrue("Scanner cannot recognise User.java content", scanner.isLikelyComponentSource(f));
- ISeamComponentDeclaration[] cs = null;
+ LoadedDeclarations cs = null;
try {
cs = scanner.parse(f);
} catch (Exception e) {
fail("Error in java scanner:" + e.getMessage());
}
- assertTrue("Components are not found in User.java", cs != null && cs.length > 0);
+ assertTrue("Components are not found in User.java", cs != null && cs.getComponents().size() > 0);
- assertTrue("First component name must be " + "myUser", "myUser".equals(cs[0].getName()));
+ assertTrue("First component name must be " + "myUser", "myUser".equals(cs.getComponents().get(0).getName()));
//After having tested details of java scanner now let us check
//that it succeeded in build.
- Set<ISeamComponent> components = seamProject.getComponentsByName("myUser");
+ Set<ISeamComponent> components = seamProject.getComponents();
assertTrue("Seam builder must put myUser to project.", components.size() == 1);
@@ -162,18 +163,18 @@
IFileScanner scanner = SeamCoreBuilder.getLibraryScanner();
assertTrue("Scanner cannot recognise jboss-seam.jar", scanner.isRelevant(f));
assertTrue("Scanner cannot recognise jboss-seam.jar content", scanner.isLikelyComponentSource(f));
- ISeamComponentDeclaration[] cs = null;
+ LoadedDeclarations cs = null;
try {
cs = scanner.parse(f);
} catch (Exception e) {
fail("Error in library scanner:" + e.getMessage());
}
- assertTrue("Components are not found in jboss-seam.jar", cs != null && cs.length > 0);
+ assertTrue("Components are not found in jboss-seam.jar", cs != null && cs.getComponents().size() > 0);
boolean hasActor = false;
- for (int i = 0; i < cs.length && !hasActor; i++) {
- if("actor".equals(cs[0].getName())) hasActor = true;
+ for (int i = 0; i < cs.getComponents().size() && !hasActor; i++) {
+ if("actor".equals(cs.getComponents().get(0).getName())) hasActor = true;
}
assertTrue("Component " + "actor" + " is not found in jboss-seam.jar", hasActor);
@@ -189,7 +190,7 @@
* After having tested details of library scanner now let us check
* that it succeeded in build.
*/
- Set<ISeamComponent> components = seamProject.getComponentsByName("actor");
+ Set<ISeamComponent> components = seamProject.getComponents();
assertTrue("Seam builder must put actor to project.", components.size()==1);
}
17 years, 5 months
JBoss Tools SVN: r2340 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-06 08:34:49 -0400 (Fri, 06 Jul 2007)
New Revision: 2340
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-373
during italic font editing "->" symbols are changed into ">"
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-06 12:07:13 UTC (rev 2339)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-06 12:34:49 UTC (rev 2340)
@@ -53,7 +53,7 @@
</mediaobject>
</figure>
<itemizedlist continuation="continues">
-<listitem>To create a Seam project, select <emphasis>Seam Gen -> Setup/Configuration -> Setup </emphasis>to
+<listitem>To create a Seam project, select <emphasis>Seam Gen > Setup/Configuration > Setup </emphasis>to
launch the Seam Gen setup window as shown below. Note: </listitem>
</itemizedlist>
<note>
@@ -72,7 +72,7 @@
</imageobject>
</mediaobject>
</figure>
-<para>Fill the items in the dialog as shown below and select the OK button.</para>
+<para>Fill the items in the dialog as shown below and select the <emphasis>OK</emphasis> button.</para>
<table>
<title>Filling Project Items</title>
<tgroup cols="2">
@@ -149,7 +149,7 @@
</imageobject>
</mediaobject>
</figure>
-<para>Right click on the connection -> Reconnect. Just specify "sa" as the user id. The password
+<para>Right click on the connection > Reconnect. Just specify "sa" as the user id. The password
field should be blank.</para>
<para>You should now be able to browse the database and see the meta-data and query data using SQL.
Your meta-data should look like the following:</para>
@@ -168,7 +168,7 @@
<itemizedlist>
<listitem>The next step in our exercise is to generate a full blown application using Seam Gen.
This application will generate CRUD pages and Search pages for all the entities in the database.
-Click on Seam Gen -> Generate Entities. Seam Gen will connect to the database we defined in the
+Click on Seam Gen > Generate Entities. Seam Gen will connect to the database we defined in the
setup part of the application and generate all the required components.</listitem>
<listitem>Since Seam Gen is generating files on the file system that Eclipse does not know
about, right click on the project name on your project and choose the Refresh item. This will let
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-06 12:07:13 UTC (rev 2339)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-06 12:34:49 UTC (rev 2340)
@@ -49,7 +49,7 @@
Those files are very simple and we will review them as we go along with the tutorial. We import
them here to reduce potential typos and other errors in the tutorial.</para>
<orderedlist>
-<listitem>Choose the <emphasis>File -> Import ...</emphasis> menu and then select <emphasis>General -> Existing</emphasis> project into workspace and
+<listitem>Choose the <emphasis>File > Import ...</emphasis> menu and then select <emphasis>General > Existing</emphasis> project into workspace and
click on the Next button.</listitem>
</orderedlist>
<figure>
@@ -90,7 +90,7 @@
</mediaobject>
</figure>
<orderedlist continuation="continues">
-<listitem>Right click on the rules-bpm/build.xml file, and select <emphasis>Run AS ... -> Ant</emphasis> Build.</listitem>
+<listitem>Right click on the rules-bpm/build.xml file, and select <emphasis>Run AS ... > Ant</emphasis> Build.</listitem>
</orderedlist>
<figure>
@@ -120,7 +120,7 @@
<orderedlist>
<listitem>Select the<emphasis> EclipseCon/resources </emphasis>directory. That is where we are going to put the
rules definition file.</listitem>
- <listitem>Select the following menu actions: F<emphasis>ile -> New -> Other ... -> JBoss Rules -> New
+ <listitem>Select the following menu actions: <emphasis>File > New > Other ... > JBoss Rules > New
Rules Resource</emphasis> to bring up the JBoss Rules wizard.</listitem>
</orderedlist>
<figure>
@@ -198,7 +198,7 @@
refunded. Since the business analyst typically designs this process, it is very high level and
can be drawn up in a GUI designer.</para>
<orderedlist>
- <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions <emphasis>File -> New -> File</emphasis>.
+ <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions <emphasis>File > New > File</emphasis>.
Add a new file called process-order.jpdl.xml as shown below:</listitem>
</orderedlist>
<figure>
@@ -220,7 +220,7 @@
</process-definition>
]]></programlisting>
<orderedlist continuation="continues">
-<listitem>Right click on the process-order.jpdl.xml file and select <emphasis>Open with ... -> jBPM
+<listitem>Right click on the process-order.jpdl.xml file and select <emphasis>Open with ... > jBPM
Graphical Process Designer</emphasis>.</listitem>
</orderedlist>
<figure>
@@ -265,7 +265,7 @@
<para>Let's go through the exercise for the "Check Inventory" node first.</para>
<orderedlist>
<listitem>Right click on the "Check Inventory" node in the designer and select <emphasis>Add
- Actions -> Node Enter </emphasis>from the menu as shown below.</listitem>
+ Actions > Node Enter </emphasis>from the menu as shown below.</listitem>
</orderedlist>
<figure>
<title>Node Entering</title>
@@ -276,7 +276,7 @@
</mediaobject>
</figure>
<orderedlist continuation="continues">
-<listitem>In the Outline view tab, open the tree view of process-order -> Check Inventory ->
+<listitem>In the Outline view tab, open the tree view of process-order > Check Inventory >
node enter, and you will see action1. The Outline view may be hidden or on the left side of the
IDE.</listitem>
</orderedlist>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml 2007-07-06 12:07:13 UTC (rev 2339)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml 2007-07-06 12:34:49 UTC (rev 2340)
@@ -454,7 +454,7 @@
<logic:redirect forward="getName"/>
]]></programlisting>
<itemizedlist continuation="continues">
-<listitem><para>To save all the edits to files, select File/Save All from the menu bar.</para></listitem>
+<listitem><para>To save all the edits to files, select <emphasis>File/Save All</emphasis> from the menu bar.</para></listitem>
</itemizedlist>
</section>
</section>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml 2007-07-06 12:07:13 UTC (rev 2339)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml 2007-07-06 12:34:49 UTC (rev 2340)
@@ -163,7 +163,7 @@
<itemizedlist continuation="continues">
<listitem><para>In the ORM Explorer view, reveal the
-<emphasis>ormHibernate3-jsf/JavaSource/hibernate.cfg.xml/demo/User -> user node</emphasis>, right-click it, and select
+<emphasis>ormHibernate3-jsf/JavaSource/hibernate.cfg.xml/demo/User > user node</emphasis>, right-click it, and select
Open Mapping from the context menu.</para></listitem>
<listitem><para>In the editor that opens up for the mapping file, just change the class
attribute for generator to a value of assigned and you're done with this file.</para></listitem>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml 2007-07-06 12:07:13 UTC (rev 2339)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml 2007-07-06 12:34:49 UTC (rev 2340)
@@ -59,7 +59,7 @@
without redeployment. This is extremely important when you play with the code by adding new
features to test how they work. At the same time, Developer Studio allows you to have full control over
the source code. We even recommend turning on the "Use Source Tab as a default for multi-tab
-editors" option in the Preferences Editor (<emphasis>Red Hat->Editors</emphasis> section). You can always use the GUI
+editors" option in the Preferences Editor (<emphasis>Red Hat>Editors</emphasis> section). You can always use the GUI
feature of Developer Studio later to slash the development time when you start to understand enough
how things works on the source code level. The provided example is fully adapted to work with
Red Hat Developer Studio.</para>
@@ -68,7 +68,7 @@
feature for learning.</para>
<para>To start working with the tutorial example, copy the "ticker" folder to a new place on the
disk. If you use Red Hat Developer Studio, copy this folder to the Eclipse workspace folder (or wherever you
-usually keep projects) and then import this project using the <emphasis>Eclipse File->Import</emphasis> menu. Leave
+usually keep projects) and then import this project using the <emphasis>Eclipse File>Import</emphasis> menu. Leave
the server.xml registration option checked on the second screen of wizard. This allows you to
change and then run an application without any special redeployment.</para>
<para>Each ticker folder contains four subfolders:</para>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 12:07:13 UTC (rev 2339)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 12:34:49 UTC (rev 2340)
@@ -55,7 +55,7 @@
<listitem><para>In the Validation Editor, expand the formset node, right-click GetNameForm, and select<emphasis>Add Field...</emphasis> from the context menu.</para></listitem>
<listitem><para>Enter name for Property in the dialog box.</para></listitem>
<listitem><para>In the properties for the name field to the right of the "tree" for the validation.xml file, click on the <emphasis>Change...</emphasis>button next to the Depends entry field.</para></listitem>
-<listitem><para>In the displayed double list, select required from the left list and then click <emphasis>Add-></emphasis>.</para></listitem>
+<listitem><para>In the displayed double list, select required from the left list and then click <emphasis>Add></emphasis>.</para></listitem>
<listitem><para>Click Ok.</para></listitem>
<listitem><para>Right-click name and select<emphasis>Add Arg...</emphasis> from the context menu.</para></listitem>
<listitem><para>In the Add Arg dialog box, click on the <emphasis>Change...</emphasis>button next to the <emphasis>Key</emphasis> field.</para></listitem>
17 years, 5 months
JBoss Tools SVN: r2339 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-06 08:07:13 -0400 (Fri, 06 Jul 2007)
New Revision: 2339
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java
Log:
EXIN-217 Auto-create property added to ISeamAnnotatedFactory.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java 2007-07-06 11:46:13 UTC (rev 2338)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamAnnotatedFactory.java 2007-07-06 12:07:13 UTC (rev 2339)
@@ -15,5 +15,7 @@
* @author Alexey Kazakov
*/
public interface ISeamAnnotatedFactory extends ISeamFactory, ISeamJavaSourceReference {
+
+ boolean isAutoCreate();
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java 2007-07-06 11:46:13 UTC (rev 2338)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamAnnotatedFactory.java 2007-07-06 12:07:13 UTC (rev 2339)
@@ -10,18 +10,22 @@
******************************************************************************/
package org.jboss.tools.seam.internal.core;
+import java.util.List;
+
import org.eclipse.core.resources.IResource;
import org.eclipse.jdt.core.IMember;
import org.eclipse.jdt.core.IMethod;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.seam.core.ISeamAnnotatedFactory;
-import org.jboss.tools.seam.core.ScopeType;
+import org.jboss.tools.seam.core.ISeamXmlComponentDeclaration;
+import org.jboss.tools.seam.core.event.Change;
/**
* @author Viacheslav Kabanovich
*/
public class SeamAnnotatedFactory extends SeamFactory implements ISeamAnnotatedFactory {
IMethod javaSource = null;
+ boolean autoCreate = false;
public IMethod getSourceMethod() {
return javaSource;
@@ -35,6 +39,14 @@
return javaSource;
}
+ public boolean isAutoCreate() {
+ return autoCreate;
+ }
+
+ public void setAutoCreate(boolean autoCreate) {
+ this.autoCreate = autoCreate;
+ }
+
public int getLength() {
if(javaSource == null) return 0;
try {
@@ -61,4 +73,16 @@
}
}
+ public List<Change> merge(SeamFactory f) {
+ List<Change> changes = super.merge(f);
+ SeamAnnotatedFactory af = (SeamAnnotatedFactory)f;
+
+ if(autoCreate != af.autoCreate) {
+ changes = Change.addChange(changes, new Change(this, ISeamXmlComponentDeclaration.AUTO_CREATE, autoCreate, af.autoCreate));
+ autoCreate = af.autoCreate;
+ }
+
+ return changes;
+ }
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-06 11:46:13 UTC (rev 2338)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-06 12:07:13 UTC (rev 2339)
@@ -6,5 +6,13 @@
public static String NAME_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Name";
public static String SCOPE_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Scope";
public static String INSTALL_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Install";
+
+ public static String IN_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "In";
+ public static String OUT_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Out";
+ public static String CREATE_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Create";
+ public static String DESTROY_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Destroy";
+
+ public static String FACTORY_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Factory";
+
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java 2007-07-06 11:46:13 UTC (rev 2338)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java 2007-07-06 12:07:13 UTC (rev 2339)
@@ -17,6 +17,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
@@ -53,7 +54,7 @@
component.setSourcePath(path);
component.setId(type);
component.setClassName(type.getFullyQualifiedName());
- process(cls, component);
+ process(cls, component, ds);
ds.getComponents().add(component);
return ds;
@@ -89,7 +90,7 @@
return map;
}
- private void process(Class<?> cls, SeamJavaComponentDeclaration component) {
+ private void process(Class<?> cls, SeamJavaComponentDeclaration component, LoadedDeclarations ds) {
Map<String, Annotation> map = getSeamAnnotations(cls.getAnnotations());
if(map != null) {
Annotation a = map.get(NAME_ANNOTATION_TYPE);
@@ -110,20 +111,23 @@
}
Method[] ms = cls.getMethods();
for (int i = 0; i < ms.length; i++) {
- map = getSeamAnnotations(ms[i].getAnnotations());
- if(map == null || map.isEmpty()) continue;
-
-
+ process(ms[i], component, ds);
}
}
-
+
+ private void process(Method m, SeamJavaComponentDeclaration component, LoadedDeclarations ds) {
+ Map<String,Annotation> map = getSeamAnnotations(m.getAnnotations());
+ if(map == null || map.isEmpty()) return;
+
+ }
+
private Object getValue(Annotation a, String method) {
try {
Method m = a.annotationType().getMethod(method, new Class[0]);
if(m == null) return null;
return m.invoke(a, new Object[0]);
} catch (Throwable e) {
- e.printStackTrace();
+ SeamCorePlugin.getPluginLog().logError(e);
}
return null;
}
17 years, 5 months
JBoss Tools SVN: r2338 - in trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam: internal/core and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2007-07-06 07:46:13 -0400 (Fri, 06 Jul 2007)
New Revision: 2338
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentPrecedenceType.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
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/scanner/java/ASTVisitorImpl.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
Log:
EXIN-217 Java class scanner is being developed.
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/ISeamJavaComponentDeclaration.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -18,7 +18,7 @@
*/
public interface ISeamJavaComponentDeclaration extends ISeamComponentDeclaration, ISeamJavaSourceReference {
- public static final SeamComponentPrecedenceType DEFAULT_PRECEDENCE = SeamComponentPrecedenceType.APPLICATION;
+ public static final int DEFAULT_PRECEDENCE = SeamComponentPrecedenceType.APPLICATION;
/**
* @return qualified class name
@@ -113,11 +113,11 @@
/**
* @return precedence of component.
*/
- public SeamComponentPrecedenceType getPrecedence();
+ public int getPrecedence();
/**
* Sets precedence of component.
* @param precedence
*/
- public void setPrecedence(SeamComponentPrecedenceType precedence);
+ public void setPrecedence(int precedence);
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentPrecedenceType.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentPrecedenceType.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamComponentPrecedenceType.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -14,10 +14,12 @@
* List of component precedence types
* @author Alexey Kazakov
*/
-public enum SeamComponentPrecedenceType {
- BUILT_IN,
- FRAMEWORK,
- APPLICATION,
- DEPLOYMENT,
- MOCK
+public interface SeamComponentPrecedenceType {
+ int BUILT_IN = 0;
+ int FRAMEWORK = 10;
+ int APPLICATION = 20;
+ int DEPLOYMENT = 30;
+ int MOCK = 40;
+
+ int DEFAULT = APPLICATION;
}
\ No newline at end of file
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamJavaComponentDeclaration.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -23,7 +23,7 @@
protected ScopeType scopeType = ScopeType.UNSPECIFIED;
protected boolean stateful = false;
protected boolean entity = false;
- protected SeamComponentPrecedenceType precedence;
+ protected int precedence = SeamComponentPrecedenceType.DEFAULT;
protected IType type;
@@ -185,17 +185,17 @@
return changes;
}
- /* (non-Javadoc)
+ /**
* @see org.jboss.tools.seam.core.ISeamJavaComponentDeclaration#getPrecedence()
*/
- public SeamComponentPrecedenceType getPrecedence() {
+ public int getPrecedence() {
return precedence;
}
/* (non-Javadoc)
* @see org.jboss.tools.seam.core.ISeamJavaComponentDeclaration#setPrecedence(org.jboss.tools.seam.core.SeamComponentPrecedenceType)
*/
- public void setPrecedence(SeamComponentPrecedenceType precedence) {
+ public void setPrecedence(int precedence) {
this.precedence = precedence;
}
}
\ No newline at end of file
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-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/SeamProject.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -119,6 +119,7 @@
loaded.setSourcePath(source);
String name = loaded.getName();
+
SeamComponent c = getComponent(name);
if(current != null) {
@@ -133,17 +134,18 @@
continue;
}
- if(c == null) {
+ if(c == null && name != null) {
c = newComponent(name);
allComponents.put(name, c);
allVariables.add(c);
addedComponents = Change.addChange(addedComponents, new Change(this, null, null, c));
}
- c.addDeclaration(components[i]);
+ if(c != null) c.addDeclaration(components[i]);
if(loaded instanceof ISeamJavaComponentDeclaration) {
- javaDeclarations.put(c.getClassName(), (SeamJavaComponentDeclaration)components[i]);
- Set<ISeamComponent> cs = getComponentsByClass(c.getClassName());
+ SeamJavaComponentDeclaration jd = (SeamJavaComponentDeclaration)loaded;
+ javaDeclarations.put(jd.getClassName(), jd);
+ Set<ISeamComponent> cs = getComponentsByClass(jd.getClassName());
for (ISeamComponent ci: cs) {
if(ci == c) continue;
SeamComponent cii = (SeamComponent)ci;
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/ASTVisitorImpl.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -37,10 +37,7 @@
*
* @author Viacheslav Kabanovich
*/
-public class ASTVisitorImpl extends ASTVisitor {
- public static String SEAM_ANNOTATION_TYPE_PREFIX = "org.jboss.seam.annotations.";
- public static String NAME_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Name";
- public static String SCOPE_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Scope";
+public class ASTVisitorImpl extends ASTVisitor implements SeamAnnotations {
static int UNDEFINED_CONTEXT = -1;
static int TYPE_CONTEXT = 0;
Added: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java (rev 0)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/java/SeamAnnotations.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -0,0 +1,10 @@
+package org.jboss.tools.seam.internal.core.scanner.java;
+
+public interface SeamAnnotations {
+
+ public static String SEAM_ANNOTATION_TYPE_PREFIX = "org.jboss.seam.annotations.";
+ public static String NAME_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Name";
+ public static String SCOPE_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Scope";
+ public static String INSTALL_ANNOTATION_TYPE = SEAM_ANNOTATION_TYPE_PREFIX + "Install";
+
+}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/ClassScanner.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -11,18 +11,22 @@
package org.jboss.tools.seam.internal.core.scanner.lib;
import java.lang.annotation.Annotation;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
import org.eclipse.core.runtime.IPath;
import org.eclipse.jdt.core.IType;
+import org.jboss.tools.seam.internal.core.SeamJavaComponentDeclaration;
import org.jboss.tools.seam.internal.core.scanner.LoadedDeclarations;
-import org.jboss.tools.seam.internal.core.scanner.java.ASTVisitorImpl;
+import org.jboss.tools.seam.internal.core.scanner.java.SeamAnnotations;
/**
* Loads seam components from Class object.
*
* @author Viacheslav Kabanovich
*/
-public class ClassScanner {
+public class ClassScanner implements SeamAnnotations {
/**
* Checks if class may be a source of seam components.
@@ -45,6 +49,13 @@
if(!isLikelyComponentSource(cls)) return null;
LoadedDeclarations ds = new LoadedDeclarations();
+ SeamJavaComponentDeclaration component = new SeamJavaComponentDeclaration();
+ component.setSourcePath(path);
+ component.setId(type);
+ component.setClassName(type.getFullyQualifiedName());
+ process(cls, component);
+
+ ds.getComponents().add(component);
return ds;
}
@@ -58,11 +69,63 @@
Annotation[] as = cls.getAnnotations();
for (int i = 0; i < as.length; i++) {
Class<?> acls = as[i].annotationType();
- if(acls.getName().startsWith(ASTVisitorImpl.SEAM_ANNOTATION_TYPE_PREFIX)) {
+ if(acls.getName().startsWith(SEAM_ANNOTATION_TYPE_PREFIX)) {
return true;
}
}
return false;
}
+
+ Map<String,Annotation> getSeamAnnotations(Annotation[] as) {
+ if(as == null || as.length == 0) return null;
+ Map<String,Annotation> map = null;
+ for (int i = 0; i < as.length; i++) {
+ Class<?> acls = as[i].annotationType();
+ if(acls.getName().startsWith(SEAM_ANNOTATION_TYPE_PREFIX)) {
+ if(map == null) map = new HashMap<String, Annotation>();
+ map.put(acls.getName(), as[i]);
+ }
+ }
+ return map;
+ }
+
+ private void process(Class<?> cls, SeamJavaComponentDeclaration component) {
+ Map<String, Annotation> map = getSeamAnnotations(cls.getAnnotations());
+ if(map != null) {
+ Annotation a = map.get(NAME_ANNOTATION_TYPE);
+ if(a != null) {
+ String name = (String)getValue(a, "value");
+ if(name != null) component.setName(name);
+ }
+ a = map.get(SCOPE_ANNOTATION_TYPE);
+ if(a != null) {
+ Object scope = getValue(a, "value");
+ if(scope != null) component.setScope(scope.toString());
+ }
+ a = map.get(INSTALL_ANNOTATION_TYPE);
+ if(a != null) {
+ Object precedence = getValue(a, "precedence");
+ if(precedence instanceof Integer) component.setPrecedence((Integer)precedence);
+ }
+ }
+ Method[] ms = cls.getMethods();
+ for (int i = 0; i < ms.length; i++) {
+ map = getSeamAnnotations(ms[i].getAnnotations());
+ if(map == null || map.isEmpty()) continue;
+
+
+ }
+ }
+
+ private Object getValue(Annotation a, String method) {
+ try {
+ Method m = a.annotationType().getMethod(method, new Class[0]);
+ if(m == null) return null;
+ return m.invoke(a, new Object[0]);
+ } catch (Throwable e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/scanner/lib/LibraryScanner.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -17,14 +17,12 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClassFile;
-import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.IJavaElement;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.IPackageFragment;
import org.eclipse.jdt.core.IPackageFragmentRoot;
import org.eclipse.jdt.core.IParent;
import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.ITypeRoot;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.jboss.tools.common.model.XModelObject;
@@ -101,10 +99,7 @@
if(componentsXML != null) {
LoadedDeclarations ds1 = new XMLScanner().parse(componentsXML, path);
- if(ds1 != null) {
- ds.getComponents().addAll(ds1.getComponents());
- ds.getFactories().addAll(ds1.getFactories());
- }
+ if(ds1 != null) ds.add(ds1);
}
if(seamProperties != null) {
XModelObject[] properties = seamProperties.getChildren();
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-06 11:45:21 UTC (rev 2337)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/validation/SeamJavaValidator.java 2007-07-06 11:46:13 UTC (rev 2338)
@@ -80,9 +80,9 @@
private void validateUniqueComponentName(ISeamProject project, ISeamComponent component, IValidationContext helper, IReporter reporter) {
ISeamJavaComponentDeclaration firstJavaDeclaration = component.getJavaDeclaration();
if(firstJavaDeclaration!=null) {
- HashMap<SeamComponentPrecedenceType, ISeamJavaComponentDeclaration> usedPrecedences = new HashMap<SeamComponentPrecedenceType, ISeamJavaComponentDeclaration>();
- SeamComponentPrecedenceType firstJavaDeclarationPrecedence = firstJavaDeclaration.getPrecedence();
- if(firstJavaDeclarationPrecedence==null) {
+ HashMap<Integer, ISeamJavaComponentDeclaration> usedPrecedences = new HashMap<Integer, ISeamJavaComponentDeclaration>();
+ int firstJavaDeclarationPrecedence = firstJavaDeclaration.getPrecedence();
+ if(firstJavaDeclarationPrecedence < 0) {
firstJavaDeclarationPrecedence = ISeamJavaComponentDeclaration.DEFAULT_PRECEDENCE;
}
usedPrecedences.put(firstJavaDeclarationPrecedence, firstJavaDeclaration);
@@ -91,7 +91,7 @@
if(declaration instanceof ISeamJavaComponentDeclaration && declaration!=firstJavaDeclaration) {
// Component class with the same component name. Check precedence.
ISeamJavaComponentDeclaration javaDeclaration = (ISeamJavaComponentDeclaration)declaration;
- SeamComponentPrecedenceType javaDeclarationPrecedence = javaDeclaration.getPrecedence();
+ int javaDeclarationPrecedence = javaDeclaration.getPrecedence();
ISeamJavaComponentDeclaration usedDeclaration = usedPrecedences.get(javaDeclarationPrecedence);
if(usedDeclaration==null) {
usedPrecedences.put(javaDeclarationPrecedence, javaDeclaration);
17 years, 5 months
JBoss Tools SVN: r2337 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-06 07:45:21 -0400 (Fri, 06 Jul 2007)
New Revision: 2337
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-373
during italic font marking incorrect spaces in paths are fixed
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 11:28:48 UTC (rev 2336)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 11:45:21 UTC (rev 2337)
@@ -51,7 +51,7 @@
<listitem><para>Select<emphasis> File/Save </emphasis>All from the menu bar.</para></listitem>
<listitem><para>Select validation.xml under the <emphasis>StrutsHello/Validation</emphasis> node and double-click it to open it with the Red Hat Developer Studio Validation Editor.</para></listitem>
<listitem><para>Select validation.xml under the<emphasis> StrutsHello/Validation</emphasis> node and double-click it to open it with the Red Hat Studio Validation Editor.</para></listitem>
-<listitem><para>Expand the form-beans node under the <emphasis>StrutsHello/Configuration/default/ struts-config.xml node.</emphasis> Then, drag the form bean GetNameForm and drop it onto formset (default) in the Validation Editor.</para></listitem>
+<listitem><para>Expand the form-beans node under the <emphasis>StrutsHello/Configuration/default/struts-config.xml node.</emphasis> Then, drag the form bean GetNameForm and drop it onto formset (default) in the Validation Editor.</para></listitem>
<listitem><para>In the Validation Editor, expand the formset node, right-click GetNameForm, and select<emphasis>Add Field...</emphasis> from the context menu.</para></listitem>
<listitem><para>Enter name for Property in the dialog box.</para></listitem>
<listitem><para>In the properties for the name field to the right of the "tree" for the validation.xml file, click on the <emphasis>Change...</emphasis>button next to the Depends entry field.</para></listitem>
@@ -74,7 +74,7 @@
<para>you don't actually have to do any of the script coding. The Validation Framework handles this.</para>
<para>To see how this works in our application, you'll just need to make a couple of modifications to one of the JSP files.</para>
<itemizedlist continuation="continues">
-<listitem><para>Double-click inputname.jsp under <emphasis>StrutsHello/WEB-ROOT</emphasis> (WebContent)/ pages to open it for editing.</para></listitem>
+<listitem><para>Double-click inputname.jsp under <emphasis>StrutsHello/WEB-ROOT(WebContent)/pages to open it for editing.</para></listitem>
<listitem><para>Find the tag near the top and hit Return to make a new line under it.</para></listitem>
<listitem><para>In the Red Hat Palette view to the right, open the HTML folder and click on the javascript tag.</para></listitem>
<listitem><para>Back in the editor, just in front of the closing slash for this inserted tag, hit Ctrl+Space and select formName from the prompting menu.</para></listitem>
17 years, 5 months
JBoss Tools SVN: r2336 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-06 07:28:48 -0400 (Fri, 06 Jul 2007)
New Revision: 2336
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak
Log:
http://jira.jboss.com/jira/browse/EXIN-373
italic font style
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-06 10:06:18 UTC (rev 2335)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-06 11:28:48 UTC (rev 2336)
@@ -49,7 +49,7 @@
Those files are very simple and we will review them as we go along with the tutorial. We import
them here to reduce potential typos and other errors in the tutorial.</para>
<orderedlist>
-<listitem>Choose the File -> Import ... menu and then select General -> Existing project into workspace and
+<listitem>Choose the <emphasis>File -> Import ...</emphasis> menu and then select <emphasis>General -> Existing</emphasis> project into workspace and
click on the Next button.</listitem>
</orderedlist>
<figure>
@@ -90,7 +90,7 @@
</mediaobject>
</figure>
<orderedlist continuation="continues">
-<listitem>Right click on the rules-bpm/build.xml file, and select Run AS ... -> Ant Build.</listitem>
+<listitem>Right click on the rules-bpm/build.xml file, and select <emphasis>Run AS ... -> Ant</emphasis> Build.</listitem>
</orderedlist>
<figure>
@@ -120,8 +120,8 @@
<orderedlist>
<listitem>Select the<emphasis> EclipseCon/resources </emphasis>directory. That is where we are going to put the
rules definition file.</listitem>
- <listitem>Select the following menu actions: File -> New -> Other ... -> JBoss Rules -> New
- Rules Resource to bring up the JBoss Rules wizard.</listitem>
+ <listitem>Select the following menu actions: F<emphasis>ile -> New -> Other ... -> JBoss Rules -> New
+ Rules Resource</emphasis> to bring up the JBoss Rules wizard.</listitem>
</orderedlist>
<figure>
<title>New Rules File</title>
@@ -181,7 +181,7 @@
]]></programlisting>
<para>Notice that the IDE automatically highlights the syntax and provides auto-completion help.
You may wonder how Seam knows to load the process-order.drl file for the application.</para>
- <para>If you look in the resources/WEB-INF/components.xml file we copied from the imported
+ <para>If you look in the <emphasis>resources/WEB-INF/components.xml</emphasis> file we copied from the imported
rules-bpm project. It has an element pointing to the process-order.drl file.</para>
<programlisting role="XML"><![CDATA[<drools:rule-base name="securityRules">
<drools:rule-files>
@@ -198,7 +198,7 @@
refunded. Since the business analyst typically designs this process, it is very high level and
can be drawn up in a GUI designer.</para>
<orderedlist>
- <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions File -> New -> File.
+ <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions <emphasis>File -> New -> File</emphasis>.
Add a new file called process-order.jpdl.xml as shown below:</listitem>
</orderedlist>
<figure>
@@ -220,8 +220,8 @@
</process-definition>
]]></programlisting>
<orderedlist continuation="continues">
-<listitem>Right click on the process-order.jpdl.xml file and select Open with ... -> jBPM
-Graphical Process Designer.</listitem>
+<listitem>Right click on the process-order.jpdl.xml file and select <emphasis>Open with ... -> jBPM
+Graphical Process Designer</emphasis>.</listitem>
</orderedlist>
<figure>
<title>Opening Graphical Process Designer</title>
@@ -264,8 +264,8 @@
the outcome of each node – hence the next node in the process.</para>
<para>Let's go through the exercise for the "Check Inventory" node first.</para>
<orderedlist>
- <listitem>Right click on the "Check Inventory" node in the designer and select Add
- Actions -> Node Enter from the menu as shown below.</listitem>
+ <listitem>Right click on the "Check Inventory" node in the designer and select <emphasis>Add
+ Actions -> Node Enter </emphasis>from the menu as shown below.</listitem>
</orderedlist>
<figure>
<title>Node Entering</title>
@@ -291,7 +291,7 @@
<orderedlist continuation="continues">
<listitem>Double click on action1 to bring up the wizard. Select Handler on the left and enter
com.mydomain.EclipseCon.process. CheckInventoryAction as the class and bean as the type as shown
- below. You can can also search for the class by clicking on the Browse.. button.</listitem>
+ below. You can can also search for the class by clicking on the <emphasis>Browse...</emphasis> button.</listitem>
</orderedlist>
<figure>
<title>Action Handler</title>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml 2007-07-06 10:06:18 UTC (rev 2335)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml 2007-07-06 11:28:48 UTC (rev 2336)
@@ -213,7 +213,7 @@
box in the editor after "Please enter name:"</para></listitem>
<listitem><para>In the attributes dialog, click in the value field next to the value attribute and click
on the <emphasis>... </emphasis>button</para></listitem>
-<listitem><para>Then, select the Managed Beans/personBean/name node and click on the Ok
+<listitem><para>Then, select the <emphasis>Managed Beans/personBean/name</emphasis> node and click on the Ok
button</para></listitem>
<listitem><para>Back in the attributes dialog, select the Advanced tab, type in name as the value
for the id attribute, and then click on the Finish button</para></listitem>'
@@ -221,7 +221,7 @@
innermost box in the editor after the input box</para></listitem>
<listitem><para>In the attributes dialog, click in the value field next to the action attribute and click
on the <emphasis>... </emphasis>button</para></listitem>
-<listitem><para>Then, select the View Actions/greeting node and click on the Ok button</para></listitem>
+<listitem><para>Then, select the <emphasis>View Actions/greetin</emphasis>g node and click on the Ok button</para></listitem>
<listitem><para>Back in the attributes dialog box, type in Say Hello as the value for the value
attribute ("Say Hello") and then click on the Finish button</para></listitem>
</itemizedlist>
@@ -269,7 +269,7 @@
box in the editor after "Hello"</para></listitem>
<listitem><para>In the attributes dialog, click in value field next to the value attribute and click on
the ... button</para></listitem>
-<listitem><para>Then, select the Managed Beans/personBean/name node, click on the Ok button,
+<listitem><para>Then, select the <emphasis>Managed Beans/personBean/name</emphasis> node, click on the Ok button,
and then click on the Finish button</para></listitem>
<listitem><para>Right after the output field, type an exclamation point (!)</para></listitem>
</itemizedlist>
@@ -319,7 +319,7 @@
<para>Note the .jsf extension for the file name. This is a mapping defined in the web.xml file
for the project for invoking JavaServer Faces when you run the application.</para>
<itemizedlist continuation="continues">
-<listitem><para>Select File/Save from the menu bar.</para></listitem>
+<listitem><para>Select<emphasis> File/Save</emphasis> from the menu bar.</para></listitem>
</itemizedlist>
</section>
<section id="RunningTheApplicationJSF">
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml 2007-07-06 10:06:18 UTC (rev 2335)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml 2007-07-06 11:28:48 UTC (rev 2336)
@@ -25,7 +25,7 @@
</itemizedlist>
<para>The ormHibernate3-jsf project should appear in the Package Explorer with a standard Web application
structure. As we mentioned before, this is a JSF application. To see the JSF configuration file, browse to
- WebContent/WEB-INF/faces-config.xml.</para>
+ <emphasis>WebContent/WEB-INF/faces-config.xml</emphasis>.</para>
<para>In the JavaSource folder, you will find the following Java source files. We will briefly explain these
files and then run the application.</para>
<table>
@@ -163,7 +163,7 @@
<itemizedlist continuation="continues">
<listitem><para>In the ORM Explorer view, reveal the
-ormHibernate3-jsf/JavaSource/hibernate.cfg.xml/demo/User -> user node, right-click it, and select
+<emphasis>ormHibernate3-jsf/JavaSource/hibernate.cfg.xml/demo/User -> user node</emphasis>, right-click it, and select
Open Mapping from the context menu.</para></listitem>
<listitem><para>In the editor that opens up for the mapping file, just change the class
attribute for generator to a value of assigned and you're done with this file.</para></listitem>
@@ -396,7 +396,7 @@
<title>Creating the Database Table</title>
<para>Let's first create the script for our database table in Red Hat Developer Studio.</para>
<itemizedlist continuation="continues">
-<listitem><para>In the ORM Explorer view, right-click on JavaSource/hibernate.cfg.xml and select "Generate DDL Wizard".</para></listitem>
+<listitem><para>In the ORM Explorer view, right-click on <emphasis>JavaSource/hibernate.cfg.xml</emphasis> and select "Generate DDL Wizard".</para></listitem>
<listitem><para>Select HSQL as the Dialect and leave Location as is.</para></listitem>
<listitem><para>Click Finish.</para></listitem>
@@ -409,12 +409,12 @@
<title>Making the Database Available for the Application</title>
<para>The databse server, HSQLDB, is provided with the project. It's located in the ormHibernate3-jsf/hsqldb folder.</para>
<itemizedlist continuation="continues">
-<listitem><para>Start the database server: .../ormHibernate3-jsf/hsqldb/bin/server.bat</para></listitem>
-<listitem><para>In a separate window, start the admin tool: .../ormHibernate3-jsf/hsqldb/bin/dbadmin.bat</para></listitem>
+<listitem><para>Start the database server: <emphasis>.../ormHibernate3-jsf/hsqldb/bin/server.bat</emphasis></para></listitem>
+<listitem><para>In a separate window, start the admin tool: <emphasis>.../ormHibernate3-jsf/hsqldb/bin/dbadmin.bat</emphasis></para></listitem>
</itemizedlist>
<para>This will launch a small GUI application, HSQL Database Manager.</para>
<itemizedlist continuation="continues">
-<listitem><para>Leave all values as they are, only change URL: to the following: jdbc:hsqldb:hsql://localhost</para></listitem>
+<listitem><para>Leave all values as they are, only change URL: to the following: <emphasis>jdbc:hsqldb:hsql://localhost</emphasis></para></listitem>
<listitem><para>Click OK.</para></listitem>
<listitem><para>Select <emphasis> File/Open Script...</emphasis>from the menu bar of HSQL Database Manager.</para></listitem>
<listitem><para>Find and open the the DDL file we just created.</para></listitem>
@@ -424,7 +424,7 @@
<para>The User database should now appear in the expand/collapse tree to the left.</para>
<itemizedlist continuation="continues">
<listitem><para>Select<emphasis> File/Exit </emphasis>from the menu bar.</para></listitem>
-<listitem><para>Stop the database server: .../ormHibernate3-jsf/hsqldb/bin/shutdown.bat</para></listitem>
+<listitem><para>Stop the database server: <emphasis>.../ormHibernate3-jsf/hsqldb/bin/shutdown.bat</emphasis></para></listitem>
</itemizedlist>
</section>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 10:06:18 UTC (rev 2335)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 11:28:48 UTC (rev 2336)
@@ -183,7 +183,7 @@
<listitem><para>In the Edit Properties window, insert the cursor into the value column for the input property and click on the <emphasis>...</emphasis> button.</para></listitem>
-<listitem><para>In the dialog box, make sure the Pages tab is selected, select StrutsHello/WEB-ROOT(WebContent)/pages/inputname.jsp, click the Ok button, and then click on the Close button.</para></listitem>
+<listitem><para>In the dialog box, make sure the Pages tab is selected, select <emphasis>StrutsHello/WEB-ROOT(WebContent)/pages/inputname.jsp</emphasis>, click the Ok button, and then click on the Close button.</para></listitem>
</itemizedlist>
</section>
<section id="EditingTheFormBean">
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak 2007-07-06 10:06:18 UTC (rev 2335)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedWithRHDS.xml.bak 2007-07-06 11:28:48 UTC (rev 2336)
@@ -10,30 +10,6 @@
</keywordset>
</chapterinfo>
<title>Getting Started with Red Hat Developer Studio</title>
- <section id="TechnicalRequirements">
- <?dbhtml filename="TechnicalRequirements.html"?>
-<title>Technical Requirements</title>
- <section id="Java">
- <title>Java</title>
- <para>Before installing Red Hat Developer Studio, make sure you have one of the following versions of Java
- installed:</para>
- <itemizedlist>
- <listitem><para>JDK 1.4.2 or higher</para></listitem>
- </itemizedlist>
- <para>It must be the full JDK, not just the JRE (Java Runtime Environment). For more information about
- target operating environments and compatible Java versions please refer to the JBoss web site. Please note
- that the Eclipse documentation states that you only need a Java Runtime Environment for Eclipse, but to
- use Red Hat Developer Studio requires a full JDK in order to compile Java classes and JSP pages.</para>
- </section>
- <section id="OperatingSystems">
- <?dbhtml filename="OperatingSystems.html"?>
- <title>Operating Systems</title>
- <itemizedlist>
- <listitem><para>Windows</para></listitem>
- <listitem><para>Linux</para></listitem>
- </itemizedlist>
- </section>
- </section>
<section id="Installing">
<?dbhtml filename="Installing.html"?>
<title>Installing</title>
@@ -57,100 +33,46 @@
</mediaobject>
</figure>
- <para>After installation process you will have all required platforms to run Red Hat Developer Studio:</para>
+ <para>Installation process includes all required platforms to run Red Hat Developer Studio:</para>
<itemizedlist>
<listitem>
<para>Eclipse 3.2.2</para>
</listitem>
<listitem>
- <para>JBoss Application Server</para>
+ <para>JBoss J2EE Application Server</para>
+ <figure>
+ <title>JBoss J2EE Application Server installing</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata fileref="images/install2.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <note>The installer will install JBoss J2EE Application Server for running your applications if you select this option during the installation process.
+ If you want to use a different server than ours, you can change the setting in Red Hat Developer Studio.</note>
</listitem>
</itemizedlist>
-
- <para>Red Hat Developer Studio comes with the following plug-ins:</para>
- <itemizedlist>
- <listitem><para>WTP runtime 1.5</para></listitem>
- <listitem><para>GEF runtime 3.2</para></listitem>
- <listitem><para>JEM runtime 1.2</para></listitem>
- <listitem><para>EMF and SDO runtime 2.2</para></listitem>
- <listitem><para>XSD runtime 2.2</para></listitem>
- <listitem>Hibernate-tools-3.1.0 beta5 (without WTP, EMF, GEF, and other non-Hibernate plug-ins from
- Hibernate-tools-3.1.0 beta5)</listitem>
- <listitem><para>QuickImage 0.2.0</para></listitem>
- <listitem><para>Spring IDE 1.3.2</para></listitem>
- <listitem><para>Sun Glassfish 0.3</para></listitem>
- </itemizedlist>
-
</section>
<section id="InstallingthroughTheUpdateSite">
<?dbhtml filename="InstallingthroughTheUpdateSite.html"?>
- <title>Installing through the update Site</title>
+ <title>Installing via update Site</title>
TBD
</section>
</section>
- <section id="RunningForTheFirstTime">
- <?dbhtml filename="RunningForTheFirstTime.html"?>
- <title>Running for the First Time</title>
- <itemizedlist>
- <listitem><para> Launch Eclipse</para></listitem>
- <listitem><para> Select Window/Open Perspective.../Other...</para></listitem>
- <listitem><para> Select Red Hat Developer Studio from the perspective list</para></listitem>
- </itemizedlist>
- <para>We recommend starting Eclipse with VM arguments to make more memory (heap) available for large-scale projects. Open the file <eclipse>\eclipse.ini and set the following:</para>
- <para>eclipse -clean -vmargs -Xms512m -Xmx512m -XX:MaxPermSize=128m</para>
- <para>This setting will allow the Java heap to grow to 512MB.</para>
- </section>
- <section id="Upgrading">
+ <section id="Upgrading">
<?dbhtml filename="Upgrading.html"?>
<title>Upgrading</title>
<para>To upgrade, just uninstall your current version and install the new version.</para>
-
- <itemizedlist>
- <listitem><para> Make sure Eclipse is not running.</para>
-<para>Uninstall your current version of RHDS. You can do one of the following:</para>
-</listitem>
-<listitem><para>Run the Red Hat Developer Studio uninstaller</para></listitem>
- <listitem><para>Delete the file {EclipseHome}/links/com.exadel.studio.link</para>
-<para>Either method will uninstall RHDS.</para>
-</listitem>
-<listitem>Start Eclipse:
- <para>eclipse -clean</para></listitem>
- </itemizedlist>
-
- <itemizedlist>
- <listitem><para>Close Eclipse</para></listitem>
- <listitem><para>Install the new version of Red Hat Developer Studio.</para></listitem>
- <listitem>After installation, start Eclipse with the -clean option:
- <para>eclipse -clean</para></listitem>
- </itemizedlist>
-
- <para>This step is very important as it will clear the Eclipse cache of the old uninstalled plug-in.</para>
- <note>
- <title>Note:</title>
- <para>It is recommended to uninstall Red Hat Developer along with Eclipse and install Red Hat Developer
- Studio into a new clean Eclipse</para>
- </note>
- </section>
+ </section>
<section id="Uninstalling">
<?dbhtml filename="Uninstalling.html"?>
<title>Uninstalling</title>
- <para> Make sure Eclipse is not running.</para>
- <para> Uninstall your current version of Red Hat Developer Studio. You can do one of the following:</para>
- <itemizedlist>
- <listitem><para>Run the Red Hat Developer Studio uninstaller</para></listitem>
- <listitem><para>Delete the file {EclipseHome}/links/com.exadel.studio.link</para>
-<para>Either method will uninstall Red Hat Developer Studio.</para>
-</listitem>
-</itemizedlist>
- <itemizedlist>
- <listitem><para>Start Eclipse with the -clean option:</para>
-<para>eclipse -clean</para>
-</listitem>
-</itemizedlist>
- <para>This step is very important as it will clear the Eclipse cache of the uninstalled plug-in.</para>
+ <para>Make sure Red Hat Developer Studio is not running.</para>
+ <para>Uninstall your current version of Red Hat Developer Studio by running uninstaller.</para>
+
</section>
<section id="Subscription">
<?dbhtml filename="Subscription.html"?>
@@ -162,15 +84,75 @@
<title>Support</title>
<para>If you have comments or questions, you can send them to
<ulink url="mailto:support@exadel.com">support(a)exadel.com</ulink> or
- <ulink url="">Red Hat Developer Studio Forum</ulink>.</para>
+ <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">Red Hat Developer Studio Forum</ulink>.</para>
<para>When writing to support, please include the following information:</para>
<itemizedlist>
- <listitem><para>Eclipse version</para></listitem>
<listitem><para> Red Hat Developer Studio version</para></listitem>
<listitem><para>Exact error message</para></listitem>
<listitem><para>Exact steps you took to get the error</para></listitem>
</itemizedlist>
</section>
+<section id="FAQ">
+ <?dbhtml filename="FAQ.html"?>
+ <title>FAQ</title>
+ <para>For easy reference to Red Hat Developer Studio related questions, our FAQ provides answers to our most "popular" questions.
+ The sections of questions are organized by type. For further support, please contact support(a)exadel.com.</para>
+ <section id="Before_Installing">
+ <title>Before Installing, Tutorials, Examples, Readme Files</title>
+ <para><emphasis role="bold">I'm looking for examples, do you have any?</emphasis></para>
+ <para>Yes, simply go to our tutorials page</para>
+ <para><emphasis role="bold">Where can I find the Red Hat Developer Studio readme file?</emphasis></para>
+ <para>It's at http://www.exadel.com/web/portal/products/ReleaseNotes</para>
+ <para><emphasis role="bold">Where can I find some documentation for Red Hat Developer Studio?</emphasis></para>
+ <para>Try these resources:</para>
+ <para>TBD</para>
+ <para><emphasis role="bold">What version of Eclipse does Red Hat Developer Studio support?</emphasis></para>
+ <para>Red Hat Developer Studio works with Eclipse 3.2.2 </para>
+ </section>
+ <section id="Downloading">
+ <title>Downloading</title>
+ <para><emphasis role="bold">Where can I download a copy of Red Hat Developer Studio?</emphasis></para>
+ <para>Simply go TBD. </para>
+ </section>
+ <section id="Installation_Issues">
+ <title>Installation Issues</title>
+ <para><emphasis role="bold">Do I need to have JBoss server installed to run Red Hat Developer Studio?</emphasis></para>
+ <para>No. Red Hat Developer Studio already comes bundled with JBoss server. We bundle it together so that you don't need to download any
+ additional software and can test your application in a Web browser right away.</para>
+ <para>If you want to use a different JBoss server installation, after installing, simply go to preferences and change the settings to point to another
+ Jboss server installation.</para>
+ <para>Red Hat Developer Stuiod works with any serlvet container, not just JBoss. For more information on deployment, please see the Deploying Your Application section.</para>
+ <para><emphasis role="bold"> What third-party plug-ins are installed with RHDS?</emphasis></para>
+ <para>Read the <link linkend="Installing">Installing</link> section.</para>
+ </section>
+ <section id="Importing_Projects">
+ <title>Importing Projects</title>
+ <para><emphasis role="bold">I have an existing Struts or JSF project. Can I open the project in RHDS?</emphasis></para>
+ <para>Yes. Read the TBD</para>
+ <para><emphasis role="bold">Can I import a .war file?</emphasis></para>
+ <para>Yes. Read the TBD</para>
+ </section>
+ <section id="Troubleshooting">
+ <title>Troubleshooting, Problems, Configuration, Error Messages</title>
+ <para><emphasis role="bold">Is it possible to increase the performance of Eclipse after installing your product? My Eclipse now crawls.</emphasis></para>
+ <para>By default, Eclipse allocates only 128 Mb of memory whatever physical memory you actually have installed. You can significantly increase performance
+ if you allocate more memory. For example:</para>
+ <para>eclipse.exe -vmargs -Xmx512M</para>
+ <para><emphasis role="bold">How can I add my own tag library to the Red Hat Palette?</emphasis></para>
+ <para>See Adding Tag Libraries in JBossJSFTools Guide</para>
+ <para><emphasis role="bold">I see the Oracle ADF Faces component library tags in the Red Hat Palette, but I can't seem to find the libraries for ADF.
+ How do I use this component library with RHDS?</emphasis></para>
+ <para>See Adding Support for the Oracle ADF Components Library in the RHDS User Guide.</para>
+ </section>
+</section>
+
+<section id="OtherRelevantResourcesOnTheTopic33">
+<?dbhtml filename="OtherRelevantResourcesOnTheTopic33.html"?>
+<title>Other relevant resources on the topic</title>
+<para>RHDS on JBoss: <ulink url="http://labs.jboss.com/rhdevstudio/">Red Hat Developer Studio</ulink></para>
+<para>Forum: <ulink url="http://www.jboss.com/index.html?module=bb&op=viewforum&f=258">JBoss Forum</ulink></para>
+<para>Download: <ulink url="http://www.exadel.com/web/portal/download/esp35">RHDS Download</ulink></para>
+</section>
</chapter>
17 years, 5 months
JBoss Tools SVN: r2335 - trunk/documentation/GettingStartedGuide/docs/userguide/en/modules.
by jbosstools-commits@lists.jboss.org
Author: smukhina
Date: 2007-07-06 06:06:18 -0400 (Fri, 06 Jul 2007)
New Revision: 2335
Modified:
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml
trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
Log:
http://jira.jboss.com/jira/browse/EXIN-373
some words and phrases are marked with italic font style
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/AjaxCRUDApplicationWithSeamAndRichFaces.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -53,7 +53,7 @@
</mediaobject>
</figure>
<itemizedlist continuation="continues">
-<listitem>To create a Seam project, select Seam Gen -> Setup/Configuration -> Setup to
+<listitem>To create a Seam project, select <emphasis>Seam Gen -> Setup/Configuration -> Setup </emphasis>to
launch the Seam Gen setup window as shown below. Note: </listitem>
</itemizedlist>
<note>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/BusinessProcessAndRulesApplication.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -118,7 +118,7 @@
is "back order", the rule changes the order status to "refund" automatically to trigger the
business process of refunding.</para>
<orderedlist>
- <listitem>Select the EclipseCon/resources directory. That is where we are going to put the
+ <listitem>Select the<emphasis> EclipseCon/resources </emphasis>directory. That is where we are going to put the
rules definition file.</listitem>
<listitem>Select the following menu actions: File -> New -> Other ... -> JBoss Rules -> New
Rules Resource to bring up the JBoss Rules wizard.</listitem>
@@ -198,7 +198,7 @@
refunded. Since the business analyst typically designs this process, it is very high level and
can be drawn up in a GUI designer.</para>
<orderedlist>
- <listitem>Select the EclipseCon/resources folder and select menu actions File -> New -> File.
+ <listitem>Select the<emphasis> EclipseCon/resources </emphasis>folder and select menu actions File -> New -> File.
Add a new file called process-order.jpdl.xml as shown below:</listitem>
</orderedlist>
<figure>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedForCreatingaJSFApplication.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -22,8 +22,8 @@
JSF application and then run the application from inside Red Hat Developer Studio.
We'll assume that you have already launched Eclipse with Red Hat Developer Studio installed and
also that the Red Hat Developer Studio perspective is the current one. (If not, make it active by
-selecting Window > Open Perspective > Red Hat Developer Studio from the menu bar or by selecting Window/
-Open Perspective/Other... from the menu bar and then selecting Red Hat Developer Studio from
+selecting <emphasis>Window > Open Perspective > Red Hat Developer Studio</emphasis> from the menu bar or by selecting <emphasis>Window/
+Open Perspective/Other...</emphasis> from the menu bar and then selecting Red Hat Developer Studio from
the Select Perspective dialog box.)</para>
</section>
<section id="SettingUpTheProject">
@@ -31,8 +31,8 @@
<title>Setting Up the Project</title>
<para>We are first going to create a new project for the application.</para>
<itemizedlist>
-<listitem><para>Go to the menu bar and select File > New > Project... .</para></listitem>
-<listitem><para>Select Red Hat Developer Studio > JSF > JSF Project in the New Project dialog box.</para></listitem>
+<listitem><para>Go to the menu bar and select <emphasis>File > New > Project...</emphasis> .</para></listitem>
+<listitem><para>Select <emphasis>Red Hat Developer Studio > JSF > JSF Project</emphasis> in the New Project dialog box.</para></listitem>
<listitem><para>Click Next</para></listitem>
<listitem><para>Enter jsfHello as the project name.</para></listitem>
<listitem><para>Leave everything else as is, and click Finish.</para></listitem>
@@ -80,7 +80,7 @@
<?dbhtml filename="AddingTwoViews(JSPPages).html"?>
<title>Adding Two Views (JSP Pages)</title>
<itemizedlist continuation="continues">
-<listitem><para>Right-click anywhere on the diagram and select New View... from the pop-up
+<listitem><para>Right-click anywhere on the diagram and select<emphasis>New View...</emphasis> from the pop-up
menu</para></listitem>
<listitem><para>In the dialog box, type pages/inputname as the value for From-view-id</para></listitem>
<listitem><para>Leave everything else as is</para></listitem>
@@ -88,7 +88,7 @@
<para>If you look in the Package Explorer view you should see a pages folder under WebContent. Opening it
will reveal the JSP file you just created</para>
</listitem>
-<listitem><para>Back on the diagram, right-click anywhere and select New View... from the popup
+<listitem><para>Back on the diagram, right-click anywhere and select<emphasis>New View...</emphasis> from the popup
menu</para></listitem>
<listitem><para>In the dialog box, type pages/greeting as the value for From-view-id</para></listitem>
<listitem><para>Leave everything else as is</para></listitem>
@@ -135,14 +135,14 @@
<para>To store data in the application, we will use a managed bean.</para>
<itemizedlist continuation="continues">
<listitem><para>Click on the Tree tab at the bottom of the editing window</para></listitem>
-<listitem><para>Select the Managed Beans node and then click the Add... button displayed along
+<listitem><para>Select the Managed Beans node and then click the <emphasis>Add...</emphasis> button displayed along
the right side of the editor window</para></listitem>
<listitem><para>Type in jsfHello.PersonBean for Class and personBean for Name. Leave
Scope as is and Generate Source Code as is (checked)</para></listitem>
<listitem><para>Click Finish</para></listitem>
<listitem><para>personBean will now be selected and three sections of information, Managed
Bean, Properties, and Advanced, will be displayed about it. Under the Properties
-section, click the Add... button</para></listitem>
+section, click the <emphasis>Add...</emphasis> button</para></listitem>
<listitem><para>For Property-Name type in name. Leave everything else as is. (When Property-
Class is not filled in, String is the assumed type.)</para></listitem>
<listitem><para>Click Finish</para></listitem>
@@ -212,7 +212,7 @@
<listitem><para>Select inputText within the JSF HTML palette folder and drag it into the innermost
box in the editor after "Please enter name:"</para></listitem>
<listitem><para>In the attributes dialog, click in the value field next to the value attribute and click
-on the ... button</para></listitem>
+on the <emphasis>... </emphasis>button</para></listitem>
<listitem><para>Then, select the Managed Beans/personBean/name node and click on the Ok
button</para></listitem>
<listitem><para>Back in the attributes dialog, select the Advanced tab, type in name as the value
@@ -220,7 +220,7 @@
<listitem><para>Select commandButton within the JSF HTML palette folder and drag it into the
innermost box in the editor after the input box</para></listitem>
<listitem><para>In the attributes dialog, click in the value field next to the action attribute and click
-on the ... button</para></listitem>
+on the <emphasis>... </emphasis>button</para></listitem>
<listitem><para>Then, select the View Actions/greeting node and click on the Ok button</para></listitem>
<listitem><para>Back in the attributes dialog box, type in Say Hello as the value for the value
attribute ("Say Hello") and then click on the Finish button</para></listitem>
@@ -296,14 +296,14 @@
<title>Creating the Start Page</title>
<para>You also need to create a start page as an entry point into the application.</para>
<itemizedlist continuation="continues">
-<listitem><para>In the Package Explorer view to the left, right-click jsfHello/WebContent and select
+<listitem><para>In the Package Explorer view to the left, right-click <emphasis>jsfHello/WebContent</emphasis> and select
New/JSP File</para></listitem>
<listitem><para>For Name type in index, for Template select JSPRedirect and click Finish.</para></listitem>
</itemizedlist>
<para>A JSP editor will open up on the newly created file.</para>
<itemizedlist continuation="continues">
-<listitem><para>In the Source part of the split screen, type /pages/inputname.jsf in between
+<listitem><para>In the Source part of the split screen, type <emphasis>/pages/inputname.jsf</emphasis> in between
the quotes for the page attribute</para></listitem>
</itemizedlist>
<para>The source coding should look like this now:</para>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforCreatingaStrutsApplication.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -16,8 +16,8 @@
<title>Starting Up</title>
<para>We are first going to create a new project for the application.</para>
<itemizedlist>
-<listitem><para>Go to the menu bar and select File/New/Project... .</para></listitem>
-<listitem><para>Select Red Hat Developer Studio/Struts/Struts Project in the New Project dialog box.</para></listitem>
+<listitem><para>Go to the menu bar and select File/New/<emphasis>Project...</emphasis>.</para></listitem>
+<listitem><para><emphasis>Select Red Hat Developer Studio/Struts/Struts Project</emphasis> in the New Project dialog box.</para></listitem>
<listitem><para>Click Next >.</para></listitem>
<listitem><para>Enter StrutsHello as the project name.</para></listitem>
<listitem><para>Leave everything else as is, and click Next >.</para></listitem>
@@ -48,7 +48,7 @@
<title>Creating the Page Placeholders</title>
<itemizedlist continuation="continues">
<listitem><para>Bring the Web Projects view to the front of the Package Explorer view by selecting the Web Projects tab next to that tab.</para></listitem>
-<listitem><para>Right-click the StrutsHello/WEB-ROOT (WebContent) folder in the Web Projects view and select New/Folder... .</para></listitem>
+<listitem><para>Right-click the StrutsHello/WEB-ROOT (WebContent) folder in the Web Projects view and select New/<emphasis>Folder...</emphasis>.</para></listitem>
<listitem><para>Enter pages for a folder name and click Finish.</para></listitem>
<listitem><para>We will keep our presentation files in this folder.</para></listitem>
@@ -162,13 +162,13 @@
<title>Creating a Global Forward</title>
<para>One last component that we need to create in the diagram is a global forward.</para>
<itemizedlist continuation="continues">
-<listitem><para>Somewhere in the top-left corner of diagram, right-click and select Add/Global Forward....</para></listitem>
+<listitem><para>Somewhere in the top-left corner of diagram, right-click and select <emphasis> Add/Global Forward...</emphasis></para></listitem>
<listitem><para>Enter getName in the Name field.</para></listitem>
-<listitem><para>Select the Change... button for Path.</para></listitem>
+<listitem><para>Select the <emphasis>Change...</emphasis>button for Path.</para></listitem>
<listitem><para>In the Edit Path window, switch to the Pages tab.</para></listitem>
-<listitem><para>Expand the StrutsHello/WEB-ROOT (WebContent)/pages node and then select the inputname.jsp page.</para></listitem>
-<listitem><para>Click Ok.</para></listitem>
-<listitem><para>Leave the rest of the fields blank and click Ok.</para></listitem>
+<listitem><para>Expand the <emphasis>StrutsHello/WEB-ROOT (WebContent)/pages</emphasis> node and then select the inputname.jsp page.</para></listitem>
+<listitem><para>Click <emphasis>Ok</emphasis>.</para></listitem>
+<listitem><para>Leave the rest of the fields blank and click <emphasis>Ok</emphasis>.</para></listitem>
</itemizedlist>
<para>A forward object now appears on the diagram and also in the global-forwards folder in the Outline view.</para>
<itemizedlist continuation="continues">
@@ -191,7 +191,7 @@
<listitem><para>Right-click struts-config.xml/form-beans and select Create Form Bean.</para></listitem>
<listitem><para>Enter GetNameForm in the name field and sample.GetNameForm for type.</para></listitem>
<listitem><para>Click Finish.</para></listitem>
-<listitem><para>To save your changes to struts-config.xml, select File/Save from the menu bar.</para></listitem>
+<listitem><para>To save your changes to struts-config.xml, select <emphasis>File/Save</emphasis> from the menu bar.</para></listitem>
</itemizedlist>
<para>Note the disappearance of the asterisk next to the name, struts-config.xml.</para>
</section>
@@ -216,7 +216,7 @@
<itemizedlist continuation="continues">
<listitem><para>Click Finish.</para></listitem>
</itemizedlist>
-<para>The Java files will be generated in a JavaSource/sample folder that you can see in the Package
+<para>The Java files will be generated in a <emphasis>JavaSource/sample</emphasis> folder that you can see in the Package
Explorer view under the StrutsHello node. One Action stub and one FormBean stub will have been generated.</para>
</section>
<section id="CodingtheVariousFiles">
@@ -227,7 +227,7 @@
<section id="JavaStubClasses">
<title>Java Stub Classes</title>
<itemizedlist continuation="continues">
- <listitem><para>To finish the two Java classes, switch to the Package Explorer view and expand the JavaSource/sample folder.</para></listitem>
+ <listitem><para>To finish the two Java classes, switch to the Package Explorer view and expand the <emphasis>JavaSource/sample</emphasis> folder.</para></listitem>
</itemizedlist>
<section id="GetNameForm.java">
<title>GetNameForm.java</title>
@@ -251,7 +251,7 @@
<para>ActionErrors errors = new ActionErrors();</para>
<para>return errors;</para>
<itemizedlist continuation="continues">
-<listitem><para>Right-click and select Source/Generate Getters and Setters... from the context menu.</para></listitem>
+<listitem><para>Right-click and select Source/Generate Getters and <emphasis>Setters...</emphasis>from the context menu.</para></listitem>
<listitem><para>In the dialog box, check the check boxes for name and greetName, select First method for Insertion point, and click on the OK button.</para></listitem>
</itemizedlist>
<para>The final GetNameForm.java file should look like this:</para>
@@ -356,7 +356,7 @@
<para>In this page, the user will enter any name and click the submit button. Then, the greeting action will be called through the form.</para>
<itemizedlist continuation="continues">
<listitem><para>Click on the inputname.jsp tab in the Editing area to bring its editor forward.</para></listitem>
-<listitem><para>In the Web Projects view, expand StrutsHello/Configuration/default/strutsconfig.xml/action-mappings and select /greeting.</para></listitem>
+<listitem><para>In the Web Projects view, expand <emphasis>StrutsHello/Configuration/default/strutsconfig.xml/action-mappings</emphasis> and select <emphasis>/greeting</emphasis>.</para></listitem>
<listitem><para>Drag it and drop it between the quotes for the action attribute to the html:form element in the Source pane of the editor.</para></listitem>
<listitem><para>Then type this text on a new line just below this line:</para></listitem>
@@ -410,7 +410,7 @@
<para>To complete editing of this file, we will use macros from the Red Hat Palette. This palette is a view that should be available to the right of the editing area.</para>
<itemizedlist continuation="continues">
-<listitem><para>Click on the Struts Common folder in the Red Hat Palette to open it.</para></listitem>
+<listitem><para>Click on the <emphasis>Struts Common</emphasis> folder in the Red Hat Palette to open it.</para></listitem>
<listitem><para>Position the cursor at the beginning of the greeting.jsp file in the Source pane and then click on bean taglib in the Red Hat Palette.</para></listitem>
</itemizedlist>
<para>This will insert the following line at the top of the file:</para>
@@ -437,8 +437,8 @@
<title>index.jsp</title>
<para>Finally, we will need to create and edit an index.jsp page. This page will use a Struts forward to simply redirect us to the getName global forward.</para>
<itemizedlist continuation="continues">
-<listitem><para>In the Web Projects view, right-click on StrutsHello/WEB-ROOT(WebContent)</para>
-<para>node and select New/File/JSP... .</para>
+<listitem><para>In the Web Projects view, right-click on <emphasis>StrutsHello/WEB-ROOT(WebContent)</emphasis></para>
+<para>node and select <emphasis>New/File/JSP...</emphasis> .</para>
</listitem>
<listitem><para>Type index for Name and click on the Finish button.</para></listitem>
<listitem><para>On the Red Hat Palette, select the Struts Common folder of macros by clicking on it in the palette.</para></listitem>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJSFwithHibernate.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -18,7 +18,7 @@
<listitem><para>Download: http://webdownload.exadel.com/dirdownloads/ormhib/examples/ormHibernate3-...</para></listitem>
<listitem><para>Unzip this file into your Eclipse workspace folder.</para></listitem>
<listitem><para>Launch Eclipse.</para></listitem>
-<listitem><para>In Eclipse, select File/Import/JSF Project.</para></listitem>
+<listitem><para>In Eclipse, select <emphasis>File/Import/JSF Project</emphasis>.</para></listitem>
<listitem><para>Click Next.</para></listitem>
<listitem><para>Browse to where the project was unzipped.</para></listitem>
<listitem><para>Find the web.xml file inside the WebContent folder in the WEB-INF folder, select it, and Click Finish.</para></listitem>
@@ -99,7 +99,7 @@
capabilities to our project.</para>
<itemizedlist continuation="continues">
<listitem><para>Right-click on ormHibernate3-jsf in the Package Explorer view and select Red Hat</para></listitem>
-<listitem><para>Studio/Add Hibernate Capability... from the context menu.</para></listitem>
+<listitem><para><emphasis> <emphasis>Studio/Add Hibernate Capability...</emphasis></emphasis> from the context menu.</para></listitem>
<listitem><para>Click on Yes in the the dialog box with Add Hibernate Jars selected.</para></listitem>
<listitem><para>In the Configuration Wizard, click twice in the Value field for dialect and select org.hibernate.dialect.HSQLDialect from the pop-up menu.</para></listitem>
<listitem><para>Click Finish</para></listitem>
@@ -416,14 +416,14 @@
<itemizedlist continuation="continues">
<listitem><para>Leave all values as they are, only change URL: to the following: jdbc:hsqldb:hsql://localhost</para></listitem>
<listitem><para>Click OK.</para></listitem>
-<listitem><para>Select File/Open Script... from the menu bar of HSQL Database Manager.</para></listitem>
+<listitem><para>Select <emphasis> File/Open Script...</emphasis>from the menu bar of HSQL Database Manager.</para></listitem>
<listitem><para>Find and open the the DDL file we just created.</para></listitem>
<listitem><para>Click Execute back in the main screen of the Database Manager.</para></listitem>
-<listitem><para>38. Select View/Refresh Tree from the menu bar.</para></listitem>
+<listitem><para>38. Select <emphasis>View/Refresh Tree</emphasis> from the menu bar.</para></listitem>
</itemizedlist>
<para>The User database should now appear in the expand/collapse tree to the left.</para>
<itemizedlist continuation="continues">
-<listitem><para>Select File/Exit from the menu bar.</para></listitem>
+<listitem><para>Select<emphasis> File/Exit </emphasis>from the menu bar.</para></listitem>
<listitem><para>Stop the database server: .../ormHibernate3-jsf/hsqldb/bin/shutdown.bat</para></listitem>
</itemizedlist>
</section>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedGuideforJavaServerFaces.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -59,7 +59,7 @@
without redeployment. This is extremely important when you play with the code by adding new
features to test how they work. At the same time, Developer Studio allows you to have full control over
the source code. We even recommend turning on the "Use Source Tab as a default for multi-tab
-editors" option in the Preferences Editor (Red Hat->Editors section). You can always use the GUI
+editors" option in the Preferences Editor (<emphasis>Red Hat->Editors</emphasis> section). You can always use the GUI
feature of Developer Studio later to slash the development time when you start to understand enough
how things works on the source code level. The provided example is fully adapted to work with
Red Hat Developer Studio.</para>
@@ -68,7 +68,7 @@
feature for learning.</para>
<para>To start working with the tutorial example, copy the "ticker" folder to a new place on the
disk. If you use Red Hat Developer Studio, copy this folder to the Eclipse workspace folder (or wherever you
-usually keep projects) and then import this project using the Eclipse File->Import menu. Leave
+usually keep projects) and then import this project using the <emphasis>Eclipse File->Import</emphasis> menu. Leave
the server.xml registration option checked on the second screen of wizard. This allows you to
change and then run an application without any special redeployment.</para>
<para>Each ticker folder contains four subfolders:</para>
@@ -581,7 +581,7 @@
around it, you can the that the same prefix is added to the value you assigned for id.</para>
<para>We are done with <emphasis role="italic"><property>"id"</property></emphasis> attribute. Now, let's use the <emphasis role="italic"><property>"rendered"</property></emphasis> attribute. This attribute can
be used with any JSF Component, because it is inherited from the UIComponent class, the top
-level of the JSF Component hierarchy. The <emphasis role="italic"><property>"rendered"</property></emphasis> attribute itself is not passed through to the HTML code as a tag attribute, but, if it has been set to “false,” the tag with all of its children will
+level of the JSF Component hierarchy. The <emphasis role="italic"><property>"rendered"</property></emphasis> attribute itself is not passed through to the HTML code as a tag attribute, but, if it has been set to "false", the tag with all of its children will
not be rendered at all.</para>
<para>It is pretty easy to add a <emphasis role="italic"><property>"rendered"</property></emphasis> attribute. Just add it into the ticker.tld and all is set.</para>
<programlisting role="XML"><![CDATA[<attribute>
Modified: trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml
===================================================================
--- trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-05 18:06:31 UTC (rev 2334)
+++ trunk/documentation/GettingStartedGuide/docs/userguide/en/modules/GettingStartedStrutsValidationExamples.xml 2007-07-06 10:06:18 UTC (rev 2335)
@@ -35,34 +35,34 @@
and tie it into the appropriate part of the application.</para>
<itemizedlist>
-<listitem><para>Right-click the plug-ins node under the StrutsHello/Configuration/default/
-struts-config.xml node in the Web Projects view and select Create Special Plugin/Validators from the context
+<listitem><para>Right-click the plug-ins node under the <emphasis>StrutsHello/Configuration/default/
+struts-config.xml</emphasis> node in the Web Projects view and select <emphasis>Create Special Plugin/Validators</emphasis> from the context
menu.</para></listitem>
<listitem><para>Further down in the Web Projects view, right-click on the
-StrutsHello/ResourceBundles node and select New/Properties File... from the context menu.</para></listitem>
-<listitem><para>In the dialog box, click on the Browse... button next to the Folder field, expand the
+StrutsHello/ResourceBundles node and select <emphasis> New/Properties File...</emphasis>from the context menu.</para></listitem>
+<listitem><para>In the dialog box, click on the <emphasis>Browse...</emphasis>button next to the Folder field, expand the
JavaSource folder in this next dialog box, select the sample subfolder, and click on the OK button.</para></listitem>
<listitem><para>Back in the first dialog box, type in applResources for the Name field and
click on the Finish button.</para></listitem>
-<listitem><para>Right-click the newly created file and select Add/Default Error Messages
+<listitem><para>Right-click the newly created file and select <emphasis>Add/Default Error Messages</emphasis>
from the context menu.</para></listitem>
<listitem><para>Drag up the sample.applResources icon until you can drop it on the resources folder under struts-config.xml.</para></listitem>
-<listitem><para>Select File/Save All from the menu bar.</para></listitem>
-<listitem><para>Select validation.xml under the StrutsHello/Validation node and double-click it to open it with the Red Hat Developer Studio Validation Editor.</para></listitem>
-<listitem><para>Select validation.xml under the StrutsHello/Validation node and double-click it to open it with the Red Hat Studio Validation Editor.</para></listitem>
-<listitem><para>Expand the form-beans node under the StrutsHello/Configuration/default/ struts-config.xml node. Then, drag the form bean GetNameForm and drop it onto formset (default) in the Validation Editor.</para></listitem>
-<listitem><para>In the Validation Editor, expand the formset node, right-click GetNameForm, and select Add Field... from the context menu.</para></listitem>
+<listitem><para>Select<emphasis> File/Save </emphasis>All from the menu bar.</para></listitem>
+<listitem><para>Select validation.xml under the <emphasis>StrutsHello/Validation</emphasis> node and double-click it to open it with the Red Hat Developer Studio Validation Editor.</para></listitem>
+<listitem><para>Select validation.xml under the<emphasis> StrutsHello/Validation</emphasis> node and double-click it to open it with the Red Hat Studio Validation Editor.</para></listitem>
+<listitem><para>Expand the form-beans node under the <emphasis>StrutsHello/Configuration/default/ struts-config.xml node.</emphasis> Then, drag the form bean GetNameForm and drop it onto formset (default) in the Validation Editor.</para></listitem>
+<listitem><para>In the Validation Editor, expand the formset node, right-click GetNameForm, and select<emphasis>Add Field...</emphasis> from the context menu.</para></listitem>
<listitem><para>Enter name for Property in the dialog box.</para></listitem>
-<listitem><para>In the properties for the name field to the right of the "tree" for the validation.xml file, click on the Change... button next to the Depends entry field.</para></listitem>
-<listitem><para>In the displayed double list, select required from the left list and then click Add->.</para></listitem>
+<listitem><para>In the properties for the name field to the right of the "tree" for the validation.xml file, click on the <emphasis>Change...</emphasis>button next to the Depends entry field.</para></listitem>
+<listitem><para>In the displayed double list, select required from the left list and then click <emphasis>Add-></emphasis>.</para></listitem>
<listitem><para>Click Ok.</para></listitem>
-<listitem><para>Right-click name and select Add Arg... from the context menu.</para></listitem>
-<listitem><para>In the Add Arg dialog box, click on the Change... button next to the Key field.</para></listitem>
+<listitem><para>Right-click name and select<emphasis>Add Arg...</emphasis> from the context menu.</para></listitem>
+<listitem><para>In the Add Arg dialog box, click on the <emphasis>Change...</emphasis>button next to the <emphasis>Key</emphasis> field.</para></listitem>
<listitem><para>In the Key dialog box that appears now, click on the Add button.</para></listitem>
<listitem><para>Enter name.required in the Name field, and enter A person's name in the Value field.</para></listitem>
<listitem><para>Click Finish, then Ok, and then Ok again.</para></listitem>
-<listitem><para>Select File/Save All from the menu bar.</para></listitem>
+<listitem><para>Select <emphasis>File/Save All</emphasis> from the menu bar.</para></listitem>
</itemizedlist>
</section>
@@ -74,11 +74,11 @@
<para>you don't actually have to do any of the script coding. The Validation Framework handles this.</para>
<para>To see how this works in our application, you'll just need to make a couple of modifications to one of the JSP files.</para>
<itemizedlist continuation="continues">
-<listitem><para>Double-click inputname.jsp under StrutsHello/WEB-ROOT (WebContent)/ pages to open it for editing.</para></listitem>
+<listitem><para>Double-click inputname.jsp under <emphasis>StrutsHello/WEB-ROOT</emphasis> (WebContent)/ pages to open it for editing.</para></listitem>
<listitem><para>Find the tag near the top and hit Return to make a new line under it.</para></listitem>
<listitem><para>In the Red Hat Palette view to the right, open the HTML folder and click on the javascript tag.</para></listitem>
<listitem><para>Back in the editor, just in front of the closing slash for this inserted tag, hit Ctrl+Space and select formName from the prompting menu.</para></listitem>
-<listitem><para>Over in the Web Projects view, select GetNameForm under the StrutsHello/Configuration/ default/struts-config.xml/form-beans node, drag it, and drop it between the quotes in the editor.</para></listitem>
+<listitem><para>Over in the Web Projects view, select GetNameForm under the <emphasis>StrutsHello/Configuration/default/struts-config.xml/form-beans</emphasis> node, drag it, and drop it between the quotes in the editor.</para></listitem>
<listitem><para>Modify the <html:form> tag by inserting this attribute:</para></listitem>
</itemizedlist>
<para>onsubmit="return validateGetNameForm(this)"</para>
@@ -109,7 +109,7 @@
</html:html>
]]></programlisting>
<itemizedlist continuation="continues">
-<listitem><para>Select File/Save from the menu bar.</para></listitem>
+<listitem><para>Select<emphasis> File/Save </emphasis>from the menu bar.</para></listitem>
<listitem><para>28. Start JBoss Application Server by clicking on its icon (a right-pointing arrow) in the toolbar.</para></listitem>
<listitem><para>29. Click on the Run icon in the toolbar.</para></listitem>
<listitem><para>Start Tomcat by clicking on its icon (a right-pointing arrow) in the toolbar.</para></listitem>
@@ -179,9 +179,9 @@
<?dbhtml filename="EditingTheAction.html"?>
<title>Editing the Action</title>
<itemizedlist continuation="continues">
-<listitem><para>In the Web Projects view, expand the node under the StrutsHello/Configuration/ default/struts-config.xml/action-mappings node, right-click the /greeting action, and then select Properties... from the context menu.</para></listitem>
+<listitem><para>In the Web Projects view, expand the node under the <emphasis>StrutsHello/Configuration/default/struts-config.xml/action-mappings</emphasis> node, right-click the /greeting action, and then select <emphasis>Properties...</emphasis>from the context menu.</para></listitem>
-<listitem><para>In the Edit Properties window, insert the cursor into the value column for the input property and click on the ... button.</para></listitem>
+<listitem><para>In the Edit Properties window, insert the cursor into the value column for the input property and click on the <emphasis>...</emphasis> button.</para></listitem>
<listitem><para>In the dialog box, make sure the Pages tab is selected, select StrutsHello/WEB-ROOT(WebContent)/pages/inputname.jsp, click the Ok button, and then click on the Close button.</para></listitem>
</itemizedlist>
@@ -192,7 +192,7 @@
<title>Editing the Form Bean</title>
<itemizedlist continuation="continues">
<listitem><para>Right-click the /greeting action again and select Open Form-bean Source to open the GetNameForm.java file for editing.</para></listitem>
-<listitem><para>Change the class that it extends to from: org.apache.struts.action.ActionForm to: org.apache.struts.validator.ValidatorForm</para></listitem>
+<listitem><para>Change the class that it extends to from: <emphasis>org.apache.struts.action.ActionForm</emphasis> to: org.apache.struts.validator.ValidatorForm</para></listitem>
<listitem><para>Comment out out the validate method.</para></listitem>
</itemizedlist>
<para>The file should now look like this:</para>
@@ -239,7 +239,7 @@
]]></programlisting>
-<para>Select File/Save All from the menu bar.</para>
+<para>Select <emphasis>File/Save All </emphasis>from the menu bar.</para>
<itemizedlist continuation="continues">
<listitem><para>Reload the application into JBoss AS by clicking on the Change Time Stamp icon (a finger pointing with a little star) in the toolbar.</para></listitem>
<listitem><para>Run the application.</para></listitem>
17 years, 5 months
JBoss Tools SVN: r2334 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-07-05 14:06:31 -0400 (Thu, 05 Jul 2007)
New Revision: 2334
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java
Log:
View refactored. Removes confusing heirarchy. Renames classes to be more logical. Code cleanup.
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java 2007-07-05 18:06:31 UTC (rev 2334)
@@ -0,0 +1,122 @@
+package org.jboss.ide.eclipse.as.ui.views.server;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IContributionManager;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+
+public class JBossServerView extends ViewPart {
+
+ private static final String TAG_SASHFORM_HEIGHT = "sashformHeight";
+ public static JBossServerView instance;
+ public static JBossServerView getDefault() {
+ return instance;
+ }
+
+ public static interface IServerViewFrame {
+ public IAction[] getActionBarActions();
+ public int getDefaultSize();
+ public void refresh();
+ }
+
+ public JBossServerView() {
+ super();
+ instance = this;
+ }
+
+
+ private SashForm form;
+ private int[] sashRows;
+ private IMemento memento;
+
+ private IServerViewFrame[] frames;
+ private ServerFrame serverFrame;
+ private ServerExtensionFrame extensionFrame;
+
+ public void init(IViewSite site, IMemento memento) throws PartInitException {
+ super.init(site, memento);
+ ServerUIPlugin.getPreferences().setShowOnActivity(false);
+ this.memento = memento;
+ int sum = 0;
+ sashRows = new int[2];
+ for (int i = 0; i < sashRows.length; i++) {
+ sashRows[i] = 50;
+ if (memento != null) {
+ Integer in = memento.getInteger(TAG_SASHFORM_HEIGHT + i);
+ if (in != null && in.intValue() > 5)
+ sashRows[i] = in.intValue();
+ }
+ sum += sashRows[i];
+ }
+ }
+
+ public void saveState(IMemento memento) {
+ super.saveState(memento);
+ int[] weights = form.getWeights();
+ for (int i = 0; i < weights.length; i++) {
+ if (weights[i] != 0)
+ memento.putInteger(TAG_SASHFORM_HEIGHT + i, weights[i]);
+ }
+ }
+
+ public void createPartControl(Composite parent) {
+ form = new SashForm(parent, SWT.VERTICAL);
+ form.setBackground(new Color(parent.getDisplay(), 255, 255, 255));
+ form.setLayout(new FillLayout());
+
+
+ Composite topWrapper = new Composite(form, SWT.NONE);
+ topWrapper.setLayout(new FillLayout());
+ serverFrame = new ServerFrame(topWrapper, this);
+
+ Composite bottomWrapper = new Composite(form, SWT.NONE);
+ bottomWrapper.setLayout(new FillLayout());
+ extensionFrame = new ServerExtensionFrame(bottomWrapper, this);
+
+
+ frames = new IServerViewFrame[] { serverFrame, extensionFrame };
+
+ // add toolbar buttons
+ IContributionManager cm = getViewSite().getActionBars().getToolBarManager();
+ for( int i = 0; i < frames.length; i++ ) {
+ IAction[] actions = frames[i].getActionBarActions();
+ for (int j = 0; j < actions.length - 1; j++)
+ cm.add(actions[j]);
+ }
+
+ form.setWeights(sashRows);
+ }
+
+ public void refreshAll() {
+ for( int i = 0; i < frames.length; i++ ) {
+ frames[i].refresh();
+ }
+ }
+
+ public ServerFrame getServerFrame() { return this.serverFrame; }
+ public ServerExtensionFrame getExtensionFrame() { return this.extensionFrame; }
+
+ public void setFocus() {
+ }
+
+ public IServer getSelectedServer() {
+ return serverFrame == null ? null : serverFrame.getSelectedServer();
+ }
+
+ public Object getAdapter(Class adaptor) {
+ if( adaptor == IPropertySheetPage.class) {
+ return extensionFrame.getViewer().getPropertySheet();
+ }
+ return super.getAdapter(adaptor);
+ }
+}
17 years, 5 months
JBoss Tools SVN: r2333 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui: views/server and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-07-05 14:03:51 -0400 (Thu, 05 Jul 2007)
New Revision: 2333
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerExtensionFrame.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerFrame.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerTableViewer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/StrippedServerView.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/TwiddlePollerListener.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerTableViewer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java
Log:
View refactored. Removes confusing heirarchy. Renames classes to be more logical. Code cleanup.
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/preferencepages/ViewPreferencePage.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -57,7 +57,6 @@
IWorkbenchPreferencePage {
private static final String ENABLED = "_ENABLED_";
- private static final String WEIGHT = "_WEIGHT_";
private Table table;
@@ -102,9 +101,6 @@
Boolean bigB = ((Boolean)items[i].getData(ENABLED));
if( bigB != null )
provider.setEnabled(bigB.booleanValue());
-// Integer weight = ((Integer)items[i].getData(WEIGHT));
-// if( weight != null )
-// provider.setWeight(weight.intValue());
provider.setWeight(i);
}
@@ -117,9 +113,7 @@
}
// refresh the viewer
- try {
- JBossServerView.getDefault().getJBViewer().refresh();
- } catch( Exception e ) {};
+ JBossServerView.getDefault().refreshAll();
return retval;
}
@@ -242,35 +236,10 @@
item.setData(ENABLED, new Boolean(b.getSelection()));
}
});
-
-// TableEditor editor2 = new TableEditor(table);
-//
-// final Spinner s = new Spinner(table, SWT.NONE);
-// s.setMaximum(50);
-// s.setMinimum(0);
-// s.setIncrement(1);
-// s.setSelection(providers[i].getWeight());
-// Point size2 = s.computeSize(SWT.DEFAULT, SWT.DEFAULT);
-// editor2.minimumWidth = size2.x;
-// minWidth = Math.max(size2.x, minWidth);
-// editor2.minimumHeight = size2.y;
-// editor2.horizontalAlignment = SWT.RIGHT;
-// editor2.verticalAlignment = SWT.CENTER;
-// editor2.setEditor(s, item , 2);
-//
-// s.addModifyListener(new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// item.setData(WEIGHT, new Integer(s.getSelection()));
-// }
-// });
-
-
}
column0.pack();
column1.pack();
column1.setWidth(column1.getWidth() + minWidth);
-// column2.pack();
-// column2.setWidth(column2.getWidth() + minWidth);
column3.pack();
column3.setWidth(column3.getWidth() + minWidth);
@@ -439,11 +408,7 @@
Button enabled = new Button(this, SWT.CHECK);
enabled.setText(Messages.ViewPreferencePageEnabled);
enabled.setSelection(provider.isEnabled());
-
-
-
}
-
}
public void init(IWorkbench workbench) {
Copied: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java (from rev 2202, trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerTableViewer.java)
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ExtensionTableViewer.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -0,0 +1,437 @@
+package org.jboss.ide.eclipse.as.ui.views.server;
+
+import java.util.ArrayList;
+import java.util.Properties;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.LabelProvider;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.part.PageBook;
+import org.eclipse.ui.views.properties.IPropertySheetPage;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.IServerLifecycleListener;
+import org.eclipse.wst.server.core.ServerCore;
+import org.eclipse.wst.server.ui.ServerUICore;
+import org.jboss.ide.eclipse.as.core.server.JBossServer;
+import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
+import org.jboss.ide.eclipse.as.ui.Messages;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.ISimplePropertiesHolder;
+import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.SimplePropertiesPropertySheetPage;
+
+public class ExtensionTableViewer extends TreeViewer {
+
+ protected TableViewerPropertySheet propertySheet;
+ protected Action disableCategoryAction, refreshAction, refreshFullAction;
+ protected boolean suppressingRefresh = false;
+ public ExtensionTableViewer(Tree tree) {
+ super(tree);
+ setContentProvider(new ContentProviderDelegator());
+ setLabelProvider(new LabelProviderDelegator());
+ propertySheet = new TableViewerPropertySheet();
+ createActions();
+ ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
+
+ public void serverAdded(IServer server) {
+ }
+
+ public void serverChanged(IServer server) {
+ }
+
+ public void serverRemoved(IServer server) {
+ final IServer server2 = server;
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ Object o = getInput();
+ if( server2.equals(o)) {
+ setInput(null);
+ }
+ }
+ });
+ }
+ });
+ }
+
+ protected void createActions() {
+ disableCategoryAction = new Action() {
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ Object selected = getSelectedElement();
+ if( selected instanceof ServerViewProvider) {
+ ((ServerViewProvider)selected).setEnabled(false);
+ refresh();
+ }
+ }
+ } );
+ }
+ };
+ disableCategoryAction.setText(Messages.DisableCategoryAction);
+ refreshAction = new Action() {
+ public void run() {
+ Object el = getSelectedElement();
+ if( el instanceof ServerViewProvider )
+ refresh(el);
+ else
+ refresh(((IStructuredSelection)getSelection()).getFirstElement());
+ }
+ };
+ refreshAction.setText("Refresh Item");
+
+ refreshFullAction = new Action() {
+ public void run() {
+ refresh(null);
+ }
+ };
+ refreshFullAction.setText("Refresh Full Tree");
+ }
+
+ public static class ContentWrapper {
+ private Object o;
+ private ServerViewProvider provider;
+
+ public ContentWrapper(Object o, ServerViewProvider provider) {
+ this.o = o;
+ this.provider = provider;
+ }
+
+ public Object getElement() {
+ return o;
+ }
+
+ public ServerViewProvider getProvider() {
+ return provider;
+ }
+
+ public boolean equals(Object other) {
+ if( other == null ) return false;
+
+ if( other instanceof ContentWrapper ) {
+ if( ((ContentWrapper)other).getElement() == null )
+ return o == null;
+ return ((ContentWrapper)other).getElement().equals(o);
+ }
+ return false;
+ }
+
+ public int hashCode() {
+ if( o == null ) return super.hashCode();
+ return o.hashCode();
+ }
+ }
+
+ protected class LabelProviderDelegator extends LabelProvider {
+ public String getText(Object obj) {
+ if( obj instanceof JBossServer) {
+ JBossServer server = (JBossServer)obj;
+ String ret = server.getServer().getName();
+ return ret;
+ }
+ if( obj instanceof ServerViewProvider) {
+ return ((ServerViewProvider)obj).getName();
+ }
+
+ if( obj instanceof ContentWrapper ) {
+ ContentWrapper wrapper = (ContentWrapper)obj;
+ return wrapper.getProvider().getDelegate().getLabelProvider().getText(wrapper.getElement());
+ }
+ return obj.toString();
+ }
+ public Image getImage(Object obj) {
+ if( obj instanceof JBossServer ) {
+ return ServerUICore.getLabelProvider().getImage(((JBossServer)obj).getServer());
+ }
+ if( obj instanceof ServerViewProvider ) {
+ return ((ServerViewProvider)obj).getImage();
+ }
+
+ if( obj instanceof ContentWrapper ) {
+ Object object2 = ((ContentWrapper)obj).getElement();
+ return ((ContentWrapper)obj).getProvider().getDelegate().getLabelProvider().getImage(object2);
+ }
+
+ return null;
+ }
+ }
+ protected class ContentProviderDelegator implements ITreeContentProvider {
+
+ public ContentProviderDelegator() {
+ }
+
+ public ContentWrapper[] wrap( Object[] elements, ServerViewProvider provider ) {
+ if( elements == null ) return new ContentWrapper[0];
+
+ ContentWrapper[] wrappers = new ContentWrapper[elements.length];
+ for( int i = 0; i < wrappers.length; i++ ) {
+ wrappers[i] = new ContentWrapper(elements[i], provider);
+ }
+ return wrappers;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if( inputElement == null ) return new Object[0];
+ IServer tmp = (IServer)getInput();
+ if( tmp == null )
+ return new Object[0];
+ return JBossServerUIPlugin.getDefault().getEnabledViewProviders(tmp);
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ try {
+ if( parentElement == null ) return new Object[0];
+
+ if( parentElement instanceof ServerViewProvider) {
+ Object[] ret = ((ServerViewProvider)parentElement).getDelegate().getContentProvider().getChildren(parentElement);
+ return wrap(ret, ((ServerViewProvider)parentElement));
+ }
+
+ if( parentElement instanceof ContentWrapper ) {
+ ContentWrapper parentWrapper = (ContentWrapper)parentElement;
+ Object[] o = null;
+ try {
+ o = parentWrapper.getProvider().getDelegate().getContentProvider().getChildren(parentWrapper.getElement());
+ } catch( Exception e) {
+ }
+ if( o == null )
+ return new Object[0];
+ return wrap(o, parentWrapper.getProvider());
+ }
+ } catch( Exception e ) { e.printStackTrace(); }
+ return new Object[0];
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return getChildren(element).length > 0 ? true : false;
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ ServerViewProvider[] providers = JBossServerUIPlugin.getDefault().
+ getEnabledViewProviders(newInput instanceof IServer ? (IServer)newInput : null);
+ for( int i = 0; i < providers.length; i++ ) {
+ try {
+ providers[i].getDelegate().getContentProvider().inputChanged(viewer, oldInput, newInput);
+ } catch( Exception e) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+ }
+
+ public Object getRawElement(Object o) {
+ if( o instanceof ContentWrapper )
+ return ((ContentWrapper)o).getElement();
+ return o;
+ }
+
+ public ServerViewProvider getParentViewProvider(Object o) {
+ if( o instanceof ContentWrapper )
+ return ((ContentWrapper)o).getProvider();
+ return null;
+ }
+
+ public Object getSelectedElement() {
+ ISelection sel = getSelection();
+ if( sel instanceof IStructuredSelection ) {
+ Object o = ((IStructuredSelection)sel).getFirstElement();
+ if( o != null && o instanceof ContentWrapper ) {
+ o = ((ContentWrapper)o).getElement();
+ }
+ return o;
+ }
+ return null;
+ }
+
+ protected void fillSelectedContextMenu(Shell shell, IMenuManager mgr) {
+ ISelection sel = getSelection();
+ if( sel instanceof IStructuredSelection ) {
+ Object selected = ((IStructuredSelection)sel).getFirstElement();
+ if( selected != null ) {
+ ServerViewProvider provider;
+ if( selected instanceof ServerViewProvider ) {
+ provider = (ServerViewProvider)selected;
+ } else {
+ provider = getParentViewProvider(selected);
+ }
+ if( provider != null )
+ provider.getDelegate().fillContextMenu(shell, mgr, getRawElement(selected));
+ }
+ }
+
+ }
+
+
+ protected void fillJBContextMenu(Shell shell, IMenuManager menu) {
+ Object selected = getSelectedElement();
+ menu.add(refreshAction);
+ menu.add(refreshFullAction);
+ if( selected instanceof ServerViewProvider ) {
+ menu.add(disableCategoryAction);
+ }
+ menu.add(new Separator());
+ }
+
+
+
+ public IPropertySheetPage getPropertySheet() {
+ return propertySheet;
+ }
+
+ public class TableViewerPropertySheet implements IPropertySheetPage {
+
+ private PageBook book;
+ private ArrayList addedControls = new ArrayList();
+ private SimplePropertiesPropertySheetPage topLevelPropertiesPage;
+
+ public void createControl(Composite parent) {
+ topLevelPropertiesPage = PropertySheetFactory.createSimplePropertiesSheet(new TopLevelProperties());
+ book = new PageBook(parent, SWT.NONE);
+ addedControls.clear();
+ topLevelPropertiesPage.createControl(book);
+ book.showPage(topLevelPropertiesPage.getControl());
+ }
+
+ public void dispose() {
+ }
+
+ public Control getControl() {
+ return book;
+ }
+
+ public void setActionBars(IActionBars actionBars) {
+ }
+
+ public void setFocus() {
+ }
+
+ public void selectionChanged(IWorkbenchPart part, ISelection sel) {
+ Object selected = getSelectedObject(sel);
+ if( selected != null ) {
+
+ IPropertySheetPage page = null;
+ if( selected instanceof ContentWrapper ) {
+ page = getDelegatePage((ContentWrapper)selected);
+ }
+
+ if( page == null ) {
+ page = topLevelPropertiesPage;
+ }
+ page.selectionChanged(part, sel);
+ book.showPage(page.getControl());
+ }
+ }
+ private IPropertySheetPage getDelegatePage(ContentWrapper wrapper) {
+ ServerViewProvider provider = wrapper.getProvider();
+ IPropertySheetPage returnSheet = null;
+ returnSheet = provider.getDelegate().getPropertySheetPage();
+ if( !addedControls.contains(provider) && returnSheet != null) {
+ returnSheet.createControl(book);
+ addedControls.add(provider);
+ }
+ return returnSheet;
+ }
+
+ public Object getSelectedObject(ISelection sel) {
+ if( sel instanceof IStructuredSelection ) {
+ IStructuredSelection selection = (IStructuredSelection)sel;
+ Object selected = selection.getFirstElement();
+ return selected;
+ }
+ return null;
+ }
+
+ }
+ /**
+ * Properties for the top level elements
+ * (a server or a category / extension point
+ * @author rstryker
+ *
+ */
+ class TopLevelProperties implements ISimplePropertiesHolder {
+ public Properties getProperties(Object selected) {
+ Properties ret = new Properties();
+ if( selected instanceof ServerViewProvider ) {
+ ServerViewProvider provider = (ServerViewProvider)selected;
+ ret.setProperty(Messages.ExtensionID, provider.getId());
+ ret.setProperty(Messages.ExtensionName, provider.getName());
+ ret.setProperty(Messages.ExtensionDescription, provider.getDescription());
+ ret.setProperty(Messages.ExtensionProviderClass, provider.getDelegateName());
+ }
+ return ret;
+ }
+
+
+ public String[] getPropertyKeys(Object selected) {
+ if( selected instanceof ServerViewProvider) {
+ return new String[] {
+ Messages.ExtensionName, Messages.ExtensionDescription,
+ Messages.ExtensionID, Messages.ExtensionProviderClass
+ };
+
+ }
+ if( selected instanceof JBossServer ) {
+ return new String[] {
+ Messages.ServerRuntimeVersion, Messages.ServerHome,
+ Messages.ServerConfigurationName, Messages.ServerDeployDir,
+ };
+ }
+ return new String[] {};
+ }
+ }
+
+ public void dispose() {
+ // The Loner
+ propertySheet.dispose();
+
+ ServerViewProvider[] providers = JBossServerUIPlugin.getDefault().getAllServerViewProviders();
+ for( int i = 0; i < providers.length; i++ ) {
+ providers[i].dispose();
+ }
+ }
+
+
+ public void suppressingRefresh(Runnable runnable) {
+ boolean currentVal = suppressingRefresh;
+ suppressingRefresh = true;
+ runnable.run();
+ suppressingRefresh = currentVal;
+ }
+
+ public void refresh() {
+ refresh(null);
+ }
+ public void refresh(final Object element) {
+ if(!suppressingRefresh) {
+ try {
+ super.refresh(element);
+ } catch( Exception e ) {
+ e.printStackTrace();
+ }
+ }
+ }
+
+
+}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerTableViewer.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerTableViewer.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -1,437 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.views.server;
-
-import java.util.ArrayList;
-import java.util.Properties;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.IServerLifecycleListener;
-import org.eclipse.wst.server.core.ServerCore;
-import org.eclipse.wst.server.ui.ServerUICore;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.ISimplePropertiesHolder;
-import org.jboss.ide.eclipse.as.ui.views.server.extensions.PropertySheetFactory.SimplePropertiesPropertySheetPage;
-
-public class JBossServerTableViewer extends TreeViewer {
-
- protected TableViewerPropertySheet propertySheet;
- protected Action disableCategoryAction, refreshAction, refreshFullAction;
- protected boolean suppressingRefresh = false;
- public JBossServerTableViewer(Tree tree) {
- super(tree);
- setContentProvider(new ContentProviderDelegator());
- setLabelProvider(new LabelProviderDelegator());
- propertySheet = new TableViewerPropertySheet();
- createActions();
- ServerCore.addServerLifecycleListener(new IServerLifecycleListener() {
-
- public void serverAdded(IServer server) {
- }
-
- public void serverChanged(IServer server) {
- }
-
- public void serverRemoved(IServer server) {
- final IServer server2 = server;
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Object o = getInput();
- if( server2.equals(o)) {
- setInput(null);
- }
- }
- });
- }
- });
- }
-
- protected void createActions() {
- disableCategoryAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- Object selected = getSelectedElement();
- if( selected instanceof ServerViewProvider) {
- ((ServerViewProvider)selected).setEnabled(false);
- refresh();
- }
- }
- } );
- }
- };
- disableCategoryAction.setText(Messages.DisableCategoryAction);
- refreshAction = new Action() {
- public void run() {
- Object el = getSelectedElement();
- if( el instanceof ServerViewProvider )
- refresh(el);
- else
- refresh(((IStructuredSelection)getSelection()).getFirstElement());
- }
- };
- refreshAction.setText("Refresh Item");
-
- refreshFullAction = new Action() {
- public void run() {
- refresh(null);
- }
- };
- refreshFullAction.setText("Refresh Full Tree");
- }
-
- public static class ContentWrapper {
- private Object o;
- private ServerViewProvider provider;
-
- public ContentWrapper(Object o, ServerViewProvider provider) {
- this.o = o;
- this.provider = provider;
- }
-
- public Object getElement() {
- return o;
- }
-
- public ServerViewProvider getProvider() {
- return provider;
- }
-
- public boolean equals(Object other) {
- if( other == null ) return false;
-
- if( other instanceof ContentWrapper ) {
- if( ((ContentWrapper)other).getElement() == null )
- return o == null;
- return ((ContentWrapper)other).getElement().equals(o);
- }
- return false;
- }
-
- public int hashCode() {
- if( o == null ) return super.hashCode();
- return o.hashCode();
- }
- }
-
- protected class LabelProviderDelegator extends LabelProvider {
- public String getText(Object obj) {
- if( obj instanceof JBossServer) {
- JBossServer server = (JBossServer)obj;
- String ret = server.getServer().getName();
- return ret;
- }
- if( obj instanceof ServerViewProvider) {
- return ((ServerViewProvider)obj).getName();
- }
-
- if( obj instanceof ContentWrapper ) {
- ContentWrapper wrapper = (ContentWrapper)obj;
- return wrapper.getProvider().getDelegate().getLabelProvider().getText(wrapper.getElement());
- }
- return obj.toString();
- }
- public Image getImage(Object obj) {
- if( obj instanceof JBossServer ) {
- return ServerUICore.getLabelProvider().getImage(((JBossServer)obj).getServer());
- }
- if( obj instanceof ServerViewProvider ) {
- return ((ServerViewProvider)obj).getImage();
- }
-
- if( obj instanceof ContentWrapper ) {
- Object object2 = ((ContentWrapper)obj).getElement();
- return ((ContentWrapper)obj).getProvider().getDelegate().getLabelProvider().getImage(object2);
- }
-
- return null;
- }
- }
- protected class ContentProviderDelegator implements ITreeContentProvider {
-
- public ContentProviderDelegator() {
- }
-
- public ContentWrapper[] wrap( Object[] elements, ServerViewProvider provider ) {
- if( elements == null ) return new ContentWrapper[0];
-
- ContentWrapper[] wrappers = new ContentWrapper[elements.length];
- for( int i = 0; i < wrappers.length; i++ ) {
- wrappers[i] = new ContentWrapper(elements[i], provider);
- }
- return wrappers;
- }
-
- public Object[] getElements(Object inputElement) {
- if( inputElement == null ) return new Object[0];
- IServer tmp = (IServer)getInput();
- if( tmp == null )
- return new Object[0];
- return JBossServerUIPlugin.getDefault().getEnabledViewProviders(tmp);
- }
-
- public Object[] getChildren(Object parentElement) {
- try {
- if( parentElement == null ) return new Object[0];
-
- if( parentElement instanceof ServerViewProvider) {
- Object[] ret = ((ServerViewProvider)parentElement).getDelegate().getContentProvider().getChildren(parentElement);
- return wrap(ret, ((ServerViewProvider)parentElement));
- }
-
- if( parentElement instanceof ContentWrapper ) {
- ContentWrapper parentWrapper = (ContentWrapper)parentElement;
- Object[] o = null;
- try {
- o = parentWrapper.getProvider().getDelegate().getContentProvider().getChildren(parentWrapper.getElement());
- } catch( Exception e) {
- }
- if( o == null )
- return new Object[0];
- return wrap(o, parentWrapper.getProvider());
- }
- } catch( Exception e ) { e.printStackTrace(); }
- return new Object[0];
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return getChildren(element).length > 0 ? true : false;
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- ServerViewProvider[] providers = JBossServerUIPlugin.getDefault().
- getEnabledViewProviders(newInput instanceof IServer ? (IServer)newInput : null);
- for( int i = 0; i < providers.length; i++ ) {
- try {
- providers[i].getDelegate().getContentProvider().inputChanged(viewer, oldInput, newInput);
- } catch( Exception e) {
- e.printStackTrace();
- }
- }
- }
-
- }
-
- public Object getRawElement(Object o) {
- if( o instanceof ContentWrapper )
- return ((ContentWrapper)o).getElement();
- return o;
- }
-
- public ServerViewProvider getParentViewProvider(Object o) {
- if( o instanceof ContentWrapper )
- return ((ContentWrapper)o).getProvider();
- return null;
- }
-
- public Object getSelectedElement() {
- ISelection sel = getSelection();
- if( sel instanceof IStructuredSelection ) {
- Object o = ((IStructuredSelection)sel).getFirstElement();
- if( o != null && o instanceof ContentWrapper ) {
- o = ((ContentWrapper)o).getElement();
- }
- return o;
- }
- return null;
- }
-
- protected void fillSelectedContextMenu(Shell shell, IMenuManager mgr) {
- ISelection sel = getSelection();
- if( sel instanceof IStructuredSelection ) {
- Object selected = ((IStructuredSelection)sel).getFirstElement();
- if( selected != null ) {
- ServerViewProvider provider;
- if( selected instanceof ServerViewProvider ) {
- provider = (ServerViewProvider)selected;
- } else {
- provider = getParentViewProvider(selected);
- }
- if( provider != null )
- provider.getDelegate().fillContextMenu(shell, mgr, getRawElement(selected));
- }
- }
-
- }
-
-
- protected void fillJBContextMenu(Shell shell, IMenuManager menu) {
- Object selected = getSelectedElement();
- menu.add(refreshAction);
- menu.add(refreshFullAction);
- if( selected instanceof ServerViewProvider ) {
- menu.add(disableCategoryAction);
- }
- menu.add(new Separator());
- }
-
-
-
- public IPropertySheetPage getPropertySheet() {
- return propertySheet;
- }
-
- public class TableViewerPropertySheet implements IPropertySheetPage {
-
- private PageBook book;
- private ArrayList addedControls = new ArrayList();
- private SimplePropertiesPropertySheetPage topLevelPropertiesPage;
-
- public void createControl(Composite parent) {
- topLevelPropertiesPage = PropertySheetFactory.createSimplePropertiesSheet(new TopLevelProperties());
- book = new PageBook(parent, SWT.NONE);
- addedControls.clear();
- topLevelPropertiesPage.createControl(book);
- book.showPage(topLevelPropertiesPage.getControl());
- }
-
- public void dispose() {
- }
-
- public Control getControl() {
- return book;
- }
-
- public void setActionBars(IActionBars actionBars) {
- }
-
- public void setFocus() {
- }
-
- public void selectionChanged(IWorkbenchPart part, ISelection sel) {
- Object selected = getSelectedObject(sel);
- if( selected != null ) {
-
- IPropertySheetPage page = null;
- if( selected instanceof ContentWrapper ) {
- page = getDelegatePage((ContentWrapper)selected);
- }
-
- if( page == null ) {
- page = topLevelPropertiesPage;
- }
- page.selectionChanged(part, sel);
- book.showPage(page.getControl());
- }
- }
- private IPropertySheetPage getDelegatePage(ContentWrapper wrapper) {
- ServerViewProvider provider = wrapper.getProvider();
- IPropertySheetPage returnSheet = null;
- returnSheet = provider.getDelegate().getPropertySheetPage();
- if( !addedControls.contains(provider) && returnSheet != null) {
- returnSheet.createControl(book);
- addedControls.add(provider);
- }
- return returnSheet;
- }
-
- public Object getSelectedObject(ISelection sel) {
- if( sel instanceof IStructuredSelection ) {
- IStructuredSelection selection = (IStructuredSelection)sel;
- Object selected = selection.getFirstElement();
- return selected;
- }
- return null;
- }
-
- }
- /**
- * Properties for the top level elements
- * (a server or a category / extension point
- * @author rstryker
- *
- */
- class TopLevelProperties implements ISimplePropertiesHolder {
- public Properties getProperties(Object selected) {
- Properties ret = new Properties();
- if( selected instanceof ServerViewProvider ) {
- ServerViewProvider provider = (ServerViewProvider)selected;
- ret.setProperty(Messages.ExtensionID, provider.getId());
- ret.setProperty(Messages.ExtensionName, provider.getName());
- ret.setProperty(Messages.ExtensionDescription, provider.getDescription());
- ret.setProperty(Messages.ExtensionProviderClass, provider.getDelegateName());
- }
- return ret;
- }
-
-
- public String[] getPropertyKeys(Object selected) {
- if( selected instanceof ServerViewProvider) {
- return new String[] {
- Messages.ExtensionName, Messages.ExtensionDescription,
- Messages.ExtensionID, Messages.ExtensionProviderClass
- };
-
- }
- if( selected instanceof JBossServer ) {
- return new String[] {
- Messages.ServerRuntimeVersion, Messages.ServerHome,
- Messages.ServerConfigurationName, Messages.ServerDeployDir,
- };
- }
- return new String[] {};
- }
- }
-
- public void dispose() {
- // The Loner
- propertySheet.dispose();
-
- ServerViewProvider[] providers = JBossServerUIPlugin.getDefault().getAllServerViewProviders();
- for( int i = 0; i < providers.length; i++ ) {
- providers[i].dispose();
- }
- }
-
-
- public void suppressingRefresh(Runnable runnable) {
- boolean currentVal = suppressingRefresh;
- suppressingRefresh = true;
- runnable.run();
- suppressingRefresh = currentVal;
- }
-
- public void refresh() {
- refresh(null);
- }
- public void refresh(final Object element) {
- if(!suppressingRefresh) {
- try {
- super.refresh(element);
- } catch( Exception e ) {
- e.printStackTrace();
- }
- }
- }
-
-
-}
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/JBossServerView.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -1,274 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.views.server;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.debug.core.ILaunchConfiguration;
-import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.views.properties.IPropertySheetPage;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Server;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.view.servers.DeleteAction;
-import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.ide.eclipse.as.core.server.JBossServer;
-import org.jboss.ide.eclipse.as.core.server.JBossServerBehavior;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.dialogs.TwiddleDialog;
-
-public class JBossServerView extends StrippedServerView {
-
- private static final String TAG_SASHFORM_HEIGHT = "sashformHeight";
-
- protected int[] sashRows; // For the sashform sashRows
-
- protected SashForm form;
-
- protected JBossServerTableViewer jbViewer;
- protected Tree jbTreeTable;
-
-
- protected Action editLaunchConfigAction, twiddleAction, cloneServerAction;
-
- public static JBossServerView instance;
- public static JBossServerView getDefault() {
- return instance;
- }
-
-
- public JBossServerView() {
- super();
- instance = this;
- }
-
- public JBossServerTableViewer getJBViewer() {
- return jbViewer;
- }
-
- public void createPartControl(Composite parent) {
-
- form = new SashForm(parent, SWT.VERTICAL);
- form.setBackground(new Color(parent.getDisplay(), 255, 255, 255));
-
- form.setLayout(new FillLayout());
-
- addServerViewer(form);
- addSecondViewer(form);
- form.setWeights(sashRows);
- createActions();
- addListeners();
- doMenuStuff(parent);
- }
-
- private void addServerViewer(Composite form) {
- Composite child1 = new Composite(form,SWT.NONE);
- child1.setLayout(new GridLayout());
- super.createPartControl(child1);
- }
-
- private void addSecondViewer(Composite form) {
- Composite child2 = new Composite(form,SWT.NONE);
- child2.setLayout(new FillLayout());
- jbTreeTable = new Tree(child2, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
- jbViewer = new JBossServerTableViewer(jbTreeTable);
- getSite().setSelectionProvider(jbViewer);
- }
-
-
- public void createActions() {
- editLaunchConfigAction = new Action() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- try {
- final Object selected = getSelectedServer();
- IServer s = null;
- if( selected instanceof JBossServer ) {
- s = ((JBossServer)selected).getServer();
- } else if( selected instanceof IServer ) {
- s = (IServer)selected;
- }
-
- if( s != null ) {
- ILaunchConfiguration launchConfig = ((Server) s).getLaunchConfiguration(true, null);
- // TODO: use correct launch group
- DebugUITools.openLaunchConfigurationPropertiesDialog(new Shell(), launchConfig, "org.eclipse.debug.ui.launchGroup.run");
- }
- } catch (CoreException ce) {
- Trace.trace(Trace.SEVERE, "Could not create launch configuration", ce);
- }
-
- }
- });
- }
- };
- editLaunchConfigAction.setText(Messages.EditLaunchConfigurationAction);
- editLaunchConfigAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.IMG_JBOSS_CONFIGURATION));
-
- twiddleAction = new Action() {
- public void run() {
- final IStructuredSelection selected = ((IStructuredSelection)tableViewer.getSelection());
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- TwiddleDialog dialog = new TwiddleDialog(tableViewer.getTree().getShell(), selected.getFirstElement());
- dialog.open();
- }
- } );
-
- }
- };
- twiddleAction.setText(Messages.TwiddleServerAction);
- twiddleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.TWIDDLE_IMAGE));
-
- }
-
-
- // for superclass, for the top viewer
- protected void fillContextMenu(Shell shell, IMenuManager menu) {
- menu.add(newServerAction);
- menu.add(new Separator());
- if( getSelectedServer() != null ) {
- menu.add(new DeleteAction(new Shell(), getSelectedServer()));
- menu.add(new Separator());
- }
- menu.add(actions[1]);
- menu.add(actions[0]);
- menu.add(actions[3]);
- menu.add(actions[4]);
- menu.add(actions[5]);
- menu.add(new Separator());
- menu.add(twiddleAction);
- menu.add(editLaunchConfigAction);
- //menu.add(actions[6]);
- menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
-
- if( getSelectedServer() != null ) {
- boolean twiddleEnabled = getSelectedServer().getServerState() == IServer.STATE_STARTED
- && ServerConverter.getJBossServer(getSelectedServer()) != null;
- boolean editLaunchEnabled = (JBossServerBehavior)getSelectedServer().loadAdapter(JBossServerBehavior.class, new NullProgressMonitor()) != null;
- twiddleAction.setEnabled(twiddleEnabled);
- editLaunchConfigAction.setEnabled(true);
- } else {
- twiddleAction.setEnabled(false);
- editLaunchConfigAction.setEnabled(false);
- }
- }
-
-
-
- public IServer getSelectedServer() {
- return (IServer)jbViewer.getInput();
- }
-
- public void addListeners() {
-
- /*
- * Handles the selection of the server viewer which is embedded in my sashform
- */
-
- tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- Object selection = ((TreeSelection)event.getSelection()).getFirstElement();
- Object server = selection;
- if( selection instanceof ModuleServer ) {
- server = ((ModuleServer)selection).server;
- }
-
- if( selection == null ) return;
- if( server != jbViewer.getInput()) {
- jbViewer.setInput(server);
- } else {
- jbViewer.refresh();
-// Object[] expanded = jbViewer.getExpandedElements();
-// jbViewer.setInput(server);
-// jbViewer.setExpandedElements(expanded);
- }
- }
-
- });
- }
- protected void doMenuStuff(Composite parent) {
- MenuManager menuManager = new MenuManager("#PopupMenu");
- menuManager.setRemoveAllWhenShown(true);
- final Shell shell = jbTreeTable.getShell();
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- jbViewer.fillSelectedContextMenu(shell, mgr);
- mgr.add(new Separator());
- jbViewer.fillJBContextMenu(shell, mgr);
- }
- });
- Menu menu = menuManager.createContextMenu(parent);
- jbTreeTable.setMenu(menu);
- }
-
- /**
- * Save / Load some state (width / height of boxes)
- */
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- ServerUIPlugin.getPreferences().setShowOnActivity(false);
- int sum = 0;
- sashRows = new int[2];
- for (int i = 0; i < sashRows.length; i++) {
- sashRows[i] = 50;
- if (memento != null) {
- Integer in = memento.getInteger(TAG_SASHFORM_HEIGHT + i);
- if (in != null && in.intValue() > 5)
- sashRows[i] = in.intValue();
- }
- sum += sashRows[i];
- }
- }
-
- public void saveState(IMemento memento) {
- super.saveState(memento);
- int[] weights = form.getWeights();
- for (int i = 0; i < weights.length; i++) {
- if (weights[i] != 0)
- memento.putInteger(TAG_SASHFORM_HEIGHT + i, weights[i]);
- }
- }
-
-
-
- public Object getAdapter(Class adaptor) {
- if( adaptor == IPropertySheetPage.class) {
- return jbViewer.getPropertySheet();
- }
- return super.getAdapter(adaptor);
- }
-
- public void dispose() {
- super.dispose();
- jbViewer.dispose();
- }
-
-
-
-}
\ No newline at end of file
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerExtensionFrame.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerExtensionFrame.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerExtensionFrame.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -0,0 +1,91 @@
+package org.jboss.ide.eclipse.as.ui.views.server;
+
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+import org.eclipse.jface.viewers.TreeSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
+import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView.IServerViewFrame;
+
+public class ServerExtensionFrame extends Composite implements IServerViewFrame {
+
+ private Tree jbTreeTable;
+ private ExtensionTableViewer jbViewer;
+ private JBossServerView view;
+ public ServerExtensionFrame(Composite parent, JBossServerView view) {
+ super(parent, SWT.NONE);
+ this.view = view;
+ setLayout(new FillLayout());
+ jbTreeTable = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
+ jbViewer = new ExtensionTableViewer(jbTreeTable);
+ view.getSite().setSelectionProvider(jbViewer);
+ addListeners();
+ doMenuStuff(parent);
+ }
+
+ protected void doMenuStuff(Composite parent) {
+ MenuManager menuManager = new MenuManager("#PopupMenu");
+ menuManager.setRemoveAllWhenShown(true);
+ final Shell shell = jbTreeTable.getShell();
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager mgr) {
+ jbViewer.fillSelectedContextMenu(shell, mgr);
+ mgr.add(new Separator());
+ jbViewer.fillJBContextMenu(shell, mgr);
+ }
+ });
+ Menu menu = menuManager.createContextMenu(parent);
+ jbTreeTable.setMenu(menu);
+ }
+
+ public ExtensionTableViewer getViewer() {
+ return jbViewer;
+ }
+
+ public void refresh() {
+ jbViewer.refresh();
+ }
+
+ public void addListeners() {
+
+ /*
+ * Handles the selection of the server viewer which is embedded in my sashform
+ */
+ view.getServerFrame().getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
+ public void selectionChanged(SelectionChangedEvent event) {
+ Object selection = ((TreeSelection)event.getSelection()).getFirstElement();
+ Object server = selection;
+ if( selection instanceof ModuleServer ) {
+ server = ((ModuleServer)selection).server;
+ }
+
+ if( selection == null ) return;
+ if( server != jbViewer.getInput()) {
+ jbViewer.setInput(server);
+ } else {
+ jbViewer.refresh();
+ }
+ }
+
+ });
+ }
+
+
+ public IAction[] getActionBarActions() {
+ return new IAction[] {}; // none
+ }
+
+ public int getDefaultSize() {
+ return 0;
+ }
+ }
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerFrame.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerFrame.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerFrame.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -0,0 +1,232 @@
+package org.jboss.ide.eclipse.as.ui.views.server;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.debug.core.ILaunchConfiguration;
+import org.eclipse.debug.core.ILaunchManager;
+import org.eclipse.debug.ui.DebugUITools;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.action.IMenuListener;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.viewers.ISelectionProvider;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IViewSite;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.internal.Server;
+import org.eclipse.wst.server.core.internal.Trace;
+import org.eclipse.wst.server.ui.internal.ContextIds;
+import org.eclipse.wst.server.ui.internal.Messages;
+import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
+import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PublishAction;
+import org.eclipse.wst.server.ui.internal.view.servers.PublishCleanAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
+import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
+import org.jboss.ide.eclipse.as.core.server.JBossServer;
+import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
+import org.jboss.ide.eclipse.as.ui.dialogs.TwiddleDialog;
+import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView.IServerViewFrame;
+
+public class ServerFrame extends Composite implements IServerViewFrame {
+
+ protected Action[] actions;
+ protected IWorkbenchPartSite site;
+ protected IViewSite viewSite;
+ protected Tree treeTable;
+ protected ServerTableViewer tableViewer;
+ protected Action editLaunchConfigAction;
+ protected Action twiddleAction;
+ protected Action newServerAction;
+
+ public ServerFrame(Composite parent, JBossServerView view) {
+ super(parent, SWT.BORDER);
+ setLayout(new FillLayout());
+ this.site = view.getSite();
+ this.viewSite = view.getViewSite();
+
+
+ int cols[] = new int[] {150, 30};
+
+ treeTable = new Tree(this, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
+ treeTable.setHeaderVisible(true);
+ treeTable.setLinesVisible(false);
+ treeTable.setFont(parent.getFont());
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(treeTable, ContextIds.VIEW_SERVERS);
+
+ // add columns
+ TreeColumn column = new TreeColumn(treeTable, SWT.SINGLE);
+ column.setText(Messages.viewServer);
+ column.setWidth(cols[0]);
+
+ TreeColumn column2 = new TreeColumn(treeTable, SWT.SINGLE);
+ column2.setText(Messages.viewStatus);
+ column2.setWidth(cols[1]);
+
+ tableViewer = new ServerTableViewer(viewSite, treeTable);
+ initializeActions(tableViewer);
+
+ treeTable.addSelectionListener(new SelectionAdapter() {
+ public void widgetSelected(SelectionEvent event) {
+ try {
+ } catch (Exception e) {
+ viewSite.getActionBars().getStatusLineManager().setMessage(null, "");
+ }
+ }
+ public void widgetDefaultSelected(SelectionEvent event) {
+ try {
+ TreeItem item = treeTable.getSelection()[0];
+ Object data = item.getData();
+ if (!(data instanceof IServer))
+ return;
+ IServer server = (IServer) data;
+ ServerUIPlugin.editServer(server);
+ } catch (Exception e) {
+ Trace.trace(Trace.SEVERE, "Could not open server", e);
+ }
+ }
+ });
+
+ MenuManager menuManager = new MenuManager("#PopupMenu");
+ menuManager.setRemoveAllWhenShown(true);
+ final Shell shell = treeTable.getShell();
+ menuManager.addMenuListener(new IMenuListener() {
+ public void menuAboutToShow(IMenuManager mgr) {
+ fillContextMenu(shell, mgr);
+ }
+ });
+ Menu menu = menuManager.createContextMenu(parent);
+ treeTable.setMenu(menu);
+ site.registerContextMenu(menuManager, tableViewer);
+ site.setSelectionProvider(tableViewer);
+ }
+
+ protected void fillContextMenu(Shell shell, IMenuManager menu) {
+ menu.add(newServerAction);
+ menu.add(new Separator());
+ //menu.add(new DeleteAction(new Shell(), getSelectedServer()));
+ menu.add(new Separator());
+ menu.add(actions[1]);
+ menu.add(actions[0]);
+ menu.add(actions[3]);
+ menu.add(actions[4]);
+ menu.add(actions[5]);
+ menu.add(new Separator());
+ menu.add(twiddleAction);
+ menu.add(editLaunchConfigAction);
+ menu.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
+ twiddleAction.setEnabled(true);
+ editLaunchConfigAction.setEnabled(true);
+ }
+
+ public IServer getSelectedServer() {
+ Object o = ((IStructuredSelection)tableViewer.getSelection()).getFirstElement();
+ return (IServer)o;
+ }
+
+ public void initializeActions(ISelectionProvider provider) {
+ Shell shell = site.getShell();
+
+ createActions();
+
+ actions = new Action[8];
+ // create the start actions
+ actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
+ actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
+ actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
+
+ // create the stop action
+ actions[3] = new StopAction(shell, provider);
+
+ // create the publish actions
+ actions[4] = new PublishAction(shell, provider);
+ actions[5] = new PublishCleanAction(shell, provider);
+ actions[6] = editLaunchConfigAction;
+ actions[7] = twiddleAction;
+ }
+
+ protected void createActions() {
+ newServerAction = new Action() {
+ public void run() {
+ IAction newServerAction = new NewServerWizardAction();
+ newServerAction.run();
+ }
+ };
+ newServerAction.setText("New Server");
+ newServerAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.GENERIC_SERVER_IMAGE));
+
+ editLaunchConfigAction = new Action() {
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ try {
+ final Object selected = getSelectedServer();
+ IServer s = null;
+ if( selected instanceof JBossServer ) {
+ s = ((JBossServer)selected).getServer();
+ } else if( selected instanceof IServer ) {
+ s = (IServer)selected;
+ }
+
+ if( s != null ) {
+ ILaunchConfiguration launchConfig = ((Server) s).getLaunchConfiguration(true, null);
+ // TODO: use correct launch group
+ DebugUITools.openLaunchConfigurationPropertiesDialog(new Shell(), launchConfig, "org.eclipse.debug.ui.launchGroup.run");
+ }
+ } catch (CoreException ce) {
+ }
+ }
+ });
+ }
+ };
+ editLaunchConfigAction.setText(org.jboss.ide.eclipse.as.ui.Messages.EditLaunchConfigurationAction);
+ editLaunchConfigAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.IMG_JBOSS_CONFIGURATION));
+
+ twiddleAction = new Action() {
+ public void run() {
+ final IStructuredSelection selected = ((IStructuredSelection)tableViewer.getSelection());
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ TwiddleDialog dialog = new TwiddleDialog(tableViewer.getTree().getShell(), selected.getFirstElement());
+ dialog.open();
+ }
+ } );
+
+ }
+ };
+ twiddleAction.setText( org.jboss.ide.eclipse.as.ui.Messages.TwiddleServerAction);
+ twiddleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.TWIDDLE_IMAGE));
+
+ }
+
+ public ServerTableViewer getViewer() {
+ return tableViewer;
+ }
+
+ public void refresh() {
+ tableViewer.refresh();
+ }
+
+ public IAction[] getActionBarActions() {
+ return new IAction[] { actions[0], actions[1], actions[2], actions[3], actions[4], actions[5] };
+ }
+
+ public int getDefaultSize() {
+ return 0;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerTableViewer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerTableViewer.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/ServerTableViewer.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -28,6 +28,7 @@
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Tree;
import org.eclipse.ui.IActionBars;
+import org.eclipse.ui.IViewSite;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.wst.server.core.IPublishListener;
import org.eclipse.wst.server.core.IServer;
@@ -43,7 +44,6 @@
import org.eclipse.wst.server.ui.internal.view.servers.ServerAction;
import org.eclipse.wst.server.ui.internal.view.servers.ServerActionHelper;
import org.eclipse.wst.server.ui.internal.view.servers.ServerTableLabelProvider;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
/**
* Tree view showing servers and their associations.
* This is for the TOP window
@@ -64,7 +64,7 @@
protected ServerTableLabelProvider2 labelProvider;
//protected ISelectionListener dsListener;
- protected StrippedServerView view;
+ protected IViewSite viewSite;
protected class ServerTableLabelProvider2 extends ServerTableLabelProvider {
private int myCount = 0;
@@ -152,9 +152,9 @@
* @param view the view
* @param tree the tree
*/
- public ServerTableViewer(final StrippedServerView view, final Tree tree) {
+ public ServerTableViewer(final IViewSite site, final Tree tree) {
super(tree);
- this.view = view;
+ this.viewSite = site;
setContentProvider(new TrimmedServerContentProvider());
labelProvider = new ServerTableLabelProvider2();
@@ -179,7 +179,7 @@
addListeners();
- IActionBars actionBars = view.getViewSite().getActionBars();
+ IActionBars actionBars = viewSite.getActionBars();
actionBars.setGlobalActionHandler(ActionFactory.DELETE.getId(), new ServerAction(getControl().getShell(), this, "Delete it!", ServerActionHelper.ACTION_DELETE));
}
@@ -352,7 +352,7 @@
String serverId = server.getId();
publishing.remove(serverId);
- view.getViewSite().getActionBars().getStatusLineManager().setMessage(null, null);
+ viewSite.getActionBars().getStatusLineManager().setMessage(null, null);
}
protected void addServer(final IServer server) {
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/StrippedServerView.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/StrippedServerView.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/StrippedServerView.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -1,315 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.views.server;
-
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.ui.IDebugUIConstants;
-import org.eclipse.debug.ui.IDebugView;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.swt.widgets.TreeItem;
-import org.eclipse.ui.IMemento;
-import org.eclipse.ui.IViewSite;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.part.ViewPart;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.Trace;
-import org.eclipse.wst.server.ui.internal.ContextIds;
-import org.eclipse.wst.server.ui.internal.Messages;
-import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
-import org.eclipse.wst.server.ui.internal.actions.NewServerWizardAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PublishAction;
-import org.eclipse.wst.server.ui.internal.view.servers.PublishCleanAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StartAction;
-import org.eclipse.wst.server.ui.internal.view.servers.StopAction;
-import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
-
-public class StrippedServerView extends ViewPart {
- private static final String TAG_COLUMN_WIDTH = "columnWidth";
-
- protected int[] cols;
-
- protected Tree treeTable;
- protected ServerTableViewer tableViewer;
-
- // actions on a server
- protected Action[] actions;
- protected MenuManager restartMenu;
-
- protected Action newServerAction;
-
- /**
- * ServersView constructor comment.
- */
- public StrippedServerView() {
- super();
- }
-
- /**
- * createPartControl method comment.
- *
- * @param parent a parent composite
- */
- public void createPartControl(Composite parent) {
- treeTable = new Tree(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.NONE);
- treeTable.setHeaderVisible(true);
- treeTable.setLinesVisible(false);
- treeTable.setLayoutData(new GridData(GridData.FILL_BOTH));
- treeTable.setFont(parent.getFont());
- PlatformUI.getWorkbench().getHelpSystem().setHelp(treeTable, ContextIds.VIEW_SERVERS);
-
- // add columns
- TreeColumn column = new TreeColumn(treeTable, SWT.SINGLE);
- column.setText(Messages.viewServer);
- column.setWidth(cols[0]);
-
- TreeColumn column2 = new TreeColumn(treeTable, SWT.SINGLE);
- column2.setText(Messages.viewStatus);
- column2.setWidth(cols[1]);
-
-// TreeColumn column3 = new TreeColumn(treeTable, SWT.SINGLE);
-// column3.setText(Messages.viewSync);
-// column3.setWidth(cols[2]);
-
- tableViewer = new ServerTableViewer(this, treeTable);
- initializeActions(tableViewer);
-
- treeTable.addSelectionListener(new SelectionAdapter() {
- public void widgetSelected(SelectionEvent event) {
- try {
- } catch (Exception e) {
- getViewSite().getActionBars().getStatusLineManager().setMessage(null, "");
- }
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- try {
- TreeItem item = treeTable.getSelection()[0];
- Object data = item.getData();
- if (!(data instanceof IServer))
- return;
- IServer server = (IServer) data;
- ServerUIPlugin.editServer(server);
- } catch (Exception e) {
- Trace.trace(Trace.SEVERE, "Could not open server", e);
- }
- }
- });
-
- MenuManager menuManager = new MenuManager("#PopupMenu");
- menuManager.setRemoveAllWhenShown(true);
- final Shell shell = treeTable.getShell();
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager mgr) {
- fillContextMenu(shell, mgr);
- }
- });
- Menu menu = menuManager.createContextMenu(parent);
- treeTable.setMenu(menu);
- getSite().registerContextMenu(menuManager, tableViewer);
- getSite().setSelectionProvider(tableViewer);
- }
-
- public void init(IViewSite site, IMemento memento) throws PartInitException {
- super.init(site, memento);
- cols = new int[2];
- for (int i = 0; i < 2; i++) {
- cols[i] = 100;
- if (memento != null) {
- Integer in = memento.getInteger(TAG_COLUMN_WIDTH + i);
- if (in != null && in.intValue() > 5)
- cols[i] = in.intValue();
- }
- }
- }
-
- public void saveState(IMemento memento) {
- TreeColumn[] tc = treeTable.getColumns();
- for (int i = 0; i < 2; i++) {
- int width = tc[i].getWidth();
- if (width != 0)
- memento.putInteger(TAG_COLUMN_WIDTH + i, width);
- }
- }
-
- protected void selectServerProcess(Object process) {
- IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow() ;
- if (window != null) {
- IWorkbenchPage page = window.getActivePage();
- if (page != null) {
- IWorkbenchPart part = page.findView(IDebugUIConstants.ID_DEBUG_VIEW);
- if (part != null) {
- IDebugView view = (IDebugView)part.getAdapter(IDebugView.class);
- if (view != null) {
- Viewer viewer = view.getViewer();
- if (viewer != null) {
- viewer.setSelection(new StructuredSelection(process));
- }
- }
- }
- }
- }
- }
-
- /**
- * Initialize actions
- *
- * @param provider a selection provider
- */
- public void initializeActions(ISelectionProvider provider) {
- Shell shell = getSite().getShell();
-
- actions = new Action[6];
- // create the start actions
- actions[0] = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
- actions[1] = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
- actions[2] = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
-
- // create the stop action
- actions[3] = new StopAction(shell, provider);
-
- // create the publish actions
- actions[4] = new PublishAction(shell, provider);
- actions[5] = new PublishCleanAction(shell, provider);
-
- // add toolbar buttons
- IContributionManager cm = getViewSite().getActionBars().getToolBarManager();
- for (int i = 0; i < actions.length - 1; i++)
- cm.add(actions[i]);
-
-// // create the debug action
-// Action debugAction = new StartAction(shell, provider, ILaunchManager.DEBUG_MODE);
-// debugAction.setToolTipText(Messages.actionDebugToolTip);
-// debugAction.setText(Messages.actionDebug);
-// debugAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
-// debugAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
-// debugAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
-//
-// // create the start action
-// Action runAction = new StartAction(shell, provider, ILaunchManager.RUN_MODE);
-// runAction.setToolTipText(Messages.actionStartToolTip);
-// runAction.setText(Messages.actionStart);
-// runAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
-// runAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
-// runAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
-//
-// // create the profile action
-// Action profileAction = new StartAction(shell, provider, ILaunchManager.PROFILE_MODE);
-// profileAction.setToolTipText(Messages.actionProfileToolTip);
-// profileAction.setText(Messages.actionProfile);
-// profileAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_PROFILE));
-// profileAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_PROFILE));
-// profileAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_PROFILE));
-//
-// // create the restart menu
-// restartMenu = new MenuManager(Messages.actionRestart);
-//
-// Action restartAction = new RestartAction(shell, provider, ILaunchManager.DEBUG_MODE);
-// restartAction.setToolTipText(Messages.actionDebugToolTip);
-// restartAction.setText(Messages.actionDebug);
-// restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_DEBUG));
-// restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_DEBUG));
-// restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_DEBUG));
-// restartMenu.add(restartAction);
-//
-// restartAction = new RestartAction(shell, provider, ILaunchManager.RUN_MODE);
-// restartAction.setToolTipText(Messages.actionRestartToolTip);
-// restartAction.setText(Messages.actionStart);
-// restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START));
-// restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START));
-// restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START));
-// restartMenu.add(restartAction);
-//
-// restartAction = new RestartAction(shell, provider, "restartProfile", ILaunchManager.PROFILE_MODE);
-// restartAction.setToolTipText(Messages.actionRestartToolTip);
-// restartAction.setText(Messages.actionProfile);
-// restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_START_PROFILE));
-// restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_START_PROFILE));
-// restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_START_PROFILE));
-// restartMenu.add(restartAction);
-//
-// // create the restart action
-// restartAction = new RestartAction(shell, provider, "restart");
-// restartAction.setToolTipText(Messages.actionRestartToolTip);
-// restartAction.setText(Messages.actionRestart);
-// restartAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_RESTART));
-// restartAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_RESTART));
-// restartAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_RESTART));
-//
-// // create the stop action
-// Action stopAction = new StopAction(shell, provider, "stop");
-// stopAction.setToolTipText(Messages.actionStopToolTip);
-// stopAction.setText(Messages.actionStop);
-// stopAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_STOP));
-// stopAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_STOP));
-// stopAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_STOP));
-//
-// // create the publish action
-// Action publishAction = new PublishAction(shell, provider, "publish");
-// publishAction.setToolTipText(Messages.actionPublishToolTip);
-// publishAction.setText(Messages.actionPublish);
-// publishAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ELCL_PUBLISH));
-// publishAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CLCL_PUBLISH));
-// publishAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DLCL_PUBLISH));
-//
-// // create the module slosh dialog action
-// Action addModuleAction = new ModuleSloshAction(shell, provider, "modules");
-// addModuleAction.setToolTipText(Messages.actionModifyModulesToolTip);
-// addModuleAction.setText(Messages.actionModifyModules);
-// addModuleAction.setImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_ETOOL_MODIFY_MODULES));
-// addModuleAction.setHoverImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_CTOOL_MODIFY_MODULES));
-// addModuleAction.setDisabledImageDescriptor(ImageResource.getImageDescriptor(ImageResource.IMG_DTOOL_MODIFY_MODULES));
-//
-// actions = new Action[7];
-// actions[0] = debugAction;
-// actions[1] = runAction;
-// actions[2] = profileAction;
-// actions[3] = restartAction;
-// actions[4] = stopAction;
-// actions[5] = publishAction;
-// actions[6] = addModuleAction;
-//
-// // add toolbar buttons
-// IContributionManager cm = getViewSite().getActionBars().getToolBarManager();
-// for (int i = 0; i < actions.length - 1; i++) {
-// cm.add(actions[i]);
-// }
-
- newServerAction = new Action() {
- public void run() {
- IAction newServerAction = new NewServerWizardAction();
- newServerAction.run();
- }
- };
- newServerAction.setText("New Server");
- newServerAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.GENERIC_SERVER_IMAGE));
- }
-
- protected void fillContextMenu(Shell shell, IMenuManager menu) {
- }
-
- /**
- *
- */
- public void setFocus() {
- if (treeTable != null)
- treeTable.setFocus();
- }
-}
\ No newline at end of file
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/TwiddlePollerListener.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/TwiddlePollerListener.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/TwiddlePollerListener.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -1,37 +0,0 @@
-package org.jboss.ide.eclipse.as.ui.views.server;
-
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.MessageBox;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.runtime.server.IServerPollerTimeoutListener;
-import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
-
-public class TwiddlePollerListener implements IServerPollerTimeoutListener {
- public static final String key = "org.jboss.ide.eclipse.as.ui.preferencepages.TwiddlePollerListener";
- public void serverTimedOut(IServer server, boolean expectedState) {
- if( expectedState && firstEverTimeout()) {
- IPreferenceStore store = JBossServerUIPlugin.getDefault().getPreferenceStore();
- store.setValue(key, 2);
-
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- MessageBox box = new MessageBox(new Shell());
- box.setMessage("The Poller has timed out");
- box.setText("Twiddle Poller Timed Out");
- box.open();
- }
- });
- }
- }
-
- protected boolean firstEverTimeout() {
- return true;
-// IPreferenceStore store = JBossServerUIPlugin.getDefault().getPreferenceStore();
-// int val = store.getInt(key);
-// if( val == 2 ) return false;
-// return true;
- }
-
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/JBossServerViewExtension.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -14,7 +14,7 @@
import org.jboss.ide.eclipse.as.core.server.attributes.IDeployableServer;
import org.jboss.ide.eclipse.as.ui.preferencepages.ViewProviderPreferenceComposite;
import org.jboss.ide.eclipse.as.ui.views.server.JBossServerView;
-import org.jboss.ide.eclipse.as.ui.views.server.JBossServerTableViewer.ContentWrapper;
+import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
public abstract class JBossServerViewExtension {
protected ServerViewProvider provider;
@@ -72,7 +72,7 @@
}
protected void suppressingRefresh(Runnable runnable) {
- JBossServerView.getDefault().getJBViewer().suppressingRefresh(runnable);
+ JBossServerView.getDefault().getExtensionFrame().getViewer().suppressingRefresh(runnable);
}
protected void refreshViewer() {
@@ -84,9 +84,9 @@
if( isEnabled() ) {
try {
if( o == null )
- JBossServerView.getDefault().getJBViewer().refresh(provider);
+ JBossServerView.getDefault().getServerFrame().getViewer().refresh(provider);
else
- JBossServerView.getDefault().getJBViewer().refresh(new ContentWrapper(o, provider));
+ JBossServerView.getDefault().getServerFrame().getViewer().refresh(new ContentWrapper(o, provider));
} catch(Exception e) {
}
}
@@ -98,10 +98,10 @@
r.run();
}
protected void removeElement(Object o) {
- JBossServerView.getDefault().getJBViewer().remove(new ContentWrapper(o, provider));
+ JBossServerView.getDefault().getServerFrame().getViewer().remove(new ContentWrapper(o, provider));
}
protected void addElement(Object parent, Object child) {
- JBossServerView.getDefault().getJBViewer().add(new ContentWrapper(parent, provider), new ContentWrapper(child, provider));
+ JBossServerView.getDefault().getServerFrame().getViewer().add(new ContentWrapper(parent, provider), new ContentWrapper(child, provider));
}
// what servers should i show for?
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/PropertySheetFactory.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -26,8 +26,8 @@
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.views.properties.IPropertySheetPage;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.ui.views.server.JBossServerTableViewer;
-import org.jboss.ide.eclipse.as.ui.views.server.JBossServerTableViewer.ContentWrapper;
+import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer;
+import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
public class PropertySheetFactory {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/DescriptorXPathViewProvider.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -102,7 +102,7 @@
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathCategoryDialog;
import org.jboss.ide.eclipse.as.ui.dialogs.XPathDialogs.XPathDialog;
import org.jboss.ide.eclipse.as.ui.preferencepages.ViewProviderPreferenceComposite;
-import org.jboss.ide.eclipse.as.ui.views.server.JBossServerTableViewer.ContentWrapper;
+import org.jboss.ide.eclipse.as.ui.views.server.ExtensionTableViewer.ContentWrapper;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.JBossServerViewExtension;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.ServerViewProvider;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java 2007-07-05 17:43:10 UTC (rev 2332)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/InactiveExtensionViewProvider.java 2007-07-05 18:03:51 UTC (rev 2333)
@@ -116,10 +116,10 @@
if( selected instanceof ServerViewProvider) {
((ServerViewProvider)selected).setEnabled(true);
((ServerViewProvider)selected).getDelegate().getContentProvider().
- inputChanged(JBossServerView.getDefault().getJBViewer(), null, JBossServerView.getDefault().getSelectedServer());
+ inputChanged(JBossServerView.getDefault().getServerFrame().getViewer(), null, JBossServerView.getDefault().getSelectedServer());
try {
- JBossServerView.getDefault().getJBViewer().refresh();
+ JBossServerView.getDefault().getServerFrame().getViewer().refresh();
} catch(Exception e) {
}
}
17 years, 5 months