JBoss Tools SVN: r33143 - trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 12:04:44 -0400 (Fri, 22 Jul 2011)
New Revision: 33143
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
Log:
JBIDE-9362
https://issues.jboss.org/browse/JBIDE-9362
Modified: trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java
===================================================================
--- trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2011-07-22 16:04:06 UTC (rev 33142)
+++ trunk/jst/plugins/org.jboss.tools.jst.jsp.base.test/src/org/jboss/tools/jst/jsp/test/ca/ContentAssistantTestCase.java 2011-07-22 16:04:44 UTC (rev 33143)
@@ -12,8 +12,10 @@
package org.jboss.tools.jst.jsp.test.ca;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.wst.sse.ui.StructuredTextEditor;
import org.jboss.tools.common.base.test.contentassist.AbstractContentAssistantTestCase;
import org.jboss.tools.jst.jsp.contentassist.AutoContentAssistantProposal;
import org.jboss.tools.jst.jsp.jspeditor.JSPMultiPageEditor;
@@ -36,6 +38,10 @@
textEditor = jspTextEditor = jspEditor.getJspEditor();
}
+ protected ISourceViewer getTextViewer() {
+ return ((StructuredTextEditor)textEditor).getTextViewer();
+ }
+
protected boolean isRelevantProposal(ICompletionProposal proposal) {
return proposal instanceof AutoContentAssistantProposal;
}
14 years, 5 months
JBoss Tools SVN: r33142 - trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 12:04:06 -0400 (Fri, 22 Jul 2011)
New Revision: 33142
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/ContentAssistantTestCase.java
Log:
JBIDE-9362
https://issues.jboss.org/browse/JBIDE-9362
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/ContentAssistantTestCase.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/ContentAssistantTestCase.java 2011-07-22 15:47:54 UTC (rev 33141)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.config.ui.test/src/org/jboss/tools/cdi/seam/config/ui/test/ContentAssistantTestCase.java 2011-07-22 16:04:06 UTC (rev 33142)
@@ -12,6 +12,7 @@
package org.jboss.tools.cdi.seam.config.ui.test;
import org.eclipse.jface.text.contentassist.ICompletionProposal;
+import org.eclipse.jface.text.source.ISourceViewer;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorPart;
import org.eclipse.wst.sse.ui.StructuredTextEditor;
@@ -36,6 +37,10 @@
while (Display.getCurrent().readAndDispatch());
}
+ protected ISourceViewer getTextViewer() {
+ return ((StructuredTextEditor)textEditor).getTextViewer();
+ }
+
protected boolean isRelevantProposal(ICompletionProposal proposal) {
return (proposal instanceof CustomCompletionProposal)
&& (proposal.getClass() != CustomCompletionProposal.class);
14 years, 5 months
JBoss Tools SVN: r33141 - trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-07-22 11:47:54 -0400 (Fri, 22 Jul 2011)
New Revision: 33141
Added:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/JavaContentAssistantTestCase.java
Modified:
trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
Log:
JBIDE-9380
https://issues.jboss.org/browse/JBIDE-9380
Modified: trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-07-22 14:50:44 UTC (rev 33140)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/AbstractContentAssistantTestCase.java 2011-07-22 15:47:54 UTC (rev 33141)
@@ -11,6 +11,7 @@
package org.jboss.tools.common.base.test.contentassist;
+import java.lang.reflect.Field;
import java.util.List;
import junit.framework.TestCase;
@@ -20,11 +21,11 @@
import org.eclipse.jface.text.contentassist.ICompletionProposal;
import org.eclipse.jface.text.contentassist.IContentAssistant;
import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.jface.text.source.SourceViewer;
import org.eclipse.jface.text.source.SourceViewerConfiguration;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
+import org.eclipse.ui.texteditor.ITextEditor;
import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
import org.jboss.tools.common.text.ext.util.Utils;
import org.jboss.tools.test.util.WorkbenchUtils;
@@ -33,7 +34,7 @@
protected String fileName;
protected IProject project = null;
protected IEditorPart editorPart = null;
- protected StructuredTextEditor textEditor = null;
+ protected ITextEditor textEditor = null;
protected ISourceViewer viewer = null;
protected IContentAssistant contentAssistant = null;
protected IDocument document = null;
@@ -44,23 +45,32 @@
obtainTextEditor(editorPart);
- viewer = textEditor.getTextViewer();
+ viewer = getTextViewer();
document = viewer.getDocument();
SourceViewerConfiguration config = CATestUtil
.getSourceViewerConfiguration(textEditor);
- contentAssistant = (config == null ? null : config
- .getContentAssistant(viewer));
+ contentAssistant = getContentAssistantInternal();
+ //(config == null ? null : config.getContentAssistant(viewer));
assertTrue(
"Cannot get the Content Assistant instance for the editor for page \"" //$NON-NLS-1$
+ fileName + "\"", (contentAssistant != null)); //$NON-NLS-1$
- assertTrue("The IDocument is not instance of IStructuredDocument for page \"" //$NON-NLS-1$
- + fileName + "\"", //$NON-NLS-1$
- (document instanceof IStructuredDocument));
+ }
+ private IContentAssistant getContentAssistantInternal() {
+ try {
+ Field f = SourceViewer.class.getDeclaredField("fContentAssistant");
+ f.setAccessible(true);
+ return (IContentAssistant)f.get(viewer);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
}
+ protected abstract ISourceViewer getTextViewer();
+
/**
* Looks into editorPart for the test editor to apply content assist to.
*
@@ -194,7 +204,7 @@
/**
* @return the jspTextEditor
*/
- public StructuredTextEditor getTextEditor() {
+ public ITextEditor getTextEditor() {
return textEditor;
}
Added: trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/JavaContentAssistantTestCase.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/JavaContentAssistantTestCase.java (rev 0)
+++ trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/JavaContentAssistantTestCase.java 2011-07-22 15:47:54 UTC (rev 33141)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2011 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.common.base.test.contentassist;
+
+import org.eclipse.jdt.internal.ui.javaeditor.JavaEditor;
+import org.eclipse.jface.text.source.ISourceViewer;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.texteditor.ITextEditor;
+
+public class JavaContentAssistantTestCase extends AbstractContentAssistantTestCase {
+
+ protected void obtainTextEditor(IEditorPart editorPart) {
+ if(editorPart instanceof JavaEditor) {
+ textEditor = (ITextEditor)editorPart;
+ }
+ }
+
+ @Override
+ protected ISourceViewer getTextViewer() {
+ return ((JavaEditor)textEditor).getViewer();
+ }
+
+}
Property changes on: trunk/common/plugins/org.jboss.tools.common.base.test/src/org/jboss/tools/common/base/test/contentassist/JavaContentAssistantTestCase.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
14 years, 5 months
JBoss Tools SVN: r33139 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7.
by jbosstools-commits@lists.jboss.org
Author: adietish
Date: 2011-07-22 10:34:08 -0400 (Fri, 22 Jul 2011)
New Revision: 33139
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
Log:
[JBIDE-9355] added return where no state was returned from service call previously (caused the server detection to always assume that the server is down)
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-07-22 14:26:34 UTC (rev 33138)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ManagerServicePoller.java 2011-07-22 14:34:08 UTC (rev 33139)
@@ -134,7 +134,7 @@
public boolean getCurrentStateSynchronous(final IServer server) {
try {
- JBoss7ManagerUtil.executeWithService(new IServiceAware<Boolean>() {
+ return JBoss7ManagerUtil.executeWithService(new IServiceAware<Boolean>() {
@Override
public Boolean execute(IJBoss7ManagerService service) throws Exception {
@@ -143,6 +143,7 @@
}
}, server);
} catch(Exception e) {
+e.printStackTrace();
// ignore
}
return IServerStatePoller.SERVER_DOWN;
14 years, 5 months
JBoss Tools SVN: r33137 - in trunk/maven/plugins/org.jboss.tools.maven.ui: src/org/jboss/tools/maven/ui and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: fbricon
Date: 2011-07-22 10:00:57 -0400 (Fri, 22 Jul 2011)
New Revision: 33137
Modified:
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties
trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
Log:
JBIDE-8969 : fixed
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties 2011-07-22 13:32:25 UTC (rev 33136)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.properties 2011-07-22 14:00:57 UTC (rev 33137)
@@ -1,8 +1,12 @@
Bundle-Vendor = JBoss by Red Hat
Bundle-Name = JBoss Maven Integration
JBoss_Maven_Integration = JBoss Maven Integration
-Maven_Profiles = Maven Profiles
-Select_Maven_Profiles= Select Maven Profiles
+
+#Maven Profile selection menu
+Select_Maven_Profiles_Cmd= Select Maven Profiles
+Select_Maven_Profiles_Menu= Select Maven Profiles...
+
+#JBoss Public repo description for the <repository> template
JBoss_Public_Repo_name=JBoss Public repository
JBoss_Public_Repo_description=The JBoss Public repository is a composite repository of several major repositories
JBoss_Releases_Repo_name=JBoss Releases repository
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2011-07-22 13:32:25 UTC (rev 33136)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/plugin.xml 2011-07-22 14:00:57 UTC (rev 33137)
@@ -32,14 +32,10 @@
<!-- Maven Profile Selection-->
<extension
point="org.eclipse.ui.commands">
- <category
- id="org.jboss.tools.maven.ui.commands.profiles"
- name="%Maven_Profiles">
- </category>
<command
- categoryId="org.jboss.tools.maven.ui.commands.profiles"
+ categoryId="org.eclipse.ui.category.window"
id="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- name="%Select_Maven_Profiles">
+ name="%Select_Maven_Profiles_Cmd">
</command>
</extension>
@@ -66,7 +62,7 @@
adaptable="true">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- label="%Select_Maven_Profiles"
+ label="%Select_Maven_Profiles_Menu"
style="push"
definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
menubarPath="org.eclipse.m2e.core.mavenMenu/open"
@@ -84,8 +80,9 @@
adaptable="true">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- label="%Select_Maven_Profiles"
+ label="%Select_Maven_Profiles_Menu"
style="push"
+ definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
menubarPath="org.eclipse.m2e.core.fileMenu/open"
enablesFor="+"/>
<visibility>
@@ -98,8 +95,9 @@
objectClass="org.eclipse.ui.IWorkingSet">
<action id="org.jboss.tools.maven.ui.commands.selectMavenProfileAction"
class="org.jboss.tools.maven.ui.generic.GenericCommandActionDelegate:org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
- label="%Select_Maven_Profiles"
+ label="%Select_Maven_Profiles_Menu"
style="push"
+ definitionId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
menubarPath="org.eclipse.m2e.core.workingSetMenu/open"
enablesFor="+"/>
</objectContribution>
@@ -116,7 +114,7 @@
commandId="org.jboss.tools.maven.ui.commands.selectMavenProfileCommand"
icon="icons/maven-profiles.gif"
id="org.jboss.tools.maven.ui.toolbars.selectMavenProfilesCommand"
- tooltip="%Select_Maven_Profiles">
+ tooltip="%Select_Maven_Profiles_Cmd">
</command>
</toolbar>
</menuContribution>
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-22 13:32:25 UTC (rev 33136)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/Messages.java 2011-07-22 14:00:57 UTC (rev 33137)
@@ -63,7 +63,7 @@
public static String SelectProfilesDialog_Activate_menu;
public static String SelectProfilesDialog_Active_Profiles_for_Project;
public static String SelectProfilesDialog_Available_profiles;
- public static String SelectProfilesDialog_Common_profiles;
+ public static String SelectProfilesDialog_Warning_Common_profiles;
public static String SelectProfilesDialog_deactivated;
public static String SelectProfilesDialog_Deactivate_menu;
public static String SelectProfilesDialog_DeselectAll;
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-22 13:32:25 UTC (rev 33136)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/internal/profiles/SelectProfilesDialog.java 2011-07-22 14:00:57 UTC (rev 33137)
@@ -74,13 +74,11 @@
Set<IMavenProjectFacade> facades;
IMavenProjectFacade facade;
-
-
-
-
final Action activationAction = new ChangeProfileStateAction(ProfileState.Active);
final Action deActivationAction = new ChangeProfileStateAction(ProfileState.Disabled);
+ private Label warningImg;
+ private Label warningLabel;
public SelectProfilesDialog(Shell parentShell, Set<IMavenProjectFacade> facades,
List<ProfileSelection> sharedProfiles) {
@@ -122,113 +120,129 @@
text = NLS.bind(
Messages.SelectProfilesDialog_Select_the_active_Maven_profiles,
facade.getProject().getName());
+
+ displayProfilesAsText(container);
}
setMessage(text);
- if (facade != null) {
+ boolean hasProfiles = !sharedProfiles.isEmpty();
+
+ if (hasProfiles && facade == null) {
+ displayWarning(container);
+ }
+
+ Label lblAvailable = new Label(container, SWT.NONE);
+ lblAvailable.setLayoutData(new GridData(SWT.WRAP, SWT.CENTER, true,
+ false, 2, 1));
+
+ String textLabel = getAvailableText(hasProfiles);
+ lblAvailable.setText(textLabel);
+
+ if (hasProfiles) {
+
+ displayProfilesTable(container);
+
+ addSelectionButton(container, Messages.SelectProfilesDialog_SelectAll, true);
+ addSelectionButton(container, Messages.SelectProfilesDialog_DeselectAll, false);
- Label profilesLabel = new Label(container, SWT.NONE);
- profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
- profilesLabel.setText(NLS.bind(Messages.SelectProfilesDialog_Active_Profiles_for_Project, facade.getProject().getName()));
-
- profilesText = new Text(container, SWT.BORDER);
- profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
- profilesText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
- profilesText.setEditable(false);
- profilesText.setToolTipText(Messages.SelectProfilesDialog_Read_Only_profiles);
- updateProfilesText();
+ offlineModeBtn = addCheckButton(container, Messages.SelectProfilesDialog_Offline, offlineMode);
+ forceUpdateBtn = addCheckButton(container, Messages.SelectProfilesDialog_Force_update, forceUpdate);
}
- boolean hasProfiles = !sharedProfiles.isEmpty();
- Label warningLabel = new Label(container, SWT.CENTER);
- warningLabel.setVisible(false);
- GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(warningLabel);
- Label lblAvailable = new Label(container, SWT.NONE);
+ return area;
+ }
+
+ private void displayWarning(Composite container) {
+ warningImg = new Label(container, SWT.CENTER);
+ warningLabel = new Label(container, SWT.NONE);
+ warningLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.CENTER).applyTo(warningImg);
+ warningImg.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING));
+ warningLabel.setText( Messages.SelectProfilesDialog_Warning_Common_profiles);
+ }
+
+ private String getAvailableText(boolean hasProfiles) {
String textLabel;
-
if (hasProfiles) {
- if (facade == null) {
- textLabel = Messages.SelectProfilesDialog_Common_profiles;
- warningLabel.setImage(JFaceResources.getImage(DLG_IMG_MESSAGE_WARNING));
- warningLabel.setVisible(true);
- } else {
- textLabel = Messages.SelectProfilesDialog_Available_profiles;
- }
+ textLabel = Messages.SelectProfilesDialog_Available_profiles;
} else {
if (facade == null) {
textLabel = Messages.SelectProfilesDialog_No_Common_Profiles;
} else {
textLabel =
- NLS.bind(Messages.SelectProfilesDialog_Project_has_no_available_profiles, facade.getProject().getName());
+ NLS.bind(Messages.SelectProfilesDialog_Project_has_no_available_profiles,
+ facade.getProject().getName());
}
}
- lblAvailable.setText(textLabel);
- lblAvailable.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true,
- false, 2, 1));
+ return textLabel;
+ }
- if (hasProfiles) {
+ private void displayProfilesTable(Composite container) {
+ GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 4);
+ gd.heightHint = 200;
+ gd.widthHint = 500;
- GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true, 2, 4);
- gd.heightHint = 200;
- gd.widthHint = 500;
+ profileTableViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER);
+ Table table = profileTableViewer.getTable();
+ table.setFocus();
+ table.setLayoutData(gd);
+ table.setLinesVisible(true);
+ table.setHeaderVisible(true);
- profileTableViewer = CheckboxTableViewer.newCheckList(container, SWT.BORDER);
- Table table = profileTableViewer.getTable();
- table.setFocus();
- table.setLayoutData(gd);
- table.setLinesVisible(true);
- table.setHeaderVisible(true);
+ TableColumn profileColumn = new TableColumn(table, SWT.NONE);
+ profileColumn.setText(Messages.SelectProfilesDialog_Profile_id_header);
+ profileColumn.setWidth(350);
+
+ TableColumn sourceColumn = new TableColumn(table, SWT.NONE);
+ sourceColumn.setText(Messages.SelectProfilesDialog_Profile_source_header);
+ sourceColumn.setWidth(120);
+
- TableColumn profileColumn = new TableColumn(table, SWT.NONE);
- profileColumn.setText(Messages.SelectProfilesDialog_Profile_id_header);
- profileColumn.setWidth(350);
-
- TableColumn sourceColumn = new TableColumn(table, SWT.NONE);
- sourceColumn.setText(Messages.SelectProfilesDialog_Profile_source_header);
- sourceColumn.setWidth(120);
-
+ profileTableViewer.setContentProvider(ArrayContentProvider.getInstance());
- profileTableViewer.setContentProvider(ArrayContentProvider.getInstance());
+ profileTableViewer.setLabelProvider(new ProfileLabelProvider(container
+ .getFont()));
- profileTableViewer.setLabelProvider(new ProfileLabelProvider(parent
- .getFont()));
-
+
+ profileTableViewer.addCheckStateListener(new ICheckStateListener() {
- profileTableViewer.addCheckStateListener(new ICheckStateListener() {
+ public void checkStateChanged(CheckStateChangedEvent event) {
+ ProfileSelection profile = (ProfileSelection) event.getElement();
+ if (profileTableViewer.getGrayed(profile)) {
+ profileTableViewer.setGrayed(profile, false);
+ }
+ profile.setSelected(profileTableViewer.getChecked(profile));
+ if (Boolean.FALSE.equals(profile.getSelected())
+ || profile.getActivationState() == null) {
+ profile.setActivationState(ProfileState.Active);
+ }
- public void checkStateChanged(CheckStateChangedEvent event) {
- ProfileSelection profile = (ProfileSelection) event.getElement();
- if (profileTableViewer.getGrayed(profile)) {
- profileTableViewer.setGrayed(profile, false);
- }
- profile.setSelected(profileTableViewer.getChecked(profile));
- if (Boolean.FALSE.equals(profile.getSelected())
- || profile.getActivationState() == null) {
- profile.setActivationState(ProfileState.Active);
- }
-
- updateProfilesText();
- profileTableViewer.refresh();
- }
- });
-
- profileTableViewer.setInput(sharedProfiles);
+ updateProfilesAsText();
+ profileTableViewer.refresh();
+ }
+ });
+
+ profileTableViewer.setInput(sharedProfiles);
+
+ createMenu();
+ }
- addSelectionButton(container, Messages.SelectProfilesDialog_SelectAll, true);
-
- addSelectionButton(container, Messages.SelectProfilesDialog_DeselectAll, false);
-
- offlineModeBtn = addCheckButton(container, Messages.SelectProfilesDialog_Offline, offlineMode);
-
- forceUpdateBtn = addCheckButton(container, Messages.SelectProfilesDialog_Force_update, forceUpdate);
-
- createMenu();
- }
-
- return area;
+ private void displayProfilesAsText(Composite container) {
+ Label profilesLabel = new Label(container, SWT.NONE);
+ profilesLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 2, 1));
+ profilesLabel.setText(NLS.bind(Messages.SelectProfilesDialog_Active_Profiles_for_Project,
+ facade.getProject().getName()));
+
+ profilesText = new Text(container, SWT.BORDER);
+ profilesText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 3, 1));
+ profilesText.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_DARK_GRAY));
+ profilesText.setEditable(false);
+ profilesText.setToolTipText(Messages.SelectProfilesDialog_Read_Only_profiles);
+
+ updateProfilesAsText();
}
- private void updateProfilesText() {
+ private void updateProfilesAsText() {
if (profilesText != null) {
profilesText.setText(ProfileUtil.toString(sharedProfiles));
}
@@ -253,13 +267,13 @@
profileTableViewer.setAllGrayed(false);
for (ProfileSelection profile : sharedProfiles) {
profileTableViewer.setChecked(profile, ischecked);
-
- profile.setSelected(profileTableViewer.getChecked(profile));
- if (profile.getActivationState() == null) {
+ profile.setSelected(ischecked);
+ if (!ischecked || profile.getActivationState() == null) {
profile.setActivationState(ProfileState.Active);
}
}
- updateProfilesText();
+ profileTableViewer.refresh();
+ updateProfilesAsText();
}
public void widgetDefaultSelected(SelectionEvent e) {
@@ -468,7 +482,7 @@
if (ProfileState.Disabled.equals(state)) {
entry.setSelected(true);
}
- updateProfilesText();
+ updateProfilesAsText();
profileTableViewer.refresh();
}
super.run();
@@ -523,9 +537,9 @@
if (entry != null) {
if (columnIndex == PROFILE_ID_COLUMN) {
text.append(entry.getId());
-
ProfileState state = entry.getActivationState();
- if (Boolean.TRUE.equals(entry.getSelected()) && state == ProfileState.Disabled) {
+ if (Boolean.TRUE.equals(entry.getSelected())
+ && state == ProfileState.Disabled) {
text.append(Messages.SelectProfilesDialog_deactivated);
} else if (Boolean.TRUE.equals(entry.getAutoActive())) {
text.append(Messages.SelectProfilesDialog_autoactivated);
Modified: trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties
===================================================================
--- trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-22 13:32:25 UTC (rev 33136)
+++ trunk/maven/plugins/org.jboss.tools.maven.ui/src/org/jboss/tools/maven/ui/messages.properties 2011-07-22 14:00:57 UTC (rev 33137)
@@ -34,6 +34,7 @@
ConfiguratorPreferencePage_Configure_Seam_when_importing_Maven_projects=Seam
ConfiguratorPreferencePage_When_importing_Maven_projects_configure_the_following=When importing Maven projects configure the following:
+
ProfileManager_Updating_maven_profiles=Updating maven profiles
ProfileSelectionHandler_Maven_Builder_still_processing=The maven builder has not finished processing the selected project(s) yet.
ProfileSelectionHandler_Select_some_maven_projects=You must select at least one active Maven project
@@ -41,8 +42,8 @@
SelectProfilesDialog_Activate_menu=Activate {0}
SelectProfilesDialog_Active_Profiles_for_Project=Active profiles for {0} :
SelectProfilesDialog_autoactivated=\ (auto activated)
-SelectProfilesDialog_Available_profiles=Available profiles
-SelectProfilesDialog_Common_profiles=Common profiles for selected projects. Profiles specific to each project will not be affected.
+SelectProfilesDialog_Available_profiles=Available profiles :
+SelectProfilesDialog_Warning_Common_profiles=Only the profiles common to all selected projects are displayed. Other profiles will not be affected.
SelectProfilesDialog_Deactivate_menu=Deactivate {0}
SelectProfilesDialog_deactivated=\ (deactivated)
SelectProfilesDialog_DeselectAll=Deselect all
14 years, 5 months
JBoss Tools SVN: r33136 - in workspace/snjeza/org.jboss.tools.remote.debug.updatesite: features and 1 other directories.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-07-22 09:32:25 -0400 (Fri, 22 Jul 2011)
New Revision: 33136
Added:
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/features/org.jboss.tools.remote.debug.feature_1.0.0.201107212143.jar
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug.ui_1.0.0.201107212143.jar
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug_1.0.0.201107212143.jar
Removed:
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/features/org.jboss.tools.remote.debug.feature_1.0.0.201107172349.jar
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug.ui_1.0.0.201107172349.jar
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug_1.0.0.201107172349.jar
Modified:
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/artifacts.jar
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/content.jar
workspace/snjeza/org.jboss.tools.remote.debug.updatesite/site.xml
Log:
JBIDE-8548 Support auto discovery of remote processes for debugging
Modified: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/artifacts.jar
===================================================================
(Binary files differ)
Modified: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/content.jar
===================================================================
(Binary files differ)
Deleted: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/features/org.jboss.tools.remote.debug.feature_1.0.0.201107172349.jar
===================================================================
(Binary files differ)
Added: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/features/org.jboss.tools.remote.debug.feature_1.0.0.201107212143.jar
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/features/org.jboss.tools.remote.debug.feature_1.0.0.201107212143.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug.ui_1.0.0.201107172349.jar
===================================================================
(Binary files differ)
Added: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug.ui_1.0.0.201107212143.jar
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug.ui_1.0.0.201107212143.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Deleted: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug_1.0.0.201107172349.jar
===================================================================
(Binary files differ)
Added: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug_1.0.0.201107212143.jar
===================================================================
(Binary files differ)
Property changes on: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/plugins/org.jboss.tools.remote.debug_1.0.0.201107212143.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: workspace/snjeza/org.jboss.tools.remote.debug.updatesite/site.xml
===================================================================
--- workspace/snjeza/org.jboss.tools.remote.debug.updatesite/site.xml 2011-07-22 12:18:13 UTC (rev 33135)
+++ workspace/snjeza/org.jboss.tools.remote.debug.updatesite/site.xml 2011-07-22 13:32:25 UTC (rev 33136)
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<site>
- <feature url="features/org.jboss.tools.remote.debug.feature_1.0.0.201107172349.jar" id="org.jboss.tools.remote.debug.feature" version="1.0.0.201107172349">
+ <feature url="features/org.jboss.tools.remote.debug.feature_1.0.0.201107212143.jar" id="org.jboss.tools.remote.debug.feature" version="1.0.0.201107212143">
<category name="org.jboss.tools.remote.debug"/>
</feature>
<category-def name="org.jboss.tools.remote.debug" label="JBoss Tools Launching Support"/>
14 years, 5 months
JBoss Tools SVN: r33135 - trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test.
by jbosstools-commits@lists.jboss.org
Author: dgeraskov
Date: 2011-07-22 08:18:13 -0400 (Fri, 22 Jul 2011)
New Revision: 33135
Modified:
trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
Log:
https://issues.jboss.org/browse/JBIDE-9392
Opened query page view creates jdbc connection. Need to close it before
Modified: trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java
===================================================================
--- trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2011-07-22 11:21:06 UTC (rev 33134)
+++ trunk/hibernatetools/tests/org.hibernate.eclipse.console.test/src/org/hibernate/eclipse/console/test/ConsoleConfigurationTest.java 2011-07-22 12:18:13 UTC (rev 33135)
@@ -5,6 +5,10 @@
import junit.framework.TestCase;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
import org.hibernate.Hibernate;
import org.hibernate.Query;
import org.hibernate.SessionFactory;
@@ -18,6 +22,7 @@
import org.hibernate.console.QueryInputModel;
import org.hibernate.console.QueryPage;
import org.hibernate.eclipse.console.test.launchcfg.TestConsoleConfigurationPreferences;
+import org.hibernate.eclipse.console.views.QueryPageTabView;
import org.hibernate.impl.AbstractQueryImpl;
import org.hibernate.mapping.Column;
import org.hibernate.mapping.KeyValue;
@@ -152,6 +157,13 @@
model.addParameter(paramA);
model.addParameter(paramB);
model.addParameter(paramOrdered);
+
+ //fix for https://issues.jboss.org/browse/JBIDE-9392
+ //the view calls jdbc connection
+ IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IViewPart view = activePage.findView(QueryPageTabView.ID);
+ activePage.hideView(view);
+
QueryPage qp = consoleCfg.executeHQLQuery("select count(*) from java.awt.Button where 1 in ( ?, :a, :b )", model); //$NON-NLS-1$
assertNotNull(qp);
try{
14 years, 5 months
JBoss Tools SVN: r33134 - in trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test: META-INF and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: vrubezhny
Date: 2011-07-22 07:21:06 -0400 (Fri, 22 Jul 2011)
New Revision: 33134
Added:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages.properties
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages_de.properties
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.jar
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.xhtml
Modified:
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java
trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java
Log:
JBIDE-9087
Support of Bundles bean in CDI projects with Seam International module.
JUnit Test Case for Content Assist on bundles and their properties for Seam 3 International Module is added
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF 2011-07-22 10:46:36 UTC (rev 33133)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/META-INF/MANIFEST.MF 2011-07-22 11:21:06 UTC (rev 33134)
@@ -13,5 +13,10 @@
org.jboss.tools.tests,
org.eclipse.core.runtime;bundle-version="3.7.0",
org.jboss.tools.cdi.core,
- org.jboss.tools.jst.jsp.base.test
+ org.jboss.tools.jst.jsp.base.test,
+ org.jboss.tools.cdi.core.test;bundle-version="1.2.0",
+ org.jboss.tools.common;bundle-version="3.3.0",
+ org.eclipse.ui;bundle-version="3.7.0",
+ org.jboss.tools.common.base.test;bundle-version="3.3.0",
+ org.eclipse.jface.text;bundle-version="3.7.0"
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages.properties (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages.properties 2011-07-22 11:21:06 UTC (rev 33134)
@@ -0,0 +1,3 @@
+home_header=About this example application
+home_body=This sample application demonstrates how easy it is to develop stateful web applications using Java EE 6 augmented with portable Seam modules. Just register, login, and book a room to see the future of Java EE in action. Throughout the application you'll see notes in the sidebar that explain how this platform helps you meet enterprise application requirements.
+home_note=Note: Please do NOT enter personal information or your credit card number in this sample application.
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages_de.properties
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages_de.properties (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages_de.properties 2011-07-22 11:21:06 UTC (rev 33134)
@@ -0,0 +1,3 @@
+de_home_header=�ber dieses Beispiel-Anwendung
+de_home_body=Dieses Beispiel demonstriert, wie einfach es ist, EE-Module zu entwickeln stateful Web-Applikationen mit Java 6 mit tragbaren Augmented Seam. Just register, login, and book a room to see the future of Java EE in action. Einfach registrieren, einloggen, und buchen Sie ein Zimmer zum Handeln sieht die Zukunft von Java EE in. Throughout the application you'll see notes in the sidebar that explain how this platform helps you meet enterprise application requirements. W�hrend der Anwendung, die Sie in der Seitenleiste sehen Noten, die erkl�ren, wie diese Plattform hilft Ihnen, Enterprise Application Anforderungen.
+de_home_note=HINWEIS: Bitte keine pers�nlichen Daten oder Ihre Kreditkartennummer in dieser Beispielanwendung in Kraft.
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/messages_de.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.jar
===================================================================
(Binary files differ)
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.jar
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Added: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.xhtml
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.xhtml (rev 0)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.xhtml 2011-07-22 11:21:06 UTC (rev 33134)
@@ -0,0 +1,11 @@
+<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<ui:composition xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:ui="http://java.sun.com/jsf/facelets"
+ xmlns:f="http://java.sun.com/jsf/core"
+ xmlns:h="http://java.sun.com/jsf/html">
+
+ <ui:define name="body">
+ <h:outputText value="#{bundles.messages.home_header}"/>
+ </ui:define>
+</ui:composition>
\ No newline at end of file
Property changes on: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/resources/seam-international.xhtml
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java 2011-07-22 10:46:36 UTC (rev 33133)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/CDISeamCoreAllTests.java 2011-07-22 11:21:06 UTC (rev 33134)
@@ -19,6 +19,7 @@
* @author Alexey Kazakov
*/
public class CDISeamCoreAllTests {
+ protected static String PLUGIN_ID = "org.jboss.tools.cdi.seam.core.test";
public static Test suite() {
JavaModelManager.getIndexManager().disable();
Modified: trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java
===================================================================
--- trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java 2011-07-22 10:46:36 UTC (rev 33133)
+++ trunk/cdi/tests/org.jboss.tools.cdi.seam.core.test/src/org/jboss/tools/cdi/seam/core/test/SeamResourceBundlesTest.java 2011-07-22 11:21:06 UTC (rev 33134)
@@ -10,13 +10,101 @@
******************************************************************************/
package org.jboss.tools.cdi.seam.core.test;
-import junit.framework.TestCase;
+import java.io.File;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IncrementalProjectBuilder;
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Platform;
+import org.jboss.tools.cdi.core.CDICorePlugin;
+import org.jboss.tools.cdi.core.test.tck.TCKTest;
+import org.jboss.tools.cdi.seam.core.CDISeamCorePlugin;
+import org.jboss.tools.common.util.FileUtil;
+import org.jboss.tools.jst.jsp.test.TestUtil;
+import org.jboss.tools.jst.jsp.test.ca.ContentAssistantTestCase;
+import org.jboss.tools.jst.web.kb.internal.validation.ValidatorManager;
+import org.jboss.tools.test.util.JobUtils;
+import org.osgi.framework.Bundle;
+
/**
* @author Alexey Kazakov
+ * @author Victor Rubezhny
*/
-public class SeamResourceBundlesTest extends TestCase {
+public class SeamResourceBundlesTest extends TCKTest {
+ protected static final String SEAM_INTERNATIONAL_LIB_SUFFIX = "/seam-international.jar";
+ protected static final String SEAM_INTERNATIONAL_PAGE_SUFFIX = "/seam-international.xhtml";
+ protected static final String DEFAULT_RESOURCE_BUNDLE_SUFFIX = "/messages.properties";
+ protected static final String DE_RESOURCE_BUNDLE_SUFFIX = "/messages_de.properties";
+ protected static final String RESOURCES_SUFFIX = "/resources";
+
+ protected static String LIB_SUFFIX = "/lib";
+ private ContentAssistantTestCase caTest = new ContentAssistantTestCase();
+ private static final String PAGE_NAME = "WebContent/seam-international.xhtml";
+ private String[] resourceBundleNames = new String[] {"bundles.messages"};
+ private String[] defaultResourceBundleNameProperties = new String[] {"bundles.messages.home_header", "bundles.messages.home_body", "bundles.messages.home_note"};
+ private String[] germanResourceBundleNameProperties = new String[] {"bundles.messages.de_home_header", "bundles.messages.de_home_body", "bundles.messages.de_home_note"};
+
public void testResourceBundles() {
+ // Set up seam-international.jar library into the project's WEB-INF/lib folder
+ try {
+ assertTrue("Cannot set up SEAM International module and resource bundles into a test project",
+ setUpSeamInternationalLibraryAndResourceBundle());
+ } catch (Exception e) {
+ fail("Cannot set up SEAM International module and resource bundles into a test project: "
+ + e.getLocalizedMessage());
+ }
+
+ // Test that seam-international module is successfully installed on the CDI project
+ assertTrue("SEAM International module is not installed or incorrectly installed",
+ CDICorePlugin.getCDI(tckProject, true).getExtensionManager()
+ .isCDIExtensionAvailable(CDISeamCorePlugin.CDI_INTERNATIONAL_RUNTIME_EXTENTION));
+
+ // Perform CA test
+ caTest.checkProposals(PAGE_NAME, "value=\"#{", 9, resourceBundleNames, false);
+ caTest.checkProposals(PAGE_NAME, "value=\"#{bundles.messages.", 26, defaultResourceBundleNameProperties, false);
+ caTest.checkProposals(PAGE_NAME, "value=\"#{bundles.messages.", 26, germanResourceBundleNameProperties, false);
+
}
+
+ private boolean setUpSeamInternationalLibraryAndResourceBundle() throws Exception {
+ Bundle b = Platform.getBundle(CDISeamCoreAllTests.PLUGIN_ID);
+ String projectPath = tckProject.getLocation().toOSString();
+ String resourcePath = FileLocator.resolve(b.getEntry(RESOURCES_SUFFIX)).getFile();
+
+ File seamInternationalLibFrom = new File(resourcePath + SEAM_INTERNATIONAL_LIB_SUFFIX);
+ File seamInternationalLibTo = new File(projectPath + WEB_CONTENT_SUFFIX + WEB_INF_SUFFIX
+ + LIB_SUFFIX + SEAM_INTERNATIONAL_LIB_SUFFIX);
+ if (!FileUtil.copyFile(seamInternationalLibFrom, seamInternationalLibTo))
+ return false;
+
+ File defaultResourceBundleFrom = new File(resourcePath + DEFAULT_RESOURCE_BUNDLE_SUFFIX);
+ File defaultResourceBundleTo = new File(projectPath + JAVA_SOURCE_SUFFIX + DEFAULT_RESOURCE_BUNDLE_SUFFIX);
+ if (!FileUtil.copyFile(defaultResourceBundleFrom, defaultResourceBundleTo))
+ return false;
+
+ File germanResourceBundleFrom = new File(resourcePath + DE_RESOURCE_BUNDLE_SUFFIX);
+ File germanResourceBundleTo = new File(projectPath + JAVA_SOURCE_SUFFIX + DE_RESOURCE_BUNDLE_SUFFIX);
+ if (!FileUtil.copyFile(germanResourceBundleFrom, germanResourceBundleTo))
+ return false;
+
+ File seamInternationalPageFrom = new File(resourcePath + SEAM_INTERNATIONAL_PAGE_SUFFIX);
+ File seamInternationalPageTo = new File(projectPath + WEB_CONTENT_SUFFIX
+ + SEAM_INTERNATIONAL_PAGE_SUFFIX);
+ if (!FileUtil.copyFile(seamInternationalPageFrom, seamInternationalPageTo))
+ return false;
+
+ ValidatorManager.setStatus(ValidatorManager.RUNNING);
+ tckProject.refreshLocal(IResource.DEPTH_INFINITE, null);
+ JobUtils.waitForIdle();
+ tckProject.build(IncrementalProjectBuilder.CLEAN_BUILD, new NullProgressMonitor());
+ JobUtils.waitForIdle();
+ tckProject.build(IncrementalProjectBuilder.FULL_BUILD, new NullProgressMonitor());
+ TestUtil.waitForValidation();
+
+ caTest.setProject(tckProject);
+ return true;
+ }
}
\ No newline at end of file
14 years, 5 months