JBoss Tools SVN: r35864 - trunk/central/plugins/org.jboss.tools.central.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-20 16:06:25 -0400 (Thu, 20 Oct 2011)
New Revision: 35864
Modified:
trunk/central/plugins/org.jboss.tools.central/plugin.xml
Log:
JBIDE-9979 JBoss Central Seam 2 Tutorials
Modified: trunk/central/plugins/org.jboss.tools.central/plugin.xml
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/plugin.xml 2011-10-20 19:49:40 UTC (rev 35863)
+++ trunk/central/plugins/org.jboss.tools.central/plugin.xml 2011-10-20 20:06:25 UTC (rev 35864)
@@ -211,7 +211,7 @@
priority="2" />
<category
id="org.jboss.tools.central.seam2"
- name="Seam 2 tutorials"
+ name="Seam 2 Tutorials"
priority="5" />
<tutorial
id="org.jboss.tools.central.jbossas.quickstart.helloworld"
13 years, 2 months
JBoss Tools SVN: r35863 - trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-20 15:49:40 -0400 (Thu, 20 Oct 2011)
New Revision: 35863
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java
Log:
JBIDE-9244
https://issues.jboss.org/browse/JBIDE-9244
Comments to new interface are added.
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java 2011-10-20 19:28:27 UTC (rev 35862)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java 2011-10-20 19:49:40 UTC (rev 35863)
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * 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
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
package org.jboss.tools.cdi.core.extension.feature;
import org.jboss.tools.cdi.core.IBean;
@@ -2,3 +12,19 @@
+/**
+ *
+ * @author Viacheslav Kabanovich
+ *
+ */
public interface IBeanKeyProvider extends ICDIFeature {
+ /**
+ * Returns a key for the bean that allows to link relevant resources
+ * to the resource that declares the bean. Relevance is determined
+ * by consistency of the incremental validation. The key needs not to be unique,
+ * it just has to provide low probability of irrelevant links.
+ * Implementation does not have to provide key for any bean.
+ * Method may return null.
+ *
+ * @param bean
+ * @return a key for the bean to be used by the incremental validation for linking resources or null
+ */
public String getKey(IBean bean);
13 years, 2 months
JBoss Tools SVN: r35862 - in trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi: internal/core/validation and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-20 15:28:27 -0400 (Thu, 20 Oct 2011)
New Revision: 35862
Added:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java
Modified:
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
Log:
JBIDE-9244
https://issues.jboss.org/browse/JBIDE-9244
Linking of files with identical default beans added. Message about invalid type restriction is modified to be consistent with different kinds of restriction.
Added: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java (rev 0)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java 2011-10-20 19:28:27 UTC (rev 35862)
@@ -0,0 +1,7 @@
+package org.jboss.tools.cdi.core.extension.feature;
+
+import org.jboss.tools.cdi.core.IBean;
+
+public interface IBeanKeyProvider extends ICDIFeature {
+ public String getKey(IBean bean);
+}
Property changes on: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/core/extension/feature/IBeanKeyProvider.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-10-20 19:23:53 UTC (rev 35861)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDICoreValidator.java 2011-10-20 19:28:27 UTC (rev 35862)
@@ -80,6 +80,7 @@
import org.jboss.tools.cdi.core.IStereotype;
import org.jboss.tools.cdi.core.IStereotypeDeclaration;
import org.jboss.tools.cdi.core.IStereotyped;
+import org.jboss.tools.cdi.core.extension.feature.IBeanKeyProvider;
import org.jboss.tools.cdi.core.extension.feature.IInjectionPointValidatorFeature;
import org.jboss.tools.cdi.core.extension.feature.IValidatorFeature;
import org.jboss.tools.cdi.core.preferences.CDIPreferences;
@@ -661,12 +662,19 @@
if(beans.isEmpty()) {
return Collections.emptySet();
}
+ Set<IBeanKeyProvider> ps = cdiProject.getNature().getExtensionManager().getFeatures(IBeanKeyProvider.class);
Set<String> result = new HashSet<String>();
for (IBean bean : beans) {
String name = bean.getName();
if(name!=null) {
result.add(name);
}
+ for (IBeanKeyProvider p: ps) {
+ String key = p.getKey(bean);
+ if(key != null) {
+ result.add(key);
+ }
+ }
}
return result;
}
@@ -2204,13 +2212,7 @@
}
}
if (!typeWasFound) {
- String message = bean instanceof IClassBean
- ? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS
- : bean instanceof IProducerField
- ? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD
- : bean instanceof IProducerMethod
- ? CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD
- : CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION;
+ String message = CDIValidationMessages.ILLEGAL_TYPE_IN_TYPED_DECLARATION;
addError(message, CDIPreferences.ILLEGAL_TYPE_IN_TYPED_DECLARATION, typedDeclaration, bean.getResource());
}
}
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2011-10-20 19:23:53 UTC (rev 35861)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/CDIValidationMessages.java 2011-10-20 19:28:27 UTC (rev 35862)
@@ -38,9 +38,6 @@
public static String UNRESOLVABLE_EL_NAME;
public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION;
- public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS;
- public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD;
- public static String ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD;
public static String PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD;
public static String PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE;
public static String PRODUCER_FIELD_TYPE_HAS_WILDCARD;
Modified: trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties
===================================================================
--- trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2011-10-20 19:23:53 UTC (rev 35861)
+++ trunk/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/validation/messages.properties 2011-10-20 19:28:27 UTC (rev 35862)
@@ -16,10 +16,7 @@
DECORATOR_RESOLVES_TO_FINAL_CLASS=Decorator must not be bound to a managed bean implemented by a class {0} which is declared final [JSR-299 �8.3]
DECORATOR_RESOLVES_TO_FINAL_METHOD=Decorator matches a managed bean {0} with a non-static, non-private, final method {1}, and the decorator also implements that method [JSR-299 �8.3]
-ILLEGAL_TYPE_IN_TYPED_DECLARATION=Bean specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean [JSR-299 �2.2.2]
-ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_BEAN_CLASS=Bean class specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean [JSR-299 �2.2.2]
-ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_METHOD=Producer method specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean [JSR-299 �2.2.2]
-ILLEGAL_TYPE_IN_TYPED_DECLARATION_IN_PRODUCER_FIELD=Producer field specifies a @Typed annotation, and the value member specifies a class which does not correspond to a type in the unrestricted set of bean types of a bean [JSR-299 �2.2.2]
+ILLEGAL_TYPE_IN_TYPED_DECLARATION=Bean specifies a type restriction which does not correspond to a type in the unrestricted set of bean types of a bean [JSR-299 �2.2.2]
PRODUCER_METHOD_RETURN_TYPE_HAS_WILDCARD=Producer method return type must not contain a wildcard type parameter [JSR-299 �3.3]
PRODUCER_METHOD_RETURN_TYPE_IS_VARIABLE=Producer method return type cannot be a type variable [JSR-299 �3.3]
PRODUCER_FIELD_TYPE_HAS_WILDCARD=Producer field type must not contain a wildcard type parameter [JSR-299 �3.4]
13 years, 2 months
JBoss Tools SVN: r35861 - branches/jbosstools-3.3.0.M4/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl.
by jbosstools-commits@lists.jboss.org
Author: scabanovich
Date: 2011-10-20 15:23:53 -0400 (Thu, 20 Oct 2011)
New Revision: 35861
Modified:
branches/jbosstools-3.3.0.M4/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
Log:
JBIDE-9951
https://issues.jboss.org/browse/JBIDE-9951
Null pointer fixed. Merge to 3.3.0.M4
Modified: branches/jbosstools-3.3.0.M4/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java
===================================================================
--- branches/jbosstools-3.3.0.M4/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-10-20 19:10:33 UTC (rev 35860)
+++ branches/jbosstools-3.3.0.M4/cdi/plugins/org.jboss.tools.cdi.core/src/org/jboss/tools/cdi/internal/core/impl/CDIProject.java 2011-10-20 19:23:53 UTC (rev 35861)
@@ -876,19 +876,19 @@
}
}
}
- }
- for (IProject p: ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
- if(p.isAccessible()) {
- CDICorePlugin.getCDI(p, true);
+ for (IProject p: ResourcesPlugin.getWorkspace().getRoot().getProjects()) {
+ if(p.isAccessible()) {
+ CDICorePlugin.getCDI(p, true);
+ }
}
- }
- CDICoreNature[] ns = getNature().getAllDependentProjects();
- for (CDICoreNature n: ns) {
- if(n.getDelegate() instanceof CDIProject) {
- CDIProject p = (CDIProject)n.getDelegate();
- for (IBean b: p.getDeclaredBeans()) {
- if(b instanceof IClassBean) {
- collectObserverMethods((IClassBean)b, eventType, injectionPoint, result);
+ CDICoreNature[] ns = getNature().getAllDependentProjects();
+ for (CDICoreNature n: ns) {
+ if(n.getDelegate() instanceof CDIProject) {
+ CDIProject p = (CDIProject)n.getDelegate();
+ for (IBean b: p.getDeclaredBeans()) {
+ if(b instanceof IClassBean) {
+ collectObserverMethods((IClassBean)b, eventType, injectionPoint, result);
+ }
}
}
}
@@ -907,7 +907,7 @@
result.add(m);
}
}
- }
+ }
}
/**
13 years, 2 months
JBoss Tools SVN: r35860 - in trunk/as/tests: org.jboss.tools.openshift.express.client.test and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-10-20 15:10:33 -0400 (Thu, 20 Oct 2011)
New Revision: 35860
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml
Log:
fixed parent pom reference for new test plugins. Plugins artifact was used instead of tests.
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-10-20 18:37:24 UTC (rev 35859)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-10-20 19:10:33 UTC (rev 35860)
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.tools.as</groupId>
- <artifactId>plugins</artifactId>
+ <artifactId>tests</artifactId>
<version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.tests</groupId>
Modified: trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml 2011-10-20 18:37:24 UTC (rev 35859)
+++ trunk/as/tests/org.jboss.tools.openshift.express.client.test/pom.xml 2011-10-20 19:10:33 UTC (rev 35860)
@@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jboss.tools.as</groupId>
- <artifactId>plugins</artifactId>
+ <artifactId>tests</artifactId>
<version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.plugins</groupId>
13 years, 2 months
JBoss Tools SVN: r35859 - in branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-20 14:37:24 -0400 (Thu, 20 Oct 2011)
New Revision: 35859
Modified:
branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-9976 Tooltips in JBoss Central crash in Windows 7 64bits
Modified: branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-20 18:29:40 UTC (rev 35858)
+++ branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-20 18:37:24 UTC (rev 35859)
@@ -31,6 +31,8 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -91,6 +93,8 @@
// The plug-in ID
public static final String PLUGIN_ID = "org.jboss.tools.central"; //$NON-NLS-1$
+ private static Boolean isInternalWebBrowserAvailable;
+
public static final String SHOW_JBOSS_CENTRAL_ON_STARTUP = "showJBossCentralOnStartup";
public static final boolean SHOW_JBOSS_CENTRAL_ON_STARTUP_DEFAULT_VALUE = true;
@@ -435,4 +439,30 @@
}
return directory;
}
+
+ public static boolean isInternalWebBrowserAvailable() {
+ if (isInternalWebBrowserAvailable != null) {
+ return isInternalWebBrowserAvailable.booleanValue();
+ }
+ Shell shell = null;
+ try {
+ shell = new Shell(PlatformUI.getWorkbench().getDisplay());
+ new Browser(shell, SWT.NONE);
+ isInternalWebBrowserAvailable = new Boolean(true);
+ return true;
+ } catch (Throwable t) {
+ try {
+ new Browser(shell, SWT.WEBKIT);
+ isInternalWebBrowserAvailable = new Boolean(true);
+ return true;
+ } catch (Throwable e) {
+ isInternalWebBrowserAvailable = new Boolean(false);
+ return false;
+ }
+ } finally {
+ if (shell != null)
+ shell.dispose();
+ }
+ }
+
}
Modified: branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-20 18:29:40 UTC (rev 35858)
+++ branches/jbosstools-3.3.0.M4/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-20 18:37:24 UTC (rev 35859)
@@ -941,7 +941,7 @@
//formText.setFont("author", boldFont);
formText.setColor("author", JFaceColors.getHyperlinkText(getDisplay()));
formText.setImage("image", getFeedsImage());
- if (entry.getDescription() != null && !entry.getDescription().isEmpty()) {
+ if (JBossCentralActivator.isInternalWebBrowserAvailable() && entry.getDescription() != null && !entry.getDescription().isEmpty()) {
ToolTip toolTip = new FeedsToolTip(formText, entry.getDate() + " " + entry.getDescription());
toolTip.activate();
}
13 years, 2 months
JBoss Tools SVN: r35858 - trunk/as/tests/org.jboss.ide.eclipse.as.egit.test.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-10-20 14:29:40 -0400 (Thu, 20 Oct 2011)
New Revision: 35858
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
Log:
fixed artifact ID in pom.xml for as.egit.test plugin
Modified: trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml
===================================================================
--- trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-10-20 18:24:08 UTC (rev 35857)
+++ trunk/as/tests/org.jboss.ide.eclipse.as.egit.test/pom.xml 2011-10-20 18:29:40 UTC (rev 35858)
@@ -7,6 +7,6 @@
<version>2.3.0-SNAPSHOT</version>
</parent>
<groupId>org.jboss.tools.as.tests</groupId>
- <artifactId>org.jboss.ide.eclipse.as.egit.internal.test</artifactId>
+ <artifactId>org.jboss.ide.eclipse.as.egit.test</artifactId>
<packaging>eclipse-test-plugin</packaging>
</project>
13 years, 2 months
JBoss Tools SVN: r35857 - trunk/build.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2011-10-20 14:24:08 -0400 (Thu, 20 Oct 2011)
New Revision: 35857
Modified:
trunk/build/pom.xml
Log:
as-bootstrap profile updated to include common, because now as component depends from common component
Modified: trunk/build/pom.xml
===================================================================
--- trunk/build/pom.xml 2011-10-20 17:58:33 UTC (rev 35856)
+++ trunk/build/pom.xml 2011-10-20 18:24:08 UTC (rev 35857)
@@ -99,6 +99,7 @@
<id>as-bootstrap</id>
<modules>
<module>../tests</module>
+ <module>../common</module>
<module>../archives</module>
<module>../jmx</module>
<module>../as</module>
13 years, 2 months
JBoss Tools SVN: r35856 - in trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central: editors and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: snjeza
Date: 2011-10-20 13:58:33 -0400 (Thu, 20 Oct 2011)
New Revision: 35856
Modified:
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
Log:
JBIDE-9976 Tooltips in JBoss Central crash in Windows 7 64bits
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-20 17:55:43 UTC (rev 35855)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/JBossCentralActivator.java 2011-10-20 17:58:33 UTC (rev 35856)
@@ -31,6 +31,8 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.resource.ImageRegistry;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IEditorInput;
@@ -132,6 +134,8 @@
// The shared instance
private static JBossCentralActivator plugin;
+ private static Boolean isInternalWebBrowserAvailable;
+
/**
* The constructor
*/
@@ -436,4 +440,29 @@
}
return directory;
}
+
+ public static boolean isInternalWebBrowserAvailable() {
+ if (isInternalWebBrowserAvailable != null) {
+ return isInternalWebBrowserAvailable.booleanValue();
+ }
+ Shell shell = null;
+ try {
+ shell = new Shell(PlatformUI.getWorkbench().getDisplay());
+ new Browser(shell, SWT.NONE);
+ isInternalWebBrowserAvailable = new Boolean(true);
+ return true;
+ } catch (Throwable t) {
+ try {
+ new Browser(shell, SWT.WEBKIT);
+ isInternalWebBrowserAvailable = new Boolean(true);
+ return true;
+ } catch (Throwable e) {
+ isInternalWebBrowserAvailable = new Boolean(false);
+ return false;
+ }
+ } finally {
+ if (shell != null)
+ shell.dispose();
+ }
+ }
}
Modified: trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java
===================================================================
--- trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-20 17:55:43 UTC (rev 35855)
+++ trunk/central/plugins/org.jboss.tools.central/src/org/jboss/tools/central/editors/GettingStartedPage.java 2011-10-20 17:58:33 UTC (rev 35856)
@@ -941,7 +941,7 @@
//formText.setFont("author", boldFont);
formText.setColor("author", JFaceColors.getHyperlinkText(getDisplay()));
formText.setImage("image", getFeedsImage());
- if (entry.getDescription() != null && !entry.getDescription().isEmpty()) {
+ if (JBossCentralActivator.isInternalWebBrowserAvailable() && entry.getDescription() != null && !entry.getDescription().isEmpty()) {
ToolTip toolTip = new FeedsToolTip(formText, entry.getDate() + " " + entry.getDescription());
toolTip.activate();
}
13 years, 2 months
JBoss Tools SVN: r35855 - workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit.
by jbosstools-commits@lists.jboss.org
Author: yradtsevich
Date: 2011-10-20 13:55:43 -0400 (Thu, 20 Oct 2011)
New Revision: 35855
Modified:
workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java
Log:
https://issues.jboss.org/browse/JBIDE-9539 : Browsersim app for testing mobile/desktop web apps
- Linux x86 version also works now
Modified: workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java
===================================================================
--- workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java 2011-10-20 17:25:03 UTC (rev 35854)
+++ workspace/yradtsevich/browsersim/swt-webkit-browsersim/org.jboss.tools.browsersim.webkit.gtk.linux.x86/src/org/jboss/tools/browsersim/webkit/WebKitBrowser.java 2011-10-20 17:55:43 UTC (rev 35855)
@@ -11,17 +11,29 @@
package org.jboss.tools.browsersim.webkit;
import java.lang.reflect.Field;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
import org.eclipse.swt.browser.Browser;
import org.eclipse.swt.internal.Converter;
import org.eclipse.swt.internal.gtk.OS;
-import org.eclipse.swt.internal.webkit.WebKitGTK;
import org.eclipse.swt.widgets.Composite;
/**
* @author Yahor Radtsevich (yradtsevich)
*/
public class WebKitBrowser extends AbstractWebKitBrowser {
+ private static final byte[] USER_AGENT; // = WebKitGTK.user_agent
+ static {
+ int length = "user-agent".length();
+ char [] chars = new char[length];
+ "user-agent".getChars(0, length, chars, 0);
+ USER_AGENT = new byte[length + 1];
+ for (int i = 0; i < length; i++) {
+ USER_AGENT[i] = (byte) chars [i];
+ }
+ }
+
public WebKitBrowser(Composite parent, int style) {
super(parent, style);
}
@@ -35,12 +47,17 @@
Field webViewField = webKit.getClass().getDeclaredField("webView");
webViewField.setAccessible(true);
int webView = (Integer) webViewField.get(webKit);
- int settings = WebKitGTK.webkit_web_view_get_settings(webView);
+
+// int settings = WebKitGTK.webkit_web_view_get_settings(webView);
+ Class webKitGTKClass = Browser.class.getClassLoader().loadClass("org.eclipse.swt.internal.webkit.WebKitGTK");
+ Method webkit_web_view_get_settingsMethod = webKitGTKClass.getDeclaredMethod("webkit_web_view_get_settings", int.class);
+ int settings = (Integer) webkit_web_view_get_settingsMethod.invoke(null, webView);
+
if (userAgent != null) {
byte[] bytes = Converter.wcsToMbcs(null, userAgent, true);
- OS.g_object_set(settings, WebKitGTK.user_agent, bytes, 0);
+ OS.g_object_set(settings, USER_AGENT, bytes, 0);
} else {
- OS.g_object_set(settings, WebKitGTK.user_agent, 0, 0);
+ OS.g_object_set(settings, USER_AGENT, 0, 0);
}
} catch (SecurityException e) {
e.printStackTrace();
@@ -50,6 +67,12 @@
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.printStackTrace();
}
}
}
13 years, 2 months