JBoss Tools SVN: r9510 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-08-05 03:55:41 -0400 (Tue, 05 Aug 2008)
New Revision: 9510
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
code adjustment
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-08-05 07:54:36 UTC (rev 9509)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-08-05 07:55:41 UTC (rev 9510)
@@ -45,7 +45,7 @@
private static final long MAX_IDLE = 30*60*1000L;
- @SuppressWarnings("restriction")
+
static void importProjectIntoWorkspace(String path, String projectName) {
IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(
@@ -172,7 +172,7 @@
while (!Job.getJobManager().isIdle()) {
delay(500);
if ( (System.currentTimeMillis()-start) > MAX_IDLE )
- throw new RuntimeException("A long running task detected");
+ throw new RuntimeException("A long running task detected"); //$NON-NLS-1$
}
}
17 years, 5 months
JBoss Tools SVN: r9509 - trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-08-05 03:54:36 -0400 (Tue, 05 Aug 2008)
New Revision: 9509
Modified:
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
code adjustment, throws declaration of IllegalArgumentException was removed
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-08-05 07:13:20 UTC (rev 9508)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-08-05 07:54:36 UTC (rev 9509)
@@ -258,7 +258,7 @@
* @return offcet in document
* @throws IllegalArgumentException
*/
- public static final int getLinePositionOffcet(ITextViewer textViewer, int lineIndex, int linePosition) throws IllegalArgumentException {
+ public static final int getLinePositionOffcet(ITextViewer textViewer, int lineIndex, int linePosition) {
int resultOffcet = 0;
17 years, 5 months
JBoss Tools SVN: r9508 - trunk/ws/docs/reference.
by jbosstools-commits@lists.jboss.org
Author: Grid.Qian
Date: 2008-08-05 03:13:20 -0400 (Tue, 05 Aug 2008)
New Revision: 9508
Added:
trunk/ws/docs/reference/pom.xml
Log:
add pom.xml for ws docs
Added: trunk/ws/docs/reference/pom.xml
===================================================================
--- trunk/ws/docs/reference/pom.xml (rev 0)
+++ trunk/ws/docs/reference/pom.xml 2008-08-05 07:13:20 UTC (rev 9508)
@@ -0,0 +1,107 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.jboss.tools</groupId>
+ <artifactId>ws-ref-guide-${translation}</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>jdocbook</packaging>
+ <name>WS_Reference_Guide</name>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jboss.maven.plugins</groupId>
+ <artifactId>maven-jdocbook-plugin</artifactId>
+ <version>2.1.0-200803311251UTC-MPJDOCBOOK-8</version>
+
+ <extensions>true</extensions>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-docbook-xslt</artifactId>
+ <version>1.1.0</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossorg-jdocbook-style</artifactId>
+ <version>1.1.0</version>
+ <type>jdocbook-style</type>
+ </dependency>
+ </dependencies>
+
+ <configuration>
+ <sourceDocumentName>master.xml</sourceDocumentName>
+ <sourceDirectory>${pom.basedir}/en</sourceDirectory>
+ <imageResource>
+ <directory>${pom.basedir}/en</directory>
+ <includes>
+ <include>images/**/*</include>
+ </includes>
+ </imageResource>
+ <cssResource>
+ <directory>${pom.basedir}/${cssdir}</directory>
+ </cssResource>
+
+ <formats>
+ <format>
+ <formatName>pdf</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/pdf.xsl</stylesheetResource>
+ <finalName>${pom.name}.pdf</finalName>
+ </format>
+ <format>
+ <formatName>html</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>html_single</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/xhtml-single.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ <format>
+ <formatName>eclipse</formatName>
+ <stylesheetResource>file:${pom.basedir}/${stylesdir}/xslt/org/jboss/tools/eclipse.xsl</stylesheetResource>
+ <finalName>index.html</finalName>
+ </format>
+ </formats>
+
+ <options>
+ <xincludeSupported>true</xincludeSupported>
+ <xmlTransformerType>saxon</xmlTransformerType>
+ <!-- needed for uri-resolvers; can be ommitted if using 'current' uri scheme -->
+ <!-- could also locate the docbook dependency and inspect its version... -->
+ <docbookVersion>1.72.0</docbookVersion>
+ </options>
+
+ </configuration>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <distributionManagement>
+ <repository>
+ <!-- Copy the dist to the local checkout of the JBoss maven2 repo ${maven.repository.root} -->
+ <!-- It is anticipated that ${maven.repository.root} be set in user's settings.xml -->
+ <!-- todo : replace this with direct svn access once the svnkit providers are available -->
+ <id>repository.jboss.org</id>
+ <url>file://${maven.repository.root}</url>
+ </repository>
+ <snapshotRepository>
+ <id>snapshots.jboss.org</id>
+ <name>JBoss Snapshot Repository</name>
+ <url>dav:https://snapshots.jboss.org/maven2</url>
+ </snapshotRepository>
+ </distributionManagement>
+
+ <properties>
+ <stylesdir>../../../documentation/jbosstools-docbook-xslt/src/main/resources/</stylesdir>
+ <cssdir>../../../documentation/jbosstools-jdocbook-style/src/main/org/css/</cssdir>
+ <translation>en-US</translation>
+ </properties>
+
+</project>
17 years, 5 months
JBoss Tools SVN: r9507 - trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dennyxu
Date: 2008-08-05 02:50:24 -0400 (Tue, 05 Aug 2008)
New Revision: 9507
Modified:
trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
Log:
JBIDE-2587: fixed the jboss web service facet installing error
Modified: trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java
===================================================================
--- trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-08-05 00:52:07 UTC (rev 9506)
+++ trunk/ws/plugins/org.jboss.tools.ws.creation.ui/src/org/jboss/tools/ws/creation/ui/project/facet/JBossWSFacetInstallPage.java 2008-08-05 06:50:24 UTC (rev 9507)
@@ -259,7 +259,7 @@
if(selectedJbws != null){
cmRuntime.select(selectIndex);
saveJBosswsRuntimeToModel(selectedJbws);
- }else{
+ }else if(defaultJbws != null){
cmRuntime.select(defaultIndex);
saveJBosswsRuntimeToModel(defaultJbws);
}
17 years, 5 months
JBoss Tools SVN: r9506 - in trunk/portlet/plugins/org.jboss.tools.portlet.ui: src/org/jboss/tools/portlet/operations and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2008-08-04 20:52:07 -0400 (Mon, 04 Aug 2008)
New Revision: 9506
Added:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewSeamPortletWizard.java
Modified:
trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java
trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java
Log:
JBIDE-2234 JBoss Seam Portlet - created the Seam Portlet Wizard
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/plugin.xml 2008-08-05 00:52:07 UTC (rev 9506)
@@ -42,6 +42,15 @@
<description>Create a new JBoss JSF Portlet</description>
<selection class="org.eclipse.core.resources.IResource" />
</wizard>
+ <wizard
+ id="org.jboss.tools.portlet.ui.wizard.NewSeamPortletWizard"
+ name="JBoss Seam Portlet"
+ class="org.jboss.tools.portlet.ui.internal.wizard.NewSeamPortletWizard"
+ category="org.jboss.tools.jst.web/org.jboss.tools.portlet"
+ icon="icons/portlet_wiz.gif">
+ <description>Create a new JBoss Seam Portlet</description>
+ <selection class="org.eclipse.core.resources.IResource" />
+ </wizard>
</extension>
</plugin>
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/operations/AddPortletOperation.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -12,12 +12,14 @@
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IF_EXISTS;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.INSTANCE_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_SEAM_PORTLET;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.JBOSS_APP;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_REGION;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PARENT_PORTAL;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PORTLET_HEIGHT;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.INITIAL_WINDOW_STATE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.VIEW_MODE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.WINDOW_NAME;
@@ -96,7 +98,9 @@
@Override
protected NewJavaEEArtifactClassOperation getNewClassOperation() {
boolean isJSFPortlet = model.getBooleanProperty(IS_JSF_PORTLET);
- if (!isJSFPortlet) {
+ boolean isSeamPortlet = model.getBooleanProperty(IS_SEAM_PORTLET);
+
+ if (!isJSFPortlet && !isSeamPortlet) {
return new NewPortletClassOperation(getDataModel());
}
NewJavaEEArtifactClassOperation op = new NewJavaEEArtifactClassOperation(getDataModel()) {
@@ -275,6 +279,7 @@
String parent = model.getStringProperty(PARENT_PORTAL);;
String region = model.getStringProperty(PAGE_REGION);
String height = model.getStringProperty(PORTLET_HEIGHT);
+ String initialWindowState = model.getStringProperty(INITIAL_WINDOW_STATE);
IProject project = getTargetProject();
IVirtualComponent component = ComponentCore.createComponent(project);
@@ -318,6 +323,7 @@
addNode(document,window,"instance-ref",instanceId);
addNode(document,window,"region",region);
addNode(document,window,"height",height);
+ addNode(document,window,"initial-window-state",initialWindowState);
domModel.save();
} catch (Exception e) {
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/INewPortletClassDataModelProperties.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -41,6 +41,8 @@
static final String PORTLET_HEIGHT = "NewPortletClassDataModel.PORTLET_HEIGHT";
+ static final String INITIAL_WINDOW_STATE = "NewPortletClassDataModel.INITIAL_WINDOW_STATE";
+
static final String IF_EXISTS = "NewPortletClassDataModel.IF_EXISTS";
static final String ADD_PORTLET = "NewPortletClassDataModel.ADD_PORTLET";
@@ -53,5 +55,7 @@
static final String IS_JSF_PORTLET = "NewPortletClassDataModel.IS_JSF_PORTLET";
+ static final String IS_SEAM_PORTLET = "NewPortletClassDataModel.IS_SEAM_PORTLET";
+
static final String COPY_JSF_TEMPLATES = "NewPortletClassDataModel.COPY_JSF_TEMPLATES";
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/IPortletUIConstants.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -59,12 +59,16 @@
static final String PARENT_PORTAL_LABEL = "Parent Reference:";
static final String PAGE_REGION_LABEL = "Region:";
static final String PORTLET_HEIGHT_LABEL = "Height:";
+ static final String INITIAL_WINDOW_STATE_LABEL = "Initial Window State:";
static final String IF_EXISTS_LABEL = "If Exists:";
static final String NEW_JBOSS_JSF_PORTLET_WIZARD_PAGE_DESC = "Specify class file information";
static final String JBOSS_JSF_PORTLET_CLASS = "javax.portlet.faces.GenericFacesPortlet";
static final String JBOSS_JSF_PORTLET_NAME = "riPortlet";
+ static final String JBOSS_SEAM_PORTLET_NAME = "seamPortlet";
static final String JBOSS_JSF_DISPLAY_PORTLET_NAME = "JBoss JSF Portlet";
static final String JBOSS_JSF_PORTLET_TITLE = "JBoss JSF Portlet";
+ static final String JBOSS_SEAM_DISPLAY_PORTLET_NAME = "JBoss Seam Portlet";
+ static final String JBOSS_SEAM_PORTLET_TITLE = "JBoss Seam Portlet";
static final String JBOSS_APP_LABEL = "JBoss Application Name:";
static final String ADD_JBOSS_APP_LABEL = "Create JBoss Application";
static final String ADD_JBOSS_PORTLET_LABEL = "Add the jboss-portlet.xml file";
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddJBossPortletWizardPage.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -19,6 +19,7 @@
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.VALUE_TITLE;
import static org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties.PROJECT_NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_SEAM_PORTLET;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.INSTANCE_NAME;
@@ -31,6 +32,7 @@
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PAGE_REGION;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PARENT_PORTAL;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.PORTLET_HEIGHT;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.INITIAL_WINDOW_STATE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.JBOSS_APP;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.COPY_JSF_TEMPLATES;
@@ -41,6 +43,7 @@
import static org.jboss.tools.portlet.ui.IPortletUIConstants.PAGE_REGION_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.PARENT_PORTAL_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.PORTLET_HEIGHT_LABEL;
+import static org.jboss.tools.portlet.ui.IPortletUIConstants.INITIAL_WINDOW_STATE_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.JBOSS_APP_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.ADD_JBOSS_APP_LABEL;
import static org.jboss.tools.portlet.ui.IPortletUIConstants.ADD_JBOSS_PORTLET_LABEL;
@@ -137,7 +140,7 @@
Label ifExistsLabel = new Label(composite, SWT.LEFT);
ifExistsLabel.setText(IF_EXISTS_LABEL);
ifExistsLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- final Combo ifExistsCombo = new Combo(composite,SWT.NONE);
+ final Combo ifExistsCombo = new Combo(composite,SWT.READ_ONLY);
ifExistsCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
ifExistsCombo.setItems(new String[] {"overwrite","keep"});
synchHelper.synchCombo(ifExistsCombo, IF_EXISTS, null);
@@ -190,6 +193,15 @@
heightText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
synchHelper.synchText(heightText, PORTLET_HEIGHT, null);
+ // initial window state
+ Label initialWindowStateLabel = new Label(composite, SWT.LEFT);
+ initialWindowStateLabel.setText(INITIAL_WINDOW_STATE_LABEL);
+ initialWindowStateLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
+ final Combo initialWindowStateCombo = new Combo(composite,SWT.READ_ONLY);
+ initialWindowStateCombo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ initialWindowStateCombo.setItems(new String[] {"maximized","minimized","normal"});
+ synchHelper.synchCombo(initialWindowStateCombo, INITIAL_WINDOW_STATE, null);
+
addPortlet.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
@@ -203,7 +215,7 @@
}
});
- if (isJSFPortlet()) {
+ if (isJSFPortlet() || isSeamPortlet()) {
final Button addJBossApp = new Button(composite, SWT.CHECK);
addJBossApp.setText(ADD_JBOSS_APP_LABEL);
gd = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
@@ -258,4 +270,8 @@
protected boolean isJSFPortlet() {
return model.getBooleanProperty(IS_JSF_PORTLET);
}
+
+ protected boolean isSeamPortlet() {
+ return model.getBooleanProperty(IS_SEAM_PORTLET);
+ }
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/AddPortletWizardPage.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -24,6 +24,7 @@
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.NAME;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.TITLE;
import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_SEAM_PORTLET;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.Dialog;
@@ -118,6 +119,17 @@
initSection.setInput(initParamList);
}
+ if (isSeamPortlet()) {
+ List<String[]> initParamList = new ArrayList<String[]>();
+ String[] arrayString = new String[3];
+ arrayString[0]="javax.portlet.faces.defaultViewId.view";
+ arrayString[1]="/home.xhtml";
+ arrayString[2]="";
+ initParamList.add(arrayString);
+
+ initSection.setInput(initParamList);
+
+ }
String text = nameText.getText();
@@ -174,6 +186,9 @@
if (isJSFPortlet()) {
nameText.setText(IPortletUIConstants.JBOSS_JSF_PORTLET_NAME);
}
+ if (isSeamPortlet()) {
+ nameText.setText(IPortletUIConstants.JBOSS_SEAM_PORTLET_NAME);
+ }
// display name
Label displayNameLabel = new Label(composite, SWT.LEFT);
@@ -185,6 +200,10 @@
if (isJSFPortlet()) {
displayNameText.setText(IPortletUIConstants.JBOSS_JSF_DISPLAY_PORTLET_NAME);
}
+ if (isSeamPortlet()) {
+ displayNameText.setText(IPortletUIConstants.JBOSS_SEAM_DISPLAY_PORTLET_NAME);
+ }
+
// title
Label titleLabel = new Label(composite, SWT.LEFT);
titleLabel.setText(IPortletUIConstants.TITLE_LABEL);
@@ -195,6 +214,10 @@
if (isJSFPortlet()) {
titleText.setText(IPortletUIConstants.JBOSS_JSF_PORTLET_TITLE);
}
+ if (isSeamPortlet()) {
+ titleText.setText(IPortletUIConstants.JBOSS_SEAM_PORTLET_TITLE);
+ }
+
// description
Label descLabel = new Label(composite, SWT.LEFT);
descLabel.setText(DESCRIPTION_LABEL);
@@ -222,4 +245,8 @@
protected boolean isJSFPortlet() {
return model.getBooleanProperty(IS_JSF_PORTLET);
}
+
+ protected boolean isSeamPortlet() {
+ return model.getBooleanProperty(IS_SEAM_PORTLET);
+ }
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletClassWizardPage.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -6,6 +6,9 @@
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.BROWSE_BUTTON_LABEL;
import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.CLASS_NAME_LABEL;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_JSF_PORTLET;
+import static org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties.IS_SEAM_PORTLET;
+
import java.util.ArrayList;
import java.util.List;
@@ -117,13 +120,19 @@
getControl().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
IProject project = (IProject) model.getProperty(PROJECT);
IVirtualComponent component = ComponentCore.createComponent(project);
- MultiSelectFilteredFileSelectionDialog ms = new MultiSelectFilteredFileSelectionDialog(
- getShell(),
- "New JSF Portlet",
- "Choose a JSF portlet class:",
- new String[0],
- false,
- project);
+ MultiSelectFilteredFileSelectionDialog ms = null;
+ if (model.getBooleanProperty(IS_JSF_PORTLET)) {
+ ms = new MultiSelectFilteredFileSelectionDialog(
+ getShell(), "New JSF Portlet",
+ "Choose a JSF portlet class:", new String[0], false,
+ project);
+ }
+ if (model.getBooleanProperty(IS_SEAM_PORTLET)) {
+ ms = new MultiSelectFilteredFileSelectionDialog(
+ getShell(), "New Seam Portlet",
+ "Choose a Seam portlet class:", new String[0], false,
+ project);
+ }
IContainer root = component.getRootFolder().getUnderlyingFolder();
ms.setInput(root);
ms.open();
@@ -244,6 +253,13 @@
return result;
try {
result = FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.JSFPORTLET_FACET_ID);
+ if (!result) {
+ return result;
+ }
+ boolean isSeamProject = model.getBooleanProperty(IS_SEAM_PORTLET);
+ if (isSeamProject) {
+ result = FacetedProjectFramework.hasProjectFacet(project, IPortletConstants.SEAMPORTLET_FACET_ID);
+ }
} catch (CoreException ce) {
result = false;
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewJSFPortletWizard.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -79,7 +79,7 @@
@Override
protected IDataModelProvider getDefaultProvider() {
- return new NewPortletClassDataModelProvider(true);
+ return new NewPortletClassDataModelProvider(true,false);
}
}
Modified: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java 2008-08-04 20:42:10 UTC (rev 9505)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewPortletClassDataModelProvider.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -49,12 +49,15 @@
private boolean isJSFPortlet;
- public NewPortletClassDataModelProvider(boolean isJSFPortlet) {
+ private boolean isSeamPortlet;
+
+ public NewPortletClassDataModelProvider(boolean isJSFPortlet, boolean isSeamPortlet) {
this.isJSFPortlet = isJSFPortlet;
+ this.isSeamPortlet = isSeamPortlet;
}
public NewPortletClassDataModelProvider() {
- this(false);
+ this(false,false);
}
/**
@@ -107,12 +110,14 @@
propertyNames.add(PARENT_PORTAL);
propertyNames.add(PAGE_REGION);
propertyNames.add(PORTLET_HEIGHT);
+ propertyNames.add(INITIAL_WINDOW_STATE);
propertyNames.add(IF_EXISTS);
propertyNames.add(ADD_PORTLET);
propertyNames.add(ADD_JBOSS_APP);
propertyNames.add(ADD_JBOSS_PORTLET);
propertyNames.add(JBOSS_APP);
propertyNames.add(IS_JSF_PORTLET);
+ propertyNames.add(IS_SEAM_PORTLET);
propertyNames.add(COPY_JSF_TEMPLATES);
return propertyNames;
@@ -148,6 +153,11 @@
return Boolean.TRUE;
return Boolean.FALSE;
}
+ if (propertyName.equals(IS_SEAM_PORTLET)) {
+ if (isSeamPortlet)
+ return Boolean.TRUE;
+ return Boolean.FALSE;
+ }
if (propertyName.equals(COPY_JSF_TEMPLATES)) {
return Boolean.FALSE;
}
@@ -209,24 +219,42 @@
return Boolean.FALSE;
if (propertyName.equals(INSTANCE_NAME)) {
- return getDefaultProperty(NAME) + "Instance";
+ return getPortletPrefix() + "Instance";
}
if (propertyName.equals(WINDOW_NAME)) {
- return getDefaultProperty(NAME) + "Window";
+ return getPortletPrefix() + "Window";
}
if (propertyName.equals(PAGE_NAME)) {
+ if (isSeamPortlet) {
+ return "SeamPortlet";
+ }
+ if (isJSFPortlet) {
+ return "JSFPortlet";
+ }
return "";
}
if (propertyName.equals(PORTLET_HEIGHT)) {
return "1";
}
+ if (propertyName.equals(INITIAL_WINDOW_STATE)) {
+ return "maximized";
+ }
if (propertyName.equals(JBOSS_APP)) {
- return "riPortletApp";
+ if (isSeamPortlet) {
+ return "seamPortletApp";
+ }
+ if (isJSFPortlet) {
+ return "riPortletApp";
+ }
+ return "portletApp";
}
if (propertyName.equals(PAGE_REGION)) {
return "center";
}
if (propertyName.equals(PARENT_PORTAL)) {
+ if (isSeamPortlet || isJSFPortlet) {
+ return "default";
+ }
return "default.default";
}
if (propertyName.equals(IF_EXISTS)) {
@@ -237,13 +265,25 @@
return super.getDefaultProperty(propertyName);
}
+ private String getPortletPrefix() {
+ String prefix = null;
+ if (isSeamPortlet) {
+ prefix = "SeamPortlet";
+ } else if (isJSFPortlet) {
+ prefix = "JSFPortlet";
+ } else {
+ prefix = (String) getDefaultProperty(NAME);
+ }
+ return prefix;
+ }
+
@Override
public IStatus validate(String propertyName) {
// Validate super class
if (propertyName.equals(SUPERCLASS))
return validateSuperClassName(getStringProperty(propertyName));
- if (isJSFPortlet && propertyName.equals(CLASS_NAME)) {
+ if ((isJSFPortlet || isSeamPortlet) && propertyName.equals(CLASS_NAME)) {
if (getStringProperty(propertyName).length()!=0) {
return Status.OK_STATUS;
}
Added: trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewSeamPortletWizard.java
===================================================================
--- trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewSeamPortletWizard.java (rev 0)
+++ trunk/portlet/plugins/org.jboss.tools.portlet.ui/src/org/jboss/tools/portlet/ui/internal/wizard/NewSeamPortletWizard.java 2008-08-05 00:52:07 UTC (rev 9506)
@@ -0,0 +1,76 @@
+package org.jboss.tools.portlet.ui.internal.wizard;
+
+import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC;
+import static org.eclipse.jst.servlet.ui.internal.wizard.IWebWizardConstants.NEW_JAVA_CLASS_OPTIONS_WIZARD_PAGE_DESC;
+
+import java.lang.reflect.InvocationTargetException;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jst.servlet.ui.IWebUIContextIds;
+import org.eclipse.jst.servlet.ui.internal.wizard.NewServletClassOptionsWizardPage;
+import org.eclipse.jst.servlet.ui.internal.wizard.NewWebArtifactWizard;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
+import org.jboss.tools.portlet.ui.INewPortletClassDataModelProperties;
+import org.jboss.tools.portlet.ui.IPortletUIConstants;
+import org.jboss.tools.portlet.ui.PortletUIActivator;
+
+/**
+ * New portlet wizard
+ */
+public class NewSeamPortletWizard extends NewWebArtifactWizard {
+
+ public NewSeamPortletWizard() {
+ this(null);
+ }
+
+ public NewSeamPortletWizard(IDataModel model) {
+ super(model);
+ }
+
+ @Override
+ protected String getTitle() {
+ return IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE;
+ }
+
+ @Override
+ protected ImageDescriptor getImage() {
+ return PortletUIActivator.imageDescriptorFromPlugin(PortletUIActivator.PLUGIN_ID, "/icons/portlet_wiz.gif");
+ }
+
+ @Override
+ public void doAddPages() {
+ NewJSFPortletClassWizardPage page1 = new NewJSFPortletClassWizardPage(
+ getDataModel(),
+ PAGE_ONE,NEW_JAVA_CLASS_DESTINATION_WIZARD_PAGE_DESC,
+ IPortletUIConstants.NEW_PORTLET_WIZARD_PAGE_TITLE, IModuleConstants.JST_WEB_MODULE);
+ //page1.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_1);
+ addPage(page1);
+ AddPortletWizardPage page2 = new AddPortletWizardPage(getDataModel(), PAGE_TWO);
+ //page2.setInfopopID(IWebUIContextIds.WEBEDITOR_SERVLET_PAGE_ADD_SERVLET_WIZARD_2);
+ addPage(page2);
+ AddJBossPortletWizardPage page3 = new AddJBossPortletWizardPage(getDataModel(), PAGE_THREE);
+ addPage(page3);
+ }
+
+ @Override
+ protected void postPerformFinish() throws InvocationTargetException {
+ // open the portlet.xml file
+ IProject project = (IProject) getDataModel().getProperty(PROJECT);
+ IFile portletFile = PortletUIActivator.getPortletXmlFile(project);
+ if (portletFile == null) {
+ return;
+ }
+ openEditor(portletFile);
+ }
+
+ @Override
+ protected IDataModelProvider getDefaultProvider() {
+ return new NewPortletClassDataModelProvider(false,true);
+ }
+
+}
17 years, 5 months
JBoss Tools SVN: r9505 - trunk/core/tests/org.jboss.ide.eclipse.archives.test/inputs/archiveDescriptors/validation.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-08-04 16:42:10 -0400 (Mon, 04 Aug 2008)
New Revision: 9505
Added:
trunk/core/tests/org.jboss.ide.eclipse.archives.test/inputs/archiveDescriptors/validation/ReadVersion.xml
Log:
JBIDE-1406 - allowing version id's for the descriptor
Added: trunk/core/tests/org.jboss.ide.eclipse.archives.test/inputs/archiveDescriptors/validation/ReadVersion.xml
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/inputs/archiveDescriptors/validation/ReadVersion.xml (rev 0)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/inputs/archiveDescriptors/validation/ReadVersion.xml 2008-08-04 20:42:10 UTC (rev 9505)
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<packages version="1.2">
+</packages>
\ No newline at end of file
17 years, 5 months
JBoss Tools SVN: r9504 - in trunk/core: plugins/org.jboss.ide.eclipse.archives.core/src/xml and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-08-04 16:41:45 -0400 (Mon, 04 Aug 2008)
New Revision: 9504
Modified:
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackages.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackagesObjectProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/xml/packages.xsd
trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/XBUnmarshallTest.java
Log:
JBIDE-1406 - allowing version id's for the descriptor
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackages.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackages.java 2008-08-04 18:40:06 UTC (rev 9503)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackages.java 2008-08-04 20:41:45 UTC (rev 9504)
@@ -25,22 +25,33 @@
public class XbPackages extends XbPackageNodeWithProperties {
+ private float version;
public XbPackages () {
super();
}
- public XbPackages (XbPackages packages)
- {
+ public XbPackages (XbPackages packages) {
super(packages);
copyFrom(packages);
}
-
+ public void copyFrom (XbPackages node) {
+ super.copyFrom(node);
+ this.version = node.version;
+ }
+
protected Object clone() throws CloneNotSupportedException {
return new XbPackages(this);
}
- public List getPackages ()
- {
+ public List getPackages () {
return getChildren(XbPackage.class);
}
+
+ public float getVersion() {
+ return version;
+ }
+
+ public void setVersion(float version) {
+ this.version = version;
+ }
}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackagesObjectProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackagesObjectProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/main/org/jboss/ide/eclipse/archives/core/model/internal/xb/XbPackagesObjectProvider.java 2008-08-04 20:41:45 UTC (rev 9504)
@@ -72,7 +72,11 @@
public Object getAttributeValue(Object object, MarshallingContext context,
String namespaceURI, String localName) {
- if (object instanceof XbPackage) {
+ if( object instanceof XbPackages ) {
+ if("version".equals(localName))
+ return ((XbPackages)object).getVersion();
+ }
+ else if (object instanceof XbPackage) {
XbPackage pkg = (XbPackage)object;
if("id".equals(localName))
return pkg.getId();
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/xml/packages.xsd
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/xml/packages.xsd 2008-08-04 18:40:06 UTC (rev 9503)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.core/src/xml/packages.xsd 2008-08-04 20:41:45 UTC (rev 9504)
@@ -34,7 +34,8 @@
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="package" type="package-type"/>
<xsd:element maxOccurs="1" minOccurs="0" name="properties" type="properties-type"/>
- </xsd:sequence>
+ </xsd:sequence>
+ <xsd:attribute name="version" type="xsd:float" use="optional"/>
</xsd:complexType>
<xsd:complexType name="package-type">
Modified: trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/XBUnmarshallTest.java
===================================================================
--- trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/XBUnmarshallTest.java 2008-08-04 18:40:06 UTC (rev 9503)
+++ trunk/core/tests/org.jboss.ide.eclipse.archives.test/src/org/jboss/ide/eclipse/archives/test/model/XBUnmarshallTest.java 2008-08-04 20:41:45 UTC (rev 9504)
@@ -191,6 +191,11 @@
parse("MissingActionType.xml", false, failedMissingRequiredAtt("type"));
}
+ public void testReadPackagesVersion() {
+ XbPackages packs = parse("ReadVersion.xml", true, failedFalsePositiveRequiredAtt("exploded"));
+ assertEquals(new Float(packs.getVersion()), new Float(1.2));
+ }
+
/*
* Utility
17 years, 5 months
JBoss Tools SVN: r9503 - in trunk: core/plugins/org.jboss.ide.eclipse.archives.ui and 3 other directories.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2008-08-04 14:40:06 -0400 (Mon, 04 Aug 2008)
New Revision: 9503
Added:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java
Removed:
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesActionProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesContentProviderDelegate.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootBridgeContentProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootContentProvider.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java
Log:
moved a few files from one package to another
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/packages/PreviewPage.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -54,8 +54,8 @@
import org.eclipse.wst.server.core.internal.ServerPlugin;
import org.jboss.ide.eclipse.archives.core.model.IArchive;
import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate;
import org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider;
-import org.jboss.ide.eclipse.archives.ui.views.ArchivesContentProviderDelegate;
import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
import org.jboss.ide.eclipse.archives.ui.wizards.WizardPageWithNotification;
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/plugin.xml 2008-08-04 18:40:06 UTC (rev 9503)
@@ -104,7 +104,7 @@
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
activeByDefault="true"
- contentProvider="org.jboss.ide.eclipse.archives.ui.views.ArchivesRootContentProvider"
+ contentProvider="org.jboss.ide.eclipse.archives.ui.providers.ArchivesRootContentProvider"
icon="icons/jar_obj.gif"
id="org.jboss.ide.eclipse.archives.ui.archivesContent"
labelProvider="org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider"
@@ -124,12 +124,12 @@
</or>
</possibleChildren>
<actionProvider
- class="org.jboss.ide.eclipse.archives.ui.views.ArchivesActionProvider"
+ class="org.jboss.ide.eclipse.archives.ui.providers.ArchivesActionProvider"
id="org.jboss.ide.eclipse.archives.ui.views.ArchivesActionProvider1">
</actionProvider>
</navigatorContent>
<navigatorContent
- contentProvider="org.jboss.ide.eclipse.archives.ui.views.ArchivesRootBridgeContentProvider"
+ contentProvider="org.jboss.ide.eclipse.archives.ui.providers.ArchivesRootBridgeContentProvider"
icon="icons/jar_obj.gif"
id="org.jboss.ide.eclipse.archives.ui.archivesRootBridgeContent"
labelProvider="org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider"
@@ -141,7 +141,7 @@
</instanceof>
</triggerPoints>
<actionProvider
- class="org.jboss.ide.eclipse.archives.ui.views.ArchivesActionProvider"
+ class="org.jboss.ide.eclipse.archives.ui.providers.ArchivesActionProvider"
id="org.jboss.ide.eclipse.archives.ui.views.ArchivesActionProvider2">
</actionProvider>
<possibleChildren>
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java (from rev 9479, trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesActionProvider.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -0,0 +1,360 @@
+package org.jboss.ide.eclipse.archives.ui.providers;
+
+import java.util.Arrays;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.GroupMarker;
+import org.eclipse.jface.action.IMenuManager;
+import org.eclipse.jface.action.MenuManager;
+import org.eclipse.jface.action.Separator;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IInputValidator;
+import org.eclipse.jface.dialogs.InputDialog;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchActionConstants;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.navigator.CommonActionProvider;
+import org.eclipse.ui.navigator.ICommonActionExtensionSite;
+import org.eclipse.ui.navigator.ICommonViewerSite;
+import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
+import org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob;
+import org.jboss.ide.eclipse.archives.core.model.ArchiveNodeFactory;
+import org.jboss.ide.eclipse.archives.core.model.IArchive;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
+import org.jboss.ide.eclipse.archives.ui.ExtensionManager;
+import org.jboss.ide.eclipse.archives.ui.NodeContribution;
+import org.jboss.ide.eclipse.archives.ui.actions.NewArchiveAction;
+import org.jboss.ide.eclipse.archives.ui.wizards.FilesetWizard;
+import org.jboss.ide.eclipse.archives.ui.wizards.NewJARWizard;
+
+public class ArchivesActionProvider extends CommonActionProvider {
+ public static final String NEW_PACKAGE_MENU_ID = "org.jboss.ide.eclipse.archives.ui.newPackageMenu";
+ public static final String NODE_CONTEXT_MENU_ID = "org.jboss.ide.eclipse.archives.ui.nodeContextMenu";
+ public static final String NEW_PACKAGE_ADDITIONS = "newPackageAdditions";
+
+ private MenuManager newPackageManager;
+ private NodeContribution[] nodePopupMenuContributions;
+ private NewArchiveAction[] newPackageActions;
+ private Action editAction, deleteAction, newFolderAction, newFilesetAction;
+ private Action buildAction;
+ private ICommonViewerSite site;
+
+ public ArchivesActionProvider() {
+ }
+
+ public void init(ICommonActionExtensionSite aSite) {
+ newPackageActions = ExtensionManager.findNewArchiveActions();
+ nodePopupMenuContributions = ExtensionManager.findNodePopupMenuContributions();
+ Arrays.sort(nodePopupMenuContributions);
+ site = aSite.getViewSite();
+ createActions();
+ newPackageManager = new MenuManager(ArchivesUIMessages.ProjectPackagesView_newPackageMenu_label, NEW_PACKAGE_MENU_ID);
+ newPackageManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
+ }
+
+ public void fillContextMenu(IMenuManager manager) {
+ menuAboutToShow2(manager);
+ }
+
+ public void menuAboutToShow2(IMenuManager manager) {
+ addNewPackageActions(newPackageManager);
+
+ IStructuredSelection selection = getSelection();
+ if (selection != null && !selection.isEmpty()) {
+ Object element = selection.getFirstElement();
+
+ if (element instanceof IProject) {
+ manager.add(newPackageManager);
+ manager.add(buildAction);
+ buildAction.setText(ArchivesUIMessages.ProjectPackagesView_buildProjectAction_label);
+ } else if( element instanceof IArchiveNode ){
+ IArchiveNode node = (IArchiveNode)element;
+
+ if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE
+ || node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
+ manager.add(newPackageManager);
+ manager.add(newFolderAction);
+ manager.add(newFilesetAction);
+ manager.add(new Separator());
+ }
+
+ if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
+ editAction.setText(ArchivesUIMessages.ProjectPackagesView_editPackageAction_label);
+ deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label);
+ editAction.setImageDescriptor(ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE_EDIT));
+ buildAction.setText(ArchivesUIMessages.ProjectPackagesView_buildArchiveAction_label);
+ manager.add(buildAction);
+ } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
+ editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFolderAction_label);
+ deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deleteFolderAction_label);
+ editAction.setImageDescriptor(platformDescriptor(ISharedImages.IMG_OBJ_FOLDER));
+ } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
+ editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFilesetAction_label);
+ deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deleteFilesetAction_label);
+ editAction.setImageDescriptor(ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES));
+ }
+ manager.add(editAction);
+ manager.add(deleteAction);
+ addContextMenuContributions(node, manager);
+ }
+ } else {
+ manager.add(newPackageManager);
+ }
+ }
+
+ protected void createActions() {
+ newFolderAction = new Action(ArchivesUIMessages.ProjectPackagesView_newFolderAction_label, platformDescriptor(ISharedImages.IMG_OBJ_FOLDER)) { //$NON-NLS-1$
+ public void run () {
+ createFolder();
+ }
+ };
+
+ newFilesetAction = new Action(ArchivesUIMessages.ProjectPackagesView_newFilesetAction_label, ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES)) { //$NON-NLS-1$
+ public void run () {
+ createFileset();
+ }
+ };
+
+ deleteAction = new Action (ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label, platformDescriptor(ISharedImages.IMG_TOOL_DELETE)) { //$NON-NLS-1$
+ public void run () {
+ deleteSelectedNode();
+ }
+ };
+
+ editAction = new Action (ArchivesUIMessages.ProjectPackagesView_editPackageAction_label, ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE_EDIT)) { //$NON-NLS-1$
+ public void run () {
+ editSelectedNode();
+ }
+ };
+
+ buildAction = new Action("", ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_BUILD_PACKAGES)) {
+ public void run() {
+ buildSelectedNode(getSelectedObject());
+ }
+ };
+ }
+
+
+
+
+ private void addContextMenuContributions (final IArchiveNode context, IMenuManager mgr) {
+
+ for( int i = 0; i < nodePopupMenuContributions.length; i++ ) {
+ final NodeContribution contribution = nodePopupMenuContributions[i];
+ if ( contribution.getActionDelegate().isEnabledFor(context)) {
+ Action action = new Action () {
+ public String getId() {
+ return contribution.getId();
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return contribution.getIcon();
+ }
+
+ public String getText() {
+ return contribution.getLabel();
+ }
+
+ public void run() {
+ contribution.getActionDelegate().run(context);
+ }
+ };
+ mgr.add(action);
+ }
+ }
+ }
+
+
+ /**
+ * Adds the new package type actions (which come from an extension point)
+ * to the menu.
+ * @param manager
+ */
+ private void addNewPackageActions (IMenuManager manager) {
+ for( int i = 0; i < newPackageActions.length; i++ ) {
+ NewArchiveAction action = newPackageActions[i];
+ ActionWrapper wrapped = new ActionWrapper(action);
+ wrapped.selectionChanged(getSelection());
+ manager.add(wrapped);
+ }
+ }
+
+ public class ActionWrapper extends Action {
+ private NewArchiveAction action;
+ public ActionWrapper(NewArchiveAction act) {
+ this.action = act;
+ }
+ public String getId() {
+ return action.getId();
+ }
+
+ public ImageDescriptor getImageDescriptor() {
+ return action.getIconDescriptor();
+ }
+
+ public String getText() {
+ return action.getLabel();
+ }
+
+ public void run() {
+ action.getAction().run(null);
+ }
+
+ public void selectionChanged(IStructuredSelection sel) {
+ action.getAction().selectionChanged(this, sel);
+ }
+ }
+
+
+ /*
+ * Methods below are called from the standard actions,
+ * the implementations of the action, where the action does its work etc
+ */
+
+ private void createFolder () {
+ IInputValidator validator = new IInputValidator () {
+ public String isValid(String newText) {
+ IArchiveNode selected = getSelectedNode();
+
+ boolean folderExists = false;
+ IArchiveNode[] folders = selected.getChildren(IArchiveNode.TYPE_ARCHIVE_FOLDER);
+ for (int i = 0; i < folders.length; i++) {
+ IArchiveFolder folder = (IArchiveFolder) folders[i];
+ if (folder.getName().equals(newText)) {
+ folderExists = true; break;
+ }
+ }
+
+ if (folderExists) {
+ return ArchivesUIMessages.bind(
+ ArchivesUIMessages.ProjectPackagesView_createFolderDialog_warnFolderExists, newText);
+
+ }
+ return null;
+ }
+ };
+
+ InputDialog dialog = new InputDialog(getShell(),
+ ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title,
+ ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, "", validator);
+
+ int response = dialog.open();
+ if (response == Dialog.OK) {
+ String[] folderPaths = dialog.getValue().split("[\\\\/]");
+ IArchiveNode selected = getSelectedNode();
+ IArchiveFolder current = null;
+ IArchiveFolder temp = null;
+
+ for(int i = folderPaths.length-1; i >= 0 ; i-- ) {
+ temp = ArchiveNodeFactory.createFolder();
+ temp.setName(folderPaths[i]);
+ if( current == null )
+ current = temp;
+ else {
+ temp.addChild(current);
+ current = temp;
+ }
+ }
+
+ selected.addChild(current);
+ new SaveArchivesJob(selected.getProjectPath()).schedule();
+ }
+ }
+
+ private void createFileset () {
+ IArchiveNode selected = getSelectedNode();
+ WizardDialog dialog = new WizardDialog(getShell(), new FilesetWizard(null, selected));
+ dialog.open();
+ }
+
+ private void editSelectedNode () {
+ IArchiveNode node = getSelectedNode();
+ if (node != null) {
+ if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
+ IArchiveFileSet fileset = (IArchiveFileSet) node;
+ WizardDialog dialog = new WizardDialog(getShell(), new FilesetWizard(fileset, node.getParent()));
+ dialog.open();
+ } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
+ IArchive pkg = (IArchive) node;
+ WizardDialog dialog = new WizardDialog(getShell(), new NewJARWizard(pkg));
+ dialog.open();
+ } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
+ // folder can do the model save here.
+ IArchiveFolder folder = (IArchiveFolder) node;
+ InputDialog dialog = new InputDialog(getShell(),
+ ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title,
+ ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, folder.getName(), null);
+
+ int response = dialog.open();
+ if (response == Dialog.OK) {
+ folder.setName(dialog.getValue());
+ new SaveArchivesJob(folder.getProjectPath()).schedule();
+ }
+ }
+ }
+ }
+
+ private void buildSelectedNode(final Object selected) {
+ new Job("Build Archive Node") {
+ protected IStatus run(IProgressMonitor monitor) {
+ if( selected == null ) return Status.OK_STATUS;
+ if (selected instanceof IArchiveNode &&
+ ((IArchiveNode)selected).getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
+ new ArchiveBuildDelegate().fullArchiveBuild((IArchive)selected);
+ } else if( selected != null && selected instanceof IProject ){
+ new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getProject().getLocation());
+ } else {
+ new ArchiveBuildDelegate().fullArchiveBuild(((IArchiveNode)selected).getRootArchive());
+ }
+ return Status.OK_STATUS;
+ }
+ }.schedule();
+ }
+
+ private void deleteSelectedNode () {
+ IArchiveNode node = getSelectedNode();
+ if (node != null) {
+ final IArchiveNode parent = (IArchiveNode) node.getParent();
+ parent.removeChild(node);
+ SaveArchivesJob job = new SaveArchivesJob(parent.getProjectPath());
+ job.schedule();
+ }
+ }
+
+
+ private IArchiveNode getSelectedNode () {
+ Object selected = getSelectedObject();
+ if( selected instanceof IArchiveNode )
+ return ((IArchiveNode)selected);
+ return null;
+ }
+ private Object getSelectedObject() {
+ IStructuredSelection selection = getSelection();
+ if (selection != null && !selection.isEmpty())
+ return selection.getFirstElement();
+ return null;
+ }
+ private IStructuredSelection getSelection() {
+ return (IStructuredSelection) site.getSelectionProvider().getSelection();
+ }
+
+ private ImageDescriptor platformDescriptor(String desc) {
+ return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(desc);
+ }
+ private Shell getShell() {
+ return site.getShell();
+ }
+}
Property changes on: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesActionProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java (from rev 9479, trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesContentProviderDelegate.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesContentProviderDelegate.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -0,0 +1,184 @@
+package org.jboss.ide.eclipse.archives.ui.providers;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Iterator;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.StructuredViewer;
+import org.eclipse.jface.viewers.TreeViewer;
+import org.eclipse.jface.viewers.Viewer;
+import org.eclipse.swt.widgets.Display;
+import org.jboss.ide.eclipse.archives.core.build.RegisterArchivesJob;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListener;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
+import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
+
+public class ArchivesContentProviderDelegate implements ITreeContentProvider, IArchiveModelListener {
+
+ // Because all viewers need to be updated, this must be a singleton
+ private static ArchivesContentProviderDelegate singleton;
+ public static ArchivesContentProviderDelegate getDefault() {
+ if( singleton == null )
+ singleton = new ArchivesContentProviderDelegate();
+ return singleton;
+ }
+
+ public static class WrappedProject {
+ public static final int NAME = 1;
+ public static final int CATEGORY = 2;
+ private IProject element;
+ private int type;
+ public WrappedProject(IProject element) { this.element = element; }
+ public WrappedProject(IProject element, int type) { this.element = element; this.type = type;}
+ public IProject getElement() { return element; }
+ public int getType() { return type; }
+ public boolean equals(Object otherObject) {
+ if( otherObject instanceof WrappedProject && element.equals(((WrappedProject)otherObject).element))
+ return true;
+ return false;
+ }
+ }
+
+ public static class DelayProxy {
+ public WrappedProject wProject;
+ public IProject project;
+ public DelayProxy(WrappedProject wp) {
+ this.wProject = wp;
+ this.project = wProject.element;
+ }
+ }
+
+ public ArchivesContentProviderDelegate() {
+ ArchivesModel.instance().addModelListener(this);
+ }
+ public ArchivesContentProviderDelegate(boolean addListener) {
+ if( addListener)
+ ArchivesModel.instance().addModelListener(this);
+ }
+
+ protected ArrayList<Viewer> viewersInUse = new ArrayList<Viewer>();
+ protected ArrayList<IProject> loadingProjects = new ArrayList<IProject>();
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof WrappedProject ) {
+ WrappedProject wp = (WrappedProject)parentElement;
+ IProject p = ((WrappedProject)parentElement).getElement();
+
+ // if currently loading, always send a delay
+ if( loadingProjects.contains(p))
+ return new Object[]{new DelayProxy(wp)};
+
+ if( ArchivesModel.instance().isProjectRegistered(p.getLocation()))
+ return ArchivesModel.instance().getRoot(p.getLocation()).getAllChildren();
+ if( ArchivesModel.instance().canReregister(p.getLocation())) {
+ loadingProjects.add(p);
+ DelayProxy dp = new DelayProxy(wp);
+ launchRegistrationThread(dp);
+ return new Object[]{dp};
+ }
+ }
+ if( parentElement instanceof IArchiveNode )
+ return ((IArchiveNode)parentElement).getAllChildren();
+ return new Object[0];
+ }
+
+
+ protected void launchRegistrationThread(final DelayProxy dp) {
+ Runnable callback = new Runnable() {
+ public void run() {
+ Display.getDefault().asyncExec(new Runnable() {
+ public void run() {
+ loadingProjects.remove(dp.project);
+ Iterator<Viewer> it = viewersInUse.iterator();
+ while(it.hasNext()) {
+ Viewer next = ((Viewer)it.next());
+ if( next instanceof StructuredViewer)
+ ((StructuredViewer)next).refresh(dp.wProject);
+ else
+ next.refresh();
+ }
+ }
+ });
+ }
+ };
+ RegisterArchivesJob job = new RegisterArchivesJob(new IProject[]{dp.project}, callback);
+ job.schedule();
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ if( element instanceof IArchiveNode )
+ return getChildren(element).length > 0;
+ if( element instanceof IResource )
+ return ArchivesModel.instance().canReregister(((IResource)element).getLocation());
+ return true;
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ ArchivesModel.instance().removeModelListener(this);
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ if( newInput != null) {
+ if( !viewersInUse.contains(viewer)) {
+ viewersInUse.add(viewer);
+ }
+ } else {
+ viewersInUse.remove(viewer);
+ }
+ }
+ public void modelChanged(IArchiveNodeDelta delta) {
+
+ final IArchiveNode[] topChanges;
+ if( delta.getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
+ topChanges = getChanges(delta);
+ else if( delta.getKind() == IArchiveNodeDelta.NO_CHANGE)
+ return;
+ else
+ topChanges = new IArchiveNode[]{delta.getPostNode()};
+
+ final Viewer[] viewers = (Viewer[]) viewersInUse.toArray(new Viewer[viewersInUse.size()]);
+
+ // now go through and refresh them
+ Display.getDefault().asyncExec(new Runnable () {
+ public void run () {
+ for( int i = 0; i < topChanges.length; i++ ) {
+ for (int j = 0; j < viewers.length; j++ ) {
+ if( viewers[j] instanceof StructuredViewer ) {
+ ((StructuredViewer)viewers[j]).refresh(topChanges[i]);
+ if( viewers[j] instanceof TreeViewer ) {
+ ((TreeViewer)viewers[j]).expandToLevel(topChanges[i], 1);
+ }
+ } else
+ viewers[j].refresh();
+ }
+ }
+ }
+ });
+ }
+
+ protected IArchiveNode[] getChanges(IArchiveNodeDelta delta) {
+
+ IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
+ ArrayList<IArchiveNode> list = new ArrayList<IArchiveNode>();
+ for( int i = 0; i < children.length; i++ ) {
+ if( children[i].getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
+ list.addAll(Arrays.asList(getChanges(children[i])));
+ else
+ list.add(children[i].getPostNode());
+ }
+ return list.toArray(new IArchiveNode[list.size()]);
+ }
+
+}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesLabelProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -12,8 +12,8 @@
import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
-import org.jboss.ide.eclipse.archives.ui.views.ArchivesContentProviderDelegate.DelayProxy;
-import org.jboss.ide.eclipse.archives.ui.views.ArchivesContentProviderDelegate.WrappedProject;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.DelayProxy;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
public class ArchivesLabelProvider extends BaseLabelProvider implements ILabelProvider {
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java (from rev 9479, trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootBridgeContentProvider.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -0,0 +1,39 @@
+package org.jboss.ide.eclipse.archives.ui.providers;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
+
+public class ArchivesRootBridgeContentProvider implements ITreeContentProvider {
+ private ArchivesContentProviderDelegate delegate;
+ public ArchivesRootBridgeContentProvider() {
+ delegate = ArchivesContentProviderDelegate.getDefault();
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ if( parentElement instanceof IProject )
+ return new Object[] { new WrappedProject((IProject)parentElement, WrappedProject.CATEGORY) };
+ return delegate.getChildren(parentElement);
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return delegate.hasChildren(element);
+ }
+
+ public Object[] getElements(Object inputElement) {
+ return getChildren(inputElement);
+ }
+
+ public void dispose() {
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ delegate.inputChanged(viewer, oldInput, newInput);
+ }
+
+}
Property changes on: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootBridgeContentProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java (from rev 9479, trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootContentProvider.java)
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java (rev 0)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -0,0 +1,70 @@
+package org.jboss.ide.eclipse.archives.ui.providers;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.jface.viewers.ITreeContentProvider;
+import org.eclipse.jface.viewers.Viewer;
+import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
+import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate.WrappedProject;
+import org.jboss.ide.eclipse.archives.ui.views.ProjectArchivesCommonView;
+
+public class ArchivesRootContentProvider implements ITreeContentProvider {
+ private ArchivesContentProviderDelegate delegate;
+ public ArchivesRootContentProvider() {
+ delegate = ArchivesContentProviderDelegate.getDefault();
+ }
+
+ public Object[] getChildren(Object parentElement) {
+ return delegate.getChildren(parentElement);
+ }
+
+ public Object getParent(Object element) {
+ return null;
+ }
+
+ public boolean hasChildren(Object element) {
+ return delegate.hasChildren(element);
+ }
+
+ public Object[] getElements(Object inputElement) {
+ if( showProjectRoot() ) {
+ if( showAllProjects() ) {
+ IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
+ ArrayList<IProject> tmp = new ArrayList<IProject>();
+ for( int i = 0; i < projects.length; i++ )
+ if( ArchivesModel.instance().canReregister(projects[i].getLocation()))
+ tmp.add(projects[i]);
+ return wrap((IProject[]) tmp.toArray(new IProject[tmp.size()]));
+ }
+ IProject cp = ProjectArchivesCommonView.getInstance().getCurrentProject();
+ if( cp != null )
+ return wrap(new IProject[]{cp});
+ }
+ return new Object[]{};
+ }
+
+ protected Object[] wrap(IProject[] objs) {
+ WrappedProject[] projs = new WrappedProject[objs.length];
+ for( int i = 0; i < projs.length; i++)
+ projs[i] = new WrappedProject(objs[i], WrappedProject.NAME);
+ return projs;
+ }
+
+ public void dispose() {
+ delegate.dispose();
+ }
+
+ public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
+ delegate.inputChanged(viewer, oldInput, newInput);
+ }
+
+ private boolean showProjectRoot () {
+ return PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_PROJECT_ROOT);
+ }
+ private boolean showAllProjects () {
+ return PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_ALL_PROJECTS);
+ }
+}
Property changes on: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/providers/ArchivesRootContentProvider.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesActionProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesActionProvider.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesActionProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -1,360 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.views;
-
-import java.util.Arrays;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.GroupMarker;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IInputValidator;
-import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonViewerSite;
-import org.jboss.ide.eclipse.archives.core.build.ArchiveBuildDelegate;
-import org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob;
-import org.jboss.ide.eclipse.archives.core.model.ArchiveNodeFactory;
-import org.jboss.ide.eclipse.archives.core.model.IArchive;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFileSet;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveFolder;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
-import org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages;
-import org.jboss.ide.eclipse.archives.ui.ExtensionManager;
-import org.jboss.ide.eclipse.archives.ui.NodeContribution;
-import org.jboss.ide.eclipse.archives.ui.actions.NewArchiveAction;
-import org.jboss.ide.eclipse.archives.ui.wizards.FilesetWizard;
-import org.jboss.ide.eclipse.archives.ui.wizards.NewJARWizard;
-
-public class ArchivesActionProvider extends CommonActionProvider {
- public static final String NEW_PACKAGE_MENU_ID = "org.jboss.ide.eclipse.archives.ui.newPackageMenu";
- public static final String NODE_CONTEXT_MENU_ID = "org.jboss.ide.eclipse.archives.ui.nodeContextMenu";
- public static final String NEW_PACKAGE_ADDITIONS = "newPackageAdditions";
-
- private MenuManager newPackageManager;
- private NodeContribution[] nodePopupMenuContributions;
- private NewArchiveAction[] newPackageActions;
- private Action editAction, deleteAction, newFolderAction, newFilesetAction;
- private Action buildAction;
- private ICommonViewerSite site;
-
- public ArchivesActionProvider() {
- }
-
- public void init(ICommonActionExtensionSite aSite) {
- newPackageActions = ExtensionManager.findNewArchiveActions();
- nodePopupMenuContributions = ExtensionManager.findNodePopupMenuContributions();
- Arrays.sort(nodePopupMenuContributions);
- site = aSite.getViewSite();
- createActions();
- newPackageManager = new MenuManager(ArchivesUIMessages.ProjectPackagesView_newPackageMenu_label, NEW_PACKAGE_MENU_ID);
- newPackageManager.add(new GroupMarker(IWorkbenchActionConstants.MB_ADDITIONS));
- }
-
- public void fillContextMenu(IMenuManager manager) {
- menuAboutToShow2(manager);
- }
-
- public void menuAboutToShow2(IMenuManager manager) {
- addNewPackageActions(newPackageManager);
-
- IStructuredSelection selection = getSelection();
- if (selection != null && !selection.isEmpty()) {
- Object element = selection.getFirstElement();
-
- if (element instanceof IProject) {
- manager.add(newPackageManager);
- manager.add(buildAction);
- buildAction.setText(ArchivesUIMessages.ProjectPackagesView_buildProjectAction_label);
- } else if( element instanceof IArchiveNode ){
- IArchiveNode node = (IArchiveNode)element;
-
- if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE
- || node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- manager.add(newPackageManager);
- manager.add(newFolderAction);
- manager.add(newFilesetAction);
- manager.add(new Separator());
- }
-
- if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- editAction.setText(ArchivesUIMessages.ProjectPackagesView_editPackageAction_label);
- deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label);
- editAction.setImageDescriptor(ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE_EDIT));
- buildAction.setText(ArchivesUIMessages.ProjectPackagesView_buildArchiveAction_label);
- manager.add(buildAction);
- } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFolderAction_label);
- deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deleteFolderAction_label);
- editAction.setImageDescriptor(platformDescriptor(ISharedImages.IMG_OBJ_FOLDER));
- } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
- editAction.setText(ArchivesUIMessages.ProjectPackagesView_editFilesetAction_label);
- deleteAction.setText(ArchivesUIMessages.ProjectPackagesView_deleteFilesetAction_label);
- editAction.setImageDescriptor(ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES));
- }
- manager.add(editAction);
- manager.add(deleteAction);
- addContextMenuContributions(node, manager);
- }
- } else {
- manager.add(newPackageManager);
- }
- }
-
- protected void createActions() {
- newFolderAction = new Action(ArchivesUIMessages.ProjectPackagesView_newFolderAction_label, platformDescriptor(ISharedImages.IMG_OBJ_FOLDER)) { //$NON-NLS-1$
- public void run () {
- createFolder();
- }
- };
-
- newFilesetAction = new Action(ArchivesUIMessages.ProjectPackagesView_newFilesetAction_label, ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_MULTIPLE_FILES)) { //$NON-NLS-1$
- public void run () {
- createFileset();
- }
- };
-
- deleteAction = new Action (ArchivesUIMessages.ProjectPackagesView_deletePackageAction_label, platformDescriptor(ISharedImages.IMG_TOOL_DELETE)) { //$NON-NLS-1$
- public void run () {
- deleteSelectedNode();
- }
- };
-
- editAction = new Action (ArchivesUIMessages.ProjectPackagesView_editPackageAction_label, ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_PACKAGE_EDIT)) { //$NON-NLS-1$
- public void run () {
- editSelectedNode();
- }
- };
-
- buildAction = new Action("", ArchivesSharedImages.getImageDescriptor(ArchivesSharedImages.IMG_BUILD_PACKAGES)) {
- public void run() {
- buildSelectedNode(getSelectedObject());
- }
- };
- }
-
-
-
-
- private void addContextMenuContributions (final IArchiveNode context, IMenuManager mgr) {
-
- for( int i = 0; i < nodePopupMenuContributions.length; i++ ) {
- final NodeContribution contribution = nodePopupMenuContributions[i];
- if ( contribution.getActionDelegate().isEnabledFor(context)) {
- Action action = new Action () {
- public String getId() {
- return contribution.getId();
- }
-
- public ImageDescriptor getImageDescriptor() {
- return contribution.getIcon();
- }
-
- public String getText() {
- return contribution.getLabel();
- }
-
- public void run() {
- contribution.getActionDelegate().run(context);
- }
- };
- mgr.add(action);
- }
- }
- }
-
-
- /**
- * Adds the new package type actions (which come from an extension point)
- * to the menu.
- * @param manager
- */
- private void addNewPackageActions (IMenuManager manager) {
- for( int i = 0; i < newPackageActions.length; i++ ) {
- NewArchiveAction action = newPackageActions[i];
- ActionWrapper wrapped = new ActionWrapper(action);
- wrapped.selectionChanged(getSelection());
- manager.add(wrapped);
- }
- }
-
- public class ActionWrapper extends Action {
- private NewArchiveAction action;
- public ActionWrapper(NewArchiveAction act) {
- this.action = act;
- }
- public String getId() {
- return action.getId();
- }
-
- public ImageDescriptor getImageDescriptor() {
- return action.getIconDescriptor();
- }
-
- public String getText() {
- return action.getLabel();
- }
-
- public void run() {
- action.getAction().run(null);
- }
-
- public void selectionChanged(IStructuredSelection sel) {
- action.getAction().selectionChanged(this, sel);
- }
- }
-
-
- /*
- * Methods below are called from the standard actions,
- * the implementations of the action, where the action does its work etc
- */
-
- private void createFolder () {
- IInputValidator validator = new IInputValidator () {
- public String isValid(String newText) {
- IArchiveNode selected = getSelectedNode();
-
- boolean folderExists = false;
- IArchiveNode[] folders = selected.getChildren(IArchiveNode.TYPE_ARCHIVE_FOLDER);
- for (int i = 0; i < folders.length; i++) {
- IArchiveFolder folder = (IArchiveFolder) folders[i];
- if (folder.getName().equals(newText)) {
- folderExists = true; break;
- }
- }
-
- if (folderExists) {
- return ArchivesUIMessages.bind(
- ArchivesUIMessages.ProjectPackagesView_createFolderDialog_warnFolderExists, newText);
-
- }
- return null;
- }
- };
-
- InputDialog dialog = new InputDialog(getShell(),
- ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title,
- ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, "", validator);
-
- int response = dialog.open();
- if (response == Dialog.OK) {
- String[] folderPaths = dialog.getValue().split("[\\\\/]");
- IArchiveNode selected = getSelectedNode();
- IArchiveFolder current = null;
- IArchiveFolder temp = null;
-
- for(int i = folderPaths.length-1; i >= 0 ; i-- ) {
- temp = ArchiveNodeFactory.createFolder();
- temp.setName(folderPaths[i]);
- if( current == null )
- current = temp;
- else {
- temp.addChild(current);
- current = temp;
- }
- }
-
- selected.addChild(current);
- new SaveArchivesJob(selected.getProjectPath()).schedule();
- }
- }
-
- private void createFileset () {
- IArchiveNode selected = getSelectedNode();
- WizardDialog dialog = new WizardDialog(getShell(), new FilesetWizard(null, selected));
- dialog.open();
- }
-
- private void editSelectedNode () {
- IArchiveNode node = getSelectedNode();
- if (node != null) {
- if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET) {
- IArchiveFileSet fileset = (IArchiveFileSet) node;
- WizardDialog dialog = new WizardDialog(getShell(), new FilesetWizard(fileset, node.getParent()));
- dialog.open();
- } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- IArchive pkg = (IArchive) node;
- WizardDialog dialog = new WizardDialog(getShell(), new NewJARWizard(pkg));
- dialog.open();
- } else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER) {
- // folder can do the model save here.
- IArchiveFolder folder = (IArchiveFolder) node;
- InputDialog dialog = new InputDialog(getShell(),
- ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title,
- ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, folder.getName(), null);
-
- int response = dialog.open();
- if (response == Dialog.OK) {
- folder.setName(dialog.getValue());
- new SaveArchivesJob(folder.getProjectPath()).schedule();
- }
- }
- }
- }
-
- private void buildSelectedNode(final Object selected) {
- new Job("Build Archive Node") {
- protected IStatus run(IProgressMonitor monitor) {
- if( selected == null ) return Status.OK_STATUS;
- if (selected instanceof IArchiveNode &&
- ((IArchiveNode)selected).getNodeType() == IArchiveNode.TYPE_ARCHIVE) {
- new ArchiveBuildDelegate().fullArchiveBuild((IArchive)selected);
- } else if( selected != null && selected instanceof IProject ){
- new ArchiveBuildDelegate().fullProjectBuild(((IProject)selected).getProject().getLocation());
- } else {
- new ArchiveBuildDelegate().fullArchiveBuild(((IArchiveNode)selected).getRootArchive());
- }
- return Status.OK_STATUS;
- }
- }.schedule();
- }
-
- private void deleteSelectedNode () {
- IArchiveNode node = getSelectedNode();
- if (node != null) {
- final IArchiveNode parent = (IArchiveNode) node.getParent();
- parent.removeChild(node);
- SaveArchivesJob job = new SaveArchivesJob(parent.getProjectPath());
- job.schedule();
- }
- }
-
-
- private IArchiveNode getSelectedNode () {
- Object selected = getSelectedObject();
- if( selected instanceof IArchiveNode )
- return ((IArchiveNode)selected);
- return null;
- }
- private Object getSelectedObject() {
- IStructuredSelection selection = getSelection();
- if (selection != null && !selection.isEmpty())
- return selection.getFirstElement();
- return null;
- }
- private IStructuredSelection getSelection() {
- return (IStructuredSelection) site.getSelectionProvider().getSelection();
- }
-
- private ImageDescriptor platformDescriptor(String desc) {
- return PlatformUI.getWorkbench().getSharedImages().getImageDescriptor(desc);
- }
- private Shell getShell() {
- return site.getShell();
- }
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesContentProviderDelegate.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesContentProviderDelegate.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesContentProviderDelegate.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -1,184 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.views;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Iterator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredViewer;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.swt.widgets.Display;
-import org.jboss.ide.eclipse.archives.core.build.RegisterArchivesJob;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveModelListener;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNode;
-import org.jboss.ide.eclipse.archives.core.model.IArchiveNodeDelta;
-
-public class ArchivesContentProviderDelegate implements ITreeContentProvider, IArchiveModelListener {
-
- // Because all viewers need to be updated, this must be a singleton
- private static ArchivesContentProviderDelegate singleton;
- public static ArchivesContentProviderDelegate getDefault() {
- if( singleton == null )
- singleton = new ArchivesContentProviderDelegate();
- return singleton;
- }
-
- public static class WrappedProject {
- public static final int NAME = 1;
- public static final int CATEGORY = 2;
- private IProject element;
- private int type;
- public WrappedProject(IProject element) { this.element = element; }
- public WrappedProject(IProject element, int type) { this.element = element; this.type = type;}
- public IProject getElement() { return element; }
- public int getType() { return type; }
- public boolean equals(Object otherObject) {
- if( otherObject instanceof WrappedProject && element.equals(((WrappedProject)otherObject).element))
- return true;
- return false;
- }
- }
-
- public static class DelayProxy {
- public WrappedProject wProject;
- public IProject project;
- public DelayProxy(WrappedProject wp) {
- this.wProject = wp;
- this.project = wProject.element;
- }
- }
-
- public ArchivesContentProviderDelegate() {
- ArchivesModel.instance().addModelListener(this);
- }
- public ArchivesContentProviderDelegate(boolean addListener) {
- if( addListener)
- ArchivesModel.instance().addModelListener(this);
- }
-
- protected ArrayList<Viewer> viewersInUse = new ArrayList<Viewer>();
- protected ArrayList<IProject> loadingProjects = new ArrayList<IProject>();
-
- public Object[] getChildren(Object parentElement) {
- if( parentElement instanceof WrappedProject ) {
- WrappedProject wp = (WrappedProject)parentElement;
- IProject p = ((WrappedProject)parentElement).getElement();
-
- // if currently loading, always send a delay
- if( loadingProjects.contains(p))
- return new Object[]{new DelayProxy(wp)};
-
- if( ArchivesModel.instance().isProjectRegistered(p.getLocation()))
- return ArchivesModel.instance().getRoot(p.getLocation()).getAllChildren();
- if( ArchivesModel.instance().canReregister(p.getLocation())) {
- loadingProjects.add(p);
- DelayProxy dp = new DelayProxy(wp);
- launchRegistrationThread(dp);
- return new Object[]{dp};
- }
- }
- if( parentElement instanceof IArchiveNode )
- return ((IArchiveNode)parentElement).getAllChildren();
- return new Object[0];
- }
-
-
- protected void launchRegistrationThread(final DelayProxy dp) {
- Runnable callback = new Runnable() {
- public void run() {
- Display.getDefault().asyncExec(new Runnable() {
- public void run() {
- loadingProjects.remove(dp.project);
- Iterator<Viewer> it = viewersInUse.iterator();
- while(it.hasNext()) {
- Viewer next = ((Viewer)it.next());
- if( next instanceof StructuredViewer)
- ((StructuredViewer)next).refresh(dp.wProject);
- else
- next.refresh();
- }
- }
- });
- }
- };
- RegisterArchivesJob job = new RegisterArchivesJob(new IProject[]{dp.project}, callback);
- job.schedule();
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- if( element instanceof IArchiveNode )
- return getChildren(element).length > 0;
- if( element instanceof IResource )
- return ArchivesModel.instance().canReregister(((IResource)element).getLocation());
- return true;
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public void dispose() {
- ArchivesModel.instance().removeModelListener(this);
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- if( newInput != null) {
- if( !viewersInUse.contains(viewer)) {
- viewersInUse.add(viewer);
- }
- } else {
- viewersInUse.remove(viewer);
- }
- }
- public void modelChanged(IArchiveNodeDelta delta) {
-
- final IArchiveNode[] topChanges;
- if( delta.getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
- topChanges = getChanges(delta);
- else if( delta.getKind() == IArchiveNodeDelta.NO_CHANGE)
- return;
- else
- topChanges = new IArchiveNode[]{delta.getPostNode()};
-
- final Viewer[] viewers = (Viewer[]) viewersInUse.toArray(new Viewer[viewersInUse.size()]);
-
- // now go through and refresh them
- Display.getDefault().asyncExec(new Runnable () {
- public void run () {
- for( int i = 0; i < topChanges.length; i++ ) {
- for (int j = 0; j < viewers.length; j++ ) {
- if( viewers[j] instanceof StructuredViewer ) {
- ((StructuredViewer)viewers[j]).refresh(topChanges[i]);
- if( viewers[j] instanceof TreeViewer ) {
- ((TreeViewer)viewers[j]).expandToLevel(topChanges[i], 1);
- }
- } else
- viewers[j].refresh();
- }
- }
- }
- });
- }
-
- protected IArchiveNode[] getChanges(IArchiveNodeDelta delta) {
-
- IArchiveNodeDelta[] children = delta.getAllAffectedChildren();
- ArrayList<IArchiveNode> list = new ArrayList<IArchiveNode>();
- for( int i = 0; i < children.length; i++ ) {
- if( children[i].getKind() == IArchiveNodeDelta.DESCENDENT_CHANGED)
- list.addAll(Arrays.asList(getChanges(children[i])));
- else
- list.add(children[i].getPostNode());
- }
- return list.toArray(new IArchiveNode[list.size()]);
- }
-
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootBridgeContentProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootBridgeContentProvider.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootBridgeContentProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -1,39 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.views;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.jboss.ide.eclipse.archives.ui.views.ArchivesContentProviderDelegate.WrappedProject;
-
-public class ArchivesRootBridgeContentProvider implements ITreeContentProvider {
- private ArchivesContentProviderDelegate delegate;
- public ArchivesRootBridgeContentProvider() {
- delegate = ArchivesContentProviderDelegate.getDefault();
- }
-
- public Object[] getChildren(Object parentElement) {
- if( parentElement instanceof IProject )
- return new Object[] { new WrappedProject((IProject)parentElement, WrappedProject.CATEGORY) };
- return delegate.getChildren(parentElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return delegate.hasChildren(element);
- }
-
- public Object[] getElements(Object inputElement) {
- return getChildren(inputElement);
- }
-
- public void dispose() {
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- delegate.inputChanged(viewer, oldInput, newInput);
- }
-
-}
Deleted: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootContentProvider.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootContentProvider.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/views/ArchivesRootContentProvider.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -1,69 +0,0 @@
-package org.jboss.ide.eclipse.archives.ui.views;
-
-import java.util.ArrayList;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.jboss.ide.eclipse.archives.core.model.ArchivesModel;
-import org.jboss.ide.eclipse.archives.ui.PrefsInitializer;
-import org.jboss.ide.eclipse.archives.ui.views.ArchivesContentProviderDelegate.WrappedProject;
-
-public class ArchivesRootContentProvider implements ITreeContentProvider {
- private ArchivesContentProviderDelegate delegate;
- public ArchivesRootContentProvider() {
- delegate = ArchivesContentProviderDelegate.getDefault();
- }
-
- public Object[] getChildren(Object parentElement) {
- return delegate.getChildren(parentElement);
- }
-
- public Object getParent(Object element) {
- return null;
- }
-
- public boolean hasChildren(Object element) {
- return delegate.hasChildren(element);
- }
-
- public Object[] getElements(Object inputElement) {
- if( showProjectRoot() ) {
- if( showAllProjects() ) {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- ArrayList<IProject> tmp = new ArrayList<IProject>();
- for( int i = 0; i < projects.length; i++ )
- if( ArchivesModel.instance().canReregister(projects[i].getLocation()))
- tmp.add(projects[i]);
- return wrap((IProject[]) tmp.toArray(new IProject[tmp.size()]));
- }
- IProject cp = ProjectArchivesCommonView.getInstance().getCurrentProject();
- if( cp != null )
- return wrap(new IProject[]{cp});
- }
- return new Object[]{};
- }
-
- protected Object[] wrap(IProject[] objs) {
- WrappedProject[] projs = new WrappedProject[objs.length];
- for( int i = 0; i < projs.length; i++)
- projs[i] = new WrappedProject(objs[i], WrappedProject.NAME);
- return projs;
- }
-
- public void dispose() {
- delegate.dispose();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- delegate.inputChanged(viewer, oldInput, newInput);
- }
-
- private boolean showProjectRoot () {
- return PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_PROJECT_ROOT);
- }
- private boolean showAllProjects () {
- return PrefsInitializer.getBoolean(PrefsInitializer.PREF_SHOW_ALL_PROJECTS);
- }
-}
Modified: trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java
===================================================================
--- trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java 2008-08-04 17:43:10 UTC (rev 9502)
+++ trunk/core/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/wizards/pages/DefaultJARConfigWizardPage.java 2008-08-04 18:40:06 UTC (rev 9503)
@@ -7,8 +7,8 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.jboss.ide.eclipse.archives.ui.ArchivesSharedImages;
+import org.jboss.ide.eclipse.archives.ui.providers.ArchivesContentProviderDelegate;
import org.jboss.ide.eclipse.archives.ui.providers.ArchivesLabelProvider;
-import org.jboss.ide.eclipse.archives.ui.views.ArchivesContentProviderDelegate;
import org.jboss.ide.eclipse.archives.ui.wizards.AbstractArchiveWizard;
import org.jboss.ide.eclipse.archives.ui.wizards.WizardPageWithNotification;
17 years, 5 months
JBoss Tools SVN: r9502 - trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-08-04 13:43:10 -0400 (Mon, 04 Aug 2008)
New Revision: 9502
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java
Log:
JBIDE-2505
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2505Test.java 2008-08-04 17:43:10 UTC (rev 9502)
@@ -0,0 +1,91 @@
+/*******************************************************************************
+* Copyright (c) 2007-2008 Red Hat, Inc.
+* Distributed under license by Red Hat, Inc. All rights reserved.
+* This program is made available under the terms of the
+* Eclipse Public License v1.0 which accompanies this distribution,
+* and is available at http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributor:
+* Red Hat, Inc. - initial API and implementation
+******************************************************************************/
+package org.jboss.tools.jsf.vpe.jsf.test.jbide;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
+import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
+import org.jboss.tools.vpe.editor.VpeController;
+import org.jboss.tools.vpe.ui.test.TestUtil;
+import org.jboss.tools.vpe.ui.test.VpeTest;
+import org.mozilla.interfaces.nsIDOMNode;
+import org.mozilla.interfaces.nsISelectionController;
+
+/**
+ * @author mareshkau
+ *
+ */
+public class JBIDE2505Test extends VpeTest {
+
+ public JBIDE2505Test(String name) {
+ super(name);
+ }
+
+ /**
+ * Tests inner nodes include URI
+ *
+ * @throws Throwable
+ */
+ public void testCursorForJSPElements() throws Throwable {
+ // wait
+ TestUtil.waitForJobs();
+ // set exception
+ setException(null);
+
+ //test for element node
+ testCaretManupulation(11, 34);
+ //test for sourceNode
+ testCaretManupulation(12, 58);
+ if(getException()!=null) {
+ throw getException();
+ }
+ }
+
+ private void testCaretManupulation(int sourceLine, int positioninLine) throws Throwable {
+ // get test page path
+ IFile file = (IFile) TestUtil.getComponentPath("JBIDE/2505/testJBIDE2505.jsp", //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
+ file);
+
+ IEditorInput input = new FileEditorInput(file);
+
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
+
+ // open and get editor
+ JSPMultiPageEditor part = openEditor(input);
+
+ int offset = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(),sourceLine, positioninLine);
+ // get editor control
+ StyledText styledText = part.getSourceEditor().getTextViewer()
+ .getTextWidget();
+
+ part.getSourceEditor().getTextViewer().getTextWidget().setCaretOffset(offset);
+
+
+
+ VpeController vpeController = getVpeController(part);
+ vpeController.sourceSelectionChanged();
+
+ for (int i=0;i<10;i++) {
+
+ nsIDOMNode domNode = vpeController.getXulRunnerEditor().getLastSelectedNode();
+ assertNotNull(domNode);
+ vpeController.getVisualSelectionController().getSelection(nsISelectionController.SELECTION_NORMAL).collapse(domNode, i);
+ vpeController.visualRefresh();
+
+ assertEquals("Cursor position doesn't equals",offset+i,styledText.getCaretOffset()); //$NON-NLS-1$
+ }
+ }
+}
17 years, 5 months
JBoss Tools SVN: r9501 - in trunk: jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings and 11 other directories.
by jbosstools-commits@lists.jboss.org
Author: mareshkau
Date: 2008-08-04 13:41:38 -0400 (Mon, 04 Aug 2008)
New Revision: 9501
Added:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.core.prefs
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2505/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2505/testJBIDE2505.jsp
Removed:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/perfomanceTest/
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/perfomance/
Modified:
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.classpath
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1105Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1484Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1730Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1744Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2119Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2219Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2434Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1467Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1501Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1568Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java
trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeNodeMapping.java
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF
trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
Log:
swallowing of exception was removed
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.classpath
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.classpath 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.classpath 2008-08-04 17:41:38 UTC (rev 9501)
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="output" path="bin"/>
</classpath>
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/.settings/org.eclipse.jdt.core.prefs 2008-08-04 17:41:38 UTC (rev 9501)
@@ -0,0 +1,7 @@
+#Mon Aug 04 20:09:07 EEST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/META-INF/MANIFEST.MF 2008-08-04 17:41:38 UTC (rev 9501)
@@ -18,7 +18,9 @@
org.mozilla.xpcom,
org.jboss.tools.vpe.ui.test;visibility:=reexport,
org.eclipse.jface.text
-Eclipse-LazyStart: true
Bundle-ClassPath: jsf-test.jar
-Export-Package: org.jboss.tools.jsf.vpe.jsf.test,
- org.jboss.tools.jsf.vpe.jsf.test.perfomance
+Bundle-ActivationPolicy: lazy
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Export-Package: org.jboss.tools.jsf.vpe.jsf.test
+
+
Added: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2505/testJBIDE2505.jsp
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2505/testJBIDE2505.jsp (rev 0)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/resources/jsfTest/WebContent/pages/JBIDE/2505/testJBIDE2505.jsp 2008-08-04 17:41:38 UTC (rev 9501)
@@ -0,0 +1,26 @@
+<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
+<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
+
+<html>
+ <head>
+ <title>Input User Name Page</title>
+ </head>
+ <body>
+
+ <f:view>
+ <h1><h:outputText value="#{Message.header}"/></h1>
+ <h1 style="FONT-FAMILY: 'Century Schoolbook L';">Test te1xt </h1>
+ <h:messages style="color: red"/>
+
+ <h:form id="greetingForm">
+ <h:outputText value="#{Message.prompt_message}"/>
+ <h:inputText value="#{user.name}" required="true">
+ <f:validateLength maximum="30" minimum="3"/>
+ </h:inputText>
+
+ <h:commandButton action="hello" value="Say Hello!" />
+
+ </h:form>
+ </f:view>
+ </body>
+</html>
\ No newline at end of file
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/JsfAllTests.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -29,6 +29,7 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2219Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2297Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2434Test;
+import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE2505Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE675Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JBIDE788Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1467Test;
@@ -37,7 +38,6 @@
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide1718Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2170Test;
import org.jboss.tools.jsf.vpe.jsf.test.jbide.JsfJbide2362Test;
-import org.jboss.tools.jsf.vpe.jsf.test.perfomance.PerfomanceTest;
import org.jboss.tools.vpe.ui.test.VpeTestSetup;
import org.jboss.tools.vpe.ui.test.beans.ImportBean;
@@ -50,6 +50,8 @@
public class JsfAllTests {
+ public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
+
public static Test suite() {
TestSuite suite = new TestSuite("Tests for Vpe Jsf components"); // $NON-NLS-1$ //$NON-NLS-1$
@@ -76,23 +78,16 @@
suite.addTestSuite(JsfJbide2362Test.class);
suite.addTestSuite(JBIDE2119Test.class);
suite.addTestSuite(JBIDE2219Test.class);
+ suite.addTestSuite(JBIDE2505Test.class);
// $JUnit-END$
// added by Max Areshkau
// add here projects which should be imported for junit tests
List<ImportBean> projectToImport = new ArrayList<ImportBean>();
ImportBean importBean = new ImportBean();
- importBean.setImportProjectName(JsfComponentTest.IMPORT_PROJECT_NAME);
+ importBean.setImportProjectName(JsfAllTests.IMPORT_PROJECT_NAME);
importBean.setImportProjectPath(JsfTestPlugin.getPluginResourcePath());
projectToImport.add(importBean);
- // Perfomance Tests
- // TODO dsakovich adjust perfomance tests
-// suite.addTestSuite(PerfomanceTest.class);
- ImportBean importPerfomanceBean = new ImportBean();
- importPerfomanceBean.setImportProjectName(PerfomanceTest.IMPORT_PROJECT_NAME);
- importPerfomanceBean.setImportProjectPath(JsfTestPlugin.getPluginResourcePath());
- projectToImport.add(importPerfomanceBean);
-
return new VpeTestSetup(suite, projectToImport);
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1105Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1105Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1105Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -14,6 +14,7 @@
import org.eclipse.swt.custom.StyledText;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -24,8 +25,6 @@
*/
public class JBIDE1105Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String TEST_PAGE_NAME="JBIDE/1105/employee.xhtml"; //$NON-NLS-1$
public JBIDE1105Test(String name) {
@@ -38,7 +37,7 @@
setException(null);
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file); //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1460Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -32,10 +33,8 @@
*/
public class JBIDE1460Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
+ private static final String TEST_PAGE_NAME = "JBIDE/1460/JBIDE-1460.xhtml"; //$NON-NLS-1$
- private static final String TEST_PAGE_NAME = "JBIDE/1460/JBIDE-1460.xhtml";
-
public JBIDE1460Test(String name) {
super(name);
}
@@ -49,14 +48,14 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + file.getFullPath(),
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
IEditorInput input = new FileEditorInput(file);
- assertNotNull("Editor input is null", input);
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
JSPMultiPageEditor part = openEditor(input);
@@ -81,7 +80,7 @@
nsIDOMNode span = elements.get(0);
nsIDOMNode text = span.getFirstChild();
- assertEquals(text.getNodeValue().trim(), "#{item.nodes}");
+ assertEquals(text.getNodeValue().trim(), "#{item.nodes}"); //$NON-NLS-1$
if (getException() != null) {
throw getException();
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1479Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -19,6 +19,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.xml.core.internal.provisional.format.FormatProcessorXML;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -31,8 +32,6 @@
*/
public class JBIDE1479Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
public static final String TEST_PAGE_NAME = "JBIDE/1479/employee.xhtml"; //$NON-NLS-1$
public JBIDE1479Test(String name) {
@@ -44,7 +43,7 @@
setException(null);
// get test page path
final IFile file = (IFile) TestUtil.getComponentPath(
- TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+ TEST_PAGE_NAME, JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + TEST_PAGE_NAME, //$NON-NLS-1$
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1484Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1484Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1484Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -31,10 +32,8 @@
*/
public class JBIDE1484Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
+ private static final String TEST_PAGE_NAME = "JBIDE/1484/JBIDE-1484.jsp"; //$NON-NLS-1$
- private static final String TEST_PAGE_NAME = "JBIDE/1484/JBIDE-1484.jsp";
-
public JBIDE1484Test(String name) {
super(name);
@@ -49,14 +48,14 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + file.getFullPath(),
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
IEditorInput input = new FileEditorInput(file);
- assertNotNull("Editor input is null", input);
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
JSPMultiPageEditor part = openEditor(input);
@@ -84,9 +83,9 @@
nsIDOMElement elementInput2 = (nsIDOMElement) elements.get(2)
.queryInterface(nsIDOMElement.NS_IDOMELEMENT_IID);
- assertEquals(" ", elementInput0.getAttribute("value"));
- assertEquals(" ", elementInput1.getAttribute("value"));
- assertEquals("test", elementInput2.getAttribute("value"));
+ assertEquals(" ", elementInput0.getAttribute("value")); //$NON-NLS-1$//$NON-NLS-2$
+ assertEquals(" ", elementInput1.getAttribute("value")); //$NON-NLS-1$ //$NON-NLS-2$
+ assertEquals("test", elementInput2.getAttribute("value")); //$NON-NLS-1$ //$NON-NLS-2$
if (getException() != null) {
throw getException();
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1494Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -19,6 +19,7 @@
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.template.VpeTemplate;
@@ -33,8 +34,6 @@
*/
public class JBIDE1494Test extends VpeTest{
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String TEST_PAGE_NAME = "JBIDE/1494/JBIDE-1494.xhtml"; //$NON-NLS-1$
public JBIDE1494Test(String name) {
@@ -49,7 +48,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file); //$NON-NLS-1$
IEditorInput input = new FileEditorInput(file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1615Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -32,10 +33,8 @@
*/
public class JBIDE1615Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
+ private static final String TEST_PAGE_NAME = "JBIDE/1615/JBIDE-1615.xhtml"; //$NON-NLS-1$
- private static final String TEST_PAGE_NAME = "JBIDE/1615/JBIDE-1615.xhtml";
-
public JBIDE1615Test(String name) {
super(name);
}
@@ -49,14 +48,14 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + file.getFullPath(),
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
IEditorInput input = new FileEditorInput(file);
- assertNotNull("Editor input is null", input);
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
JSPMultiPageEditor part = openEditor(input);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1720Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -32,12 +33,10 @@
*/
public class JBIDE1720Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
+ private static final String TEST_PAGE_NAME1 = "JBIDE/1720/JBIDE-1720-selectOneRadio.jsp"; //$NON-NLS-1$
+ private static final String TEST_PAGE_NAME2 = "JBIDE/1720/JBIDE-1720-selectOneListBox.jsp"; //$NON-NLS-1$
+ private static final String TEST_PAGE_NAME3 = "JBIDE/1720/JBIDE-1720-selectOneMenu.jsp"; //$NON-NLS-1$
- private static final String TEST_PAGE_NAME1 = "JBIDE/1720/JBIDE-1720-selectOneRadio.jsp";
- private static final String TEST_PAGE_NAME2 = "JBIDE/1720/JBIDE-1720-selectOneListBox.jsp";
- private static final String TEST_PAGE_NAME3 = "JBIDE/1720/JBIDE-1720-selectOneMenu.jsp";
-
public JBIDE1720Test(String name) {
super(name);
}
@@ -51,7 +50,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME1,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + file.getFullPath(),
file);
@@ -126,7 +125,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME3,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + file.getFullPath(),
file);
@@ -206,7 +205,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME2,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + file.getFullPath(),
file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1730Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1730Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1730Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -32,8 +33,6 @@
*/
public class JBIDE1730Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String TEST_PAGE_NAME1 = "JBIDE/1730/JBIDE-1730.jsp"; //$NON-NLS-1$
public JBIDE1730Test(String name) {
@@ -49,7 +48,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME1,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1744Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1744Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE1744Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -30,10 +31,8 @@
*/
public class JBIDE1744Test extends VpeTest {
- private static final String IMPORT_PROJECT_NAME = "jsfTest";
+ private static final String TEST_PAGE_NAME = "JBIDE/1744/JBIDE-1744.jsp"; //$NON-NLS-1$
- private static final String TEST_PAGE_NAME = "JBIDE/1744/JBIDE-1744.jsp";
-
/**
* @param name
*/
@@ -50,14 +49,14 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + file.getFullPath(),
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
IEditorInput input = new FileEditorInput(file);
- assertNotNull("Editor input is null", input);
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
JSPMultiPageEditor part = openEditor(input);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2119Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2119Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2119Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -16,6 +16,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -30,9 +31,8 @@
*/
public class JBIDE2119Test extends VpeTest {
- private static final String IMPORT_PROJECT_NAME = "jsfTest";
- private static final String TEST_PAGE_NAME = "JBIDE/2119/JBIDE-2119.jsp";
+ private static final String TEST_PAGE_NAME = "JBIDE/2119/JBIDE-2119.jsp"; //$NON-NLS-1$
/**
* @param name
@@ -50,14 +50,14 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + file.getFullPath(),
+ assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
IEditorInput input = new FileEditorInput(file);
- assertNotNull("Editor input is null", input);
+ assertNotNull("Editor input is null", input); //$NON-NLS-1$
// open and get editor
JSPMultiPageEditor part = openEditor(input);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2219Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2219Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2219Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -15,6 +15,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -26,7 +27,6 @@
*/
public class JBIDE2219Test extends VpeTest {
- private static final String TEST_PROJECT_NAME="jsfTest"; //$NON-NLS-1$
public JBIDE2219Test(String name) {
super(name);
@@ -40,7 +40,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/2219/testJBIDE2219.xhtml", //$NON-NLS-1$
- TEST_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + "JBIDE/2219/testJBIDE2219.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
IEditorInput input = new FileEditorInput(file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2297Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -12,6 +12,7 @@
package org.jboss.tools.jsf.vpe.jsf.test.jbide;
import org.eclipse.core.resources.IFile;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -23,8 +24,6 @@
*/
public class JBIDE2297Test extends VpeTest{
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String TEST_PAGE_NAME1 = "JBIDE/2297/JBIDE-2297.xhtml"; //$NON-NLS-1$
private static final String TEST_PAGE_NAME2 ="JBIDE/2297/limitedEntry.jsp"; //$NON-NLS-1$
@@ -34,10 +33,10 @@
}
public void testJBIDE2297() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath(TEST_PAGE_NAME1,IMPORT_PROJECT_NAME));
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath(TEST_PAGE_NAME1,JsfAllTests.IMPORT_PROJECT_NAME));
}
public void testJBIDE2297_jsp() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath(TEST_PAGE_NAME2,IMPORT_PROJECT_NAME));
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath(TEST_PAGE_NAME2,JsfAllTests.IMPORT_PROJECT_NAME));
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2434Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2434Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE2434Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -13,6 +13,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.VpeEditorPart;
@@ -25,8 +26,6 @@
*/
public class JBIDE2434Test extends VpeTest{
- private static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
public JBIDE2434Test(String name) {
super(name);
}
@@ -35,7 +34,7 @@
* @throws Throwable
*/
public void testOpenAndCloPageWithCycleFacelets() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/2434/FaceletForm.xhtml",IMPORT_PROJECT_NAME)); //$NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/2434/FaceletForm.xhtml",JsfAllTests.IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
/**
* Tests visual refresh method
@@ -49,7 +48,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/2434/FaceletBlank.xhtml", //$NON-NLS-1$
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + "JBIDE/2434/FaceletBlank.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
IEditorInput input = new FileEditorInput(file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE675Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -21,6 +21,7 @@
import org.eclipse.ui.progress.UIJob;
import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -36,8 +37,6 @@
*/
public class JBIDE675Test extends VpeTest {
- private static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String TEST_PAGE_NAME = "JBIDE/675/testChangeOnUserInputTextNode.xhtml"; //$NON-NLS-1$
@@ -59,7 +58,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + TEST_PAGE_NAME, file); //$NON-NLS-1$
IEditorInput input = new FileEditorInput(file);
@@ -120,8 +119,8 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/675/testUserInputOnTag.xhtml", //$NON-NLS-1$
- IMPORT_PROJECT_NAME);
- assertNotNull("Could not open specified file " + "JBIDE/675/testUserInputOnTag.xhtml", file); //$NON-NLS-1$
+ JsfAllTests.IMPORT_PROJECT_NAME);
+ assertNotNull("Could not open specified file " + "JBIDE/675/testUserInputOnTag.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
IEditorInput input = new FileEditorInput(file);
@@ -179,7 +178,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/675/testInsertTag.xhtml", //$NON-NLS-1$
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + "JBIDE/675/testInsertTag.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
IEditorInput input = new FileEditorInput(file);
@@ -237,7 +236,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/675/employee.xhtml", //$NON-NLS-1$
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + "JBIDE/675/employee.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
IEditorInput input = new FileEditorInput(file);
@@ -285,7 +284,7 @@
// Tests CA
// get test page path
IFile file = (IFile) TestUtil.getComponentPath("JBIDE/675/employee.xhtml", //$NON-NLS-1$
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + "JBIDE/675/employee.xhtml", file); //$NON-NLS-1$ //$NON-NLS-2$
IEditorInput input = new FileEditorInput(file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JBIDE788Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -21,6 +21,7 @@
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
import org.eclipse.wst.sse.ui.StructuredTextViewerConfiguration;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.jst.jsp.jspeditor.JSPTextEditor;
@@ -34,8 +35,6 @@
*/
public class JBIDE788Test extends VpeTest {
- private static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String CA_NAME = "org.eclipse.wst.html.HTML_DEFAULT"; //$NON-NLS-1$
public JBIDE788Test(String name) {
@@ -254,7 +253,7 @@
String partOfString, int lineIndex, int linePosition,boolean isCheck) throws CoreException {
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(testPagePath,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + file.getFullPath(), //$NON-NLS-1$
file);
@@ -265,7 +264,7 @@
// open and get editor
JSPMultiPageEditor part = openEditor(input);
- int position = getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex, linePosition);
+ int position = TestUtil.getLinePositionOffcet(part.getSourceEditor().getTextViewer(), lineIndex, linePosition);
// insert string
part.getSourceEditor().getTextViewer().getTextWidget()
@@ -314,46 +313,4 @@
TestUtil.delay(1000L);
return results;
}
- /**
- * Utility function which is used to calculate offcet in document by line number and character position
- *
- * @param textViewer
- * @param lineIndex
- * @param linePosition
- * @return offcet in document
- * @throws IllegalArgumentException
- */
- private static final int getLinePositionOffcet(ITextViewer textViewer, int lineIndex, int linePosition) throws IllegalArgumentException {
-
- int resultOffcet = 0;
-
- if(textViewer==null) {
-
- throw new IllegalArgumentException("Text viewer shouldn't be a null"); //$NON-NLS-1$
- }
- //lineIndex-1 becose calculating of line begibns in eclipse from one, but should be form zero
- resultOffcet=textViewer.getTextWidget().getOffsetAtLine(lineIndex-1);
- //here we get's tabs length
- //for more example you can see code org.eclipse.ui.texteditor.AbstractTextEditor@getCursorPosition() and class $PositionLabelValue
- int tabWidth = textViewer.getTextWidget().getTabs();
- int characterOffset=0;
- String currentString = textViewer.getTextWidget().getLine(lineIndex-1);
- int pos=1;
- for (int i= 0; (i < currentString.length())&&(pos<linePosition); i++) {
- if ('\t' == currentString.charAt(i)) {
-
- characterOffset += (tabWidth == 0 ? 0 : 1);
- pos+=tabWidth;
- }else{
- pos++;
- characterOffset++;
- }
- }
- resultOffcet+=characterOffset;
- if(textViewer.getTextWidget().getLineAtOffset(resultOffcet)!=(lineIndex-1)) {
-
- throw new IllegalArgumentException("Incorrect character position in line"); //$NON-NLS-1$
- }
- return resultOffcet;
- }
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1467Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1467Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1467Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -48,8 +49,6 @@
// import project name
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
-
public JsfJbide1467Test(String name) {
super(name);
}
@@ -67,7 +66,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- "JBIDE/1467/JBIDE-1467.jsp", IMPORT_PROJECT_NAME);
+ "JBIDE/1467/JBIDE-1467.jsp", JsfAllTests.IMPORT_PROJECT_NAME);
assertNotNull("Could not open specified file " + file.getFullPath(),
file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1501Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1501Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1501Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -54,7 +55,6 @@
*/
public class JsfJbide1501Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
public JsfJbide1501Test(String name) {
super(name);
@@ -71,7 +71,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- "JBIDE/1501/JBIDE-1501_multiple.jsp", IMPORT_PROJECT_NAME);
+ "JBIDE/1501/JBIDE-1501_multiple.jsp", JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -126,7 +126,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- "JBIDE/1501/JBIDE-1501_size.jsp", IMPORT_PROJECT_NAME);
+ "JBIDE/1501/JBIDE-1501_size.jsp", JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1568Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1568Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1568Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -11,6 +11,7 @@
package org.jboss.tools.jsf.vpe.jsf.test.jbide;
import org.eclipse.core.resources.IFile;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.vpe.ui.test.TestUtil;
import org.jboss.tools.vpe.ui.test.VpeTest;
@@ -22,20 +23,19 @@
*/
public class JsfJbide1568Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME="jsfTest";
public JsfJbide1568Test(String name) {
super(name);
}
public void testJBIDE1568Body() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/1568/JBIDE-1568-body.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/1568/JBIDE-1568-body.jsp",JsfAllTests.IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testJBIDE1568RichFaces() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/1568/JBIDE-1568-richfaces.jsp",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/1568/JBIDE-1568-richfaces.jsp",JsfAllTests.IMPORT_PROJECT_NAME)); //$NON-NLS-1$
}
public void testJBIDE1568Seam() throws Throwable {
- performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/1568/JBIDE-1568-seam.xhtml",IMPORT_PROJECT_NAME)); // $NON-NLS-1$
+ performTestForVpeComponent((IFile) TestUtil.getComponentPath("JBIDE/1568/JBIDE-1568-seam.xhtml",JsfAllTests.IMPORT_PROJECT_NAME));//$NON-NLS-1$
}
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide1718Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -17,6 +17,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.HTML;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -37,16 +38,14 @@
*/
public class JsfJbide1718Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest";
+ private static final String DIR_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-dir.jsp"; //$NON-NLS-1$
- private static final String DIR_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-dir.jsp";
+ private static final String ESCAPE_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-escape.jsp"; //$NON-NLS-1$
- private static final String ESCAPE_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-escape.jsp";
+ private static final String DISABLED_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-disabled.jsp"; //$NON-NLS-1$
- private static final String DISABLED_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-disabled.jsp";
+ private static final String FORMAT_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-format.jsp"; //$NON-NLS-1$
- private static final String FORMAT_TEST_PAGE_NAME = "JBIDE/1718/JBIDE-1718-format.jsp";
-
public JsfJbide1718Test(String name) {
super(name);
}
@@ -64,7 +63,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(DIR_TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -151,7 +150,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(ESCAPE_TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -198,7 +197,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(DISABLED_TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -246,7 +245,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(FORMAT_TEST_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -292,7 +291,7 @@
nsIDOMNode text = children.item(i);
- if ("paramValue".equals(text.getNodeValue())) {
+ if ("paramValue".equals(text.getNodeValue())) { //$NON-NLS-1$
isFind = true;
break;
}
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2170Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -14,6 +14,7 @@
import org.eclipse.core.resources.IFile;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.part.FileEditorInput;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.ui.test.TestUtil;
@@ -30,8 +31,6 @@
*/
public class JsfJbide2170Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
-
private static final String WITHOUT_DOCTYPE_TEST_PAGE_NAME = "JBIDE/2170/there_is_not_doctype.xhtml"; //$NON-NLS-1$
private static final String WITH_DOCTYPE_TEST_PAGE_NAME = "JBIDE/2170/there_is_doctype.xhtml"; //$NON-NLS-1$
@@ -59,7 +58,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- WITHOUT_DOCTYPE_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+ WITHOUT_DOCTYPE_TEST_PAGE_NAME, JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -105,7 +104,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- WITH_DOCTYPE_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+ WITH_DOCTYPE_TEST_PAGE_NAME, JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -150,7 +149,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- TEMPLATE_DOCTYPE_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+ TEMPLATE_DOCTYPE_TEST_PAGE_NAME, JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -195,7 +194,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(
- COMPLEX_DOCTYPE_TEST_PAGE_NAME, IMPORT_PROJECT_NAME);
+ COMPLEX_DOCTYPE_TEST_PAGE_NAME, JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
Modified: trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java
===================================================================
--- trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/jsf/tests/org.jboss.tools.jsf.vpe.jsf.test/src/org/jboss/tools/jsf/vpe/jsf/test/jbide/JsfJbide2362Test.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -26,6 +26,7 @@
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
+import org.jboss.tools.jsf.vpe.jsf.test.JsfAllTests;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
import org.jboss.tools.vpe.editor.VpeController;
import org.jboss.tools.vpe.editor.mapping.VpeDomMapping;
@@ -47,7 +48,6 @@
*/
public class JsfJbide2362Test extends VpeTest {
- public static final String IMPORT_PROJECT_NAME = "jsfTest"; //$NON-NLS-1$
private static final String SELECTION_PAGE_NAME = "JBIDE/2362/selection.jsp"; //$NON-NLS-1$
private static final String EDITING_PAGE_NAME = "JBIDE/2362/editing.jsp"; //$NON-NLS-1$
@@ -86,7 +86,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(SELECTION_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
@@ -161,7 +161,7 @@
// get test page path
IFile file = (IFile) TestUtil.getComponentPath(EDITING_PAGE_NAME,
- IMPORT_PROJECT_NAME);
+ JsfAllTests.IMPORT_PROJECT_NAME);
IEditorInput input = new FileEditorInput(file);
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeController.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -142,7 +142,6 @@
import org.jboss.tools.vpe.editor.util.DocTypeUtil;
import org.jboss.tools.vpe.editor.util.SelectionUtil;
import org.jboss.tools.vpe.editor.util.VisualDomUtil;
-import org.jboss.tools.vpe.editor.util.VpeDebugUtil;
import org.jboss.tools.vpe.editor.util.VpeDndUtil;
import org.jboss.tools.vpe.messages.VpeUIMessages;
import org.jboss.tools.vpe.selbar.SelectionBar;
@@ -3257,4 +3256,11 @@
}
}
+ /**
+ * @return the visualSelectionController
+ */
+ public VpeSelectionController getVisualSelectionController() {
+ return visualSelectionController;
+ }
+
}
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/VpeVisualDomBuilder.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -977,7 +977,6 @@
public void removeNode(Node sourceNode) {
//remove from cash should be called first
- getPageContext().removeNodeFromVpeCash(sourceNode);
domMapping.remove(sourceNode);
getSourceNodes().remove(sourceNode);
if (sourceNode instanceof INodeNotifier) {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/context/VpePageContext.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -67,9 +67,6 @@
WtpKbConnector connector;
private nsIDOMNode currentVisualNode;
- //Added by Max Areshkau to increase perfomance of VPE JBIDE-675
- private Map<Node,VpeCreationData> vpeCash;
-
public VpePageContext(VpeTemplateManager templateManager, BundleMap bundle, VpeEditorPart editPart) {
this.bundle = bundle;
this.editPart = editPart;
@@ -117,8 +114,6 @@
public void clearAll() {
bundleDependencySet.clear();
bundle.clearAll();
- //clean a cash nodes
- clearVpeCash();
}
public void dispose() {
@@ -342,79 +337,6 @@
}
/**
- * Removes information about source node from vpe cash
- * @param sourceNode
- */
- public void removeNodeFromVpeCash(Node sourceNode) {
-
- getVpeCash().remove(sourceNode);
- Node parentNode = sourceNode.getParentNode();
- //we should on change remove also parent nodes because information for
- //this nodes doen't actual when we change child
- while(parentNode!=null) {
- getVpeCash().remove(parentNode);
- parentNode=parentNode.getParentNode();
- }
- }
- /**
- * Clears all information in cash
- */
- public void clearVpeCash() {
-
- getVpeCash().clear();
- }
- /**
- * Checs is creation data exist in cash
- * @param sourceNode
- * @return true - if date exist
- * false -otherwise
- */
- public boolean isCreationDataExistInCash(Node sourceNode){
-
-// Iterator<Node> keys = getVpeCash().keySet().iterator();
-//
-// //Map.get() doesn't work correctly for this situation
-//// while(keys.hasNext()){
-//// Node key= keys.next();
-//// if(sourceNode.isEqu alNode(key)) {
-//// return true;
-//// }
-//// }
-//// return false;
- return getVpeCash().containsKey(sourceNode);
- }
- /**
- * Inserts creation data into cash
- * @param sourceNode
- * @param creationData
- */
- public void addCreationDataToCash(Node sourceNode,VpeCreationData creationData) {
- //TODO Max Areshkau JBIDE-675 Adds data to cash, think about cloning creationData
- getVpeCash().put(sourceNode, creationData);
- }
- /**
- * Looks creates data in cash
- * @param sourceNode
- * @return returns creation data
- */
- public VpeCreationData getVpeCreationDataFromCash(Node sourceNode) {
-
- return getVpeCash().get(sourceNode);
- }
- /**
- * Return vpe Cash
- * @return the vpeCash
- */
- private Map<Node, VpeCreationData> getVpeCash() {
-
- if(vpeCash ==null) {
-
- vpeCash = new HashMap<Node, VpeCreationData>();
- }
- return vpeCash;
- }
-
- /**
* Processes display events to prevent eclipse froze
*/
public void processDisplayEvents() {
Modified: trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeNodeMapping.java
===================================================================
--- trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeNodeMapping.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/vpe/plugins/org.jboss.tools.vpe/src/org/jboss/tools/vpe/editor/mapping/VpeNodeMapping.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -14,12 +14,6 @@
import org.w3c.dom.Node;
public class VpeNodeMapping {
-// public static final int EMPTY_MAPPING = 0;
-// public static final int TEXT_MAPPING = 1;
-// public static final int ELEMENT_MAPPING = 2;
-// public static final int COMMENT_MAPPING = 3;
-// public static final int DOCUMENT_MAPPING = 4;
-
private Node sourceNode;
private nsIDOMNode visualNode;
@@ -28,23 +22,6 @@
this.visualNode = visualNode;
}
-// public int getType() {
-// if (sourceNode != null) {
-// switch (sourceNode.getNodeType()) {
-// case Node.TEXT_NODE:
-// return TEXT_MAPPING;
-// case Node.ELEMENT_NODE:
-// return ELEMENT_MAPPING;
-// case Node.COMMENT_NODE:
-// return COMMENT_MAPPING;
-// case Node.DOCUMENT_NODE:
-// return DOCUMENT_MAPPING;
-// }
-// return COMMENT_MAPPING;
-// }
-// return EMPTY_MAPPING;
-// }
-
public Node getSourceNode() {
return sourceNode;
}
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/META-INF/MANIFEST.MF 2008-08-04 17:41:38 UTC (rev 9501)
@@ -17,7 +17,8 @@
org.jboss.tools.vpe.xulrunner,
org.mozilla.xpcom,
org.jboss.tools.jst.firstrun,
- org.eclipse.wst.server.core
+ org.eclipse.wst.server.core,
+ org.eclipse.jface.text
Eclipse-LazyStart: true
Bundle-ClassPath: .
Export-Package: org.jboss.tools.vpe.ui.test,
Modified: trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java
===================================================================
--- trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-08-04 17:22:47 UTC (rev 9500)
+++ trunk/vpe/tests/org.jboss.tools.vpe.ui.test/src/org/jboss/tools/vpe/ui/test/TestUtil.java 2008-08-04 17:41:38 UTC (rev 9501)
@@ -21,6 +21,7 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.jface.text.ITextViewer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.dialogs.IOverwriteQuery;
@@ -248,4 +249,46 @@
importBean.setImportProjectPath(resourcePath);
return importBean;
}
+ /**
+ * Utility function which is used to calculate offcet in document by line number and character position
+ *
+ * @param textViewer
+ * @param lineIndex
+ * @param linePosition
+ * @return offcet in document
+ * @throws IllegalArgumentException
+ */
+ public static final int getLinePositionOffcet(ITextViewer textViewer, int lineIndex, int linePosition) throws IllegalArgumentException {
+
+ int resultOffcet = 0;
+
+ if(textViewer==null) {
+
+ throw new IllegalArgumentException("Text viewer shouldn't be a null"); //$NON-NLS-1$
+ }
+ //lineIndex-1 becose calculating of line begibns in eclipse from one, but should be form zero
+ resultOffcet=textViewer.getTextWidget().getOffsetAtLine(lineIndex-1);
+ //here we get's tabs length
+ //for more example you can see code org.eclipse.ui.texteditor.AbstractTextEditor@getCursorPosition() and class $PositionLabelValue
+ int tabWidth = textViewer.getTextWidget().getTabs();
+ int characterOffset=0;
+ String currentString = textViewer.getTextWidget().getLine(lineIndex-1);
+ int pos=1;
+ for (int i= 0; (i < currentString.length())&&(pos<linePosition); i++) {
+ if ('\t' == currentString.charAt(i)) {
+
+ characterOffset += (tabWidth == 0 ? 0 : 1);
+ pos+=tabWidth;
+ }else{
+ pos++;
+ characterOffset++;
+ }
+ }
+ resultOffcet+=characterOffset;
+ if(textViewer.getTextWidget().getLineAtOffset(resultOffcet)!=(lineIndex-1)) {
+
+ throw new IllegalArgumentException("Incorrect character position in line"); //$NON-NLS-1$
+ }
+ return resultOffcet;
+ }
}
17 years, 5 months