Author: snjeza
Date: 2012-02-17 16:27:41 -0500 (Fri, 17 Feb 2012)
New Revision: 38894
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
trunk/examples/plugins/org.jboss.tools.project.examples/schema/downloadruntimes.exsd
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/runtimes/DownloadRuntime.java
Log:
JBIDE-9899 runtime downloads should be clear where it is from (url) and if community show
disclaimer
Modified: trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml
===================================================================
--- trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2012-02-17 20:24:33
UTC (rev 38893)
+++ trunk/examples/plugins/org.jboss.tools.project.examples/plugin.xml 2012-02-17 21:27:41
UTC (rev 38894)
@@ -95,44 +95,51 @@
name="JBoss AS 7.1.0 Certified Java EE 6 Full Profile"
version="7.1.0.Final"
size="100MB"
-
url="http://download.jboss.org/jbossas/7.1/jboss-as-7.1.0.Final/jbos...
+
url="http://download.jboss.org/jbossas/7.1/jboss-as-7.1.0.Final/jbos...
+ disclaimer="true"/>
<runtime
id="org.jboss.tools.runtime.core.as.701"
name="JBoss AS 7.0.1 Everything (NOT Java EE6 Certified)"
version="7.0.1.Final"
size="74MB"
-
url="http://download.jboss.org/jbossas/7.0/jboss-as-7.0.1.Final/jbos...
+
url="http://download.jboss.org/jbossas/7.0/jboss-as-7.0.1.Final/jbos...
+ disclaimer="true"/>
<runtime
id="org.jboss.tools.runtime.core.as.702"
name="JBoss AS 7.0.2 Everything (NOT Java EE6 Certified)"
version="7.0.2.Final"
size="75MB"
-
url="http://download.jboss.org/jbossas/7.0/jboss-as-7.0.2.Final/jbos...
+
url="http://download.jboss.org/jbossas/7.0/jboss-as-7.0.2.Final/jbos...
+ disclaimer="true"/>
<runtime
id="org.jboss.tools.runtime.core.seam.222"
name="JBoss Seam 2.2.2.Final"
version="2.2.2.Final"
size="113.2MB"
-
url="http://sourceforge.net/projects/jboss/files/JBoss%20Seam/2.2.2....
+
url="http://sourceforge.net/projects/jboss/files/JBoss%20Seam/2.2.2....
+ disclaimer="true"/>
<runtime
id="org.jboss.tools.runtime.core.seam.202"
name="JBoss Seam 2.0.2.SP1"
version="2.0.2.SP1"
size="92.3MB"
-
url="http://sourceforge.net/projects/jboss/files/JBoss%20Seam/2.0.2....
+
url="http://sourceforge.net/projects/jboss/files/JBoss%20Seam/2.0.2....
+ disclaimer="true"/>
<runtime
id="org.jboss.tools.runtime.core.as.610"
name="JBoss AS 6.1.0"
version="6.1.0.Final"
size="183MB"
-
url="http://download.jboss.org/jbossas/6.1/jboss-as-distribution-6.1...
+
url="http://download.jboss.org/jbossas/6.1/jboss-as-distribution-6.1...
+ disclaimer="true"/>
<runtime
id="org.jboss.tools.runtime.core.as.423"
name="JBoss AS 4.2.3"
version="4.2.3"
size="100MB"
-
url="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.G...
+
url="http://sourceforge.net/projects/jboss/files/JBoss/JBoss-4.2.3.G...
+ disclaimer="true"/>
</extension>
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/schema/downloadruntimes.exsd
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/schema/downloadruntimes.exsd 2012-02-17
20:24:33 UTC (rev 38893)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/schema/downloadruntimes.exsd 2012-02-17
21:27:41 UTC (rev 38894)
@@ -84,6 +84,13 @@
</documentation>
</annotation>
</attribute>
+ <attribute name="disclaimer" type="boolean">
+ <annotation>
+ <documentation>
+
+ </documentation>
+ </annotation>
+ </attribute>
</complexType>
</element>
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2012-02-17
20:24:33 UTC (rev 38893)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/ProjectExamplesActivator.java 2012-02-17
21:27:41 UTC (rev 38894)
@@ -201,6 +201,8 @@
private static final String VERSION = "version"; //$NON-NLS-1$
private static final String URL = "url"; //$NON-NLS-1$
+
+ private static final String DISCLAIMER = "disclaimer"; //$NON-NLS-1$
private Map<String, DownloadRuntime> downloadRuntimes;
@@ -1015,7 +1017,11 @@
String id = configurationElement.getAttribute(ID);
String version = configurationElement.getAttribute(VERSION);
String url = configurationElement.getAttribute(URL);
+ String disclaimer = configurationElement.getAttribute(DISCLAIMER);
DownloadRuntime downloadRuntime = new DownloadRuntime(id, name, version, url);
+ if (Boolean.FALSE.toString().equals(disclaimer)) {
+ downloadRuntime.setDisclaimer(false);
+ }
downloadRuntimes.put(id, downloadRuntime);
}
}
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java 2012-02-17
20:24:33 UTC (rev 38893)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/dialog/DownloadRuntimeDialog.java 2012-02-17
21:27:41 UTC (rev 38894)
@@ -44,9 +44,13 @@
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.browser.IWorkbenchBrowserSupport;
import org.jboss.tools.project.examples.ProjectExamplesActivator;
import org.jboss.tools.project.examples.filetransfer.ECFExamplesTransport;
import org.jboss.tools.project.examples.runtimes.DownloadRuntime;
@@ -96,7 +100,7 @@
Composite contents = new Composite(area, SWT.NONE);
GridData gd = new GridData(GridData.FILL_BOTH);
//gd.heightHint = 200;
- gd.widthHint = 600;
+ gd.widthHint = 700;
contents.setLayoutData(gd);
contents.setLayout(new GridLayout(1, false));
applyDialogFont(contents);
@@ -107,7 +111,63 @@
pathComposite.setLayoutData(gd);
pathComposite.setLayout(new GridLayout(3, false));
-
+ if (downloadRuntime.isDisclaimer()) {
+ Group disclaimerComposite = new Group(pathComposite, SWT.NONE);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.horizontalSpan = 3;
+ disclaimerComposite.setLayoutData(gd);
+ disclaimerComposite.setLayout(new GridLayout(1, false));
+ disclaimerComposite.setText("Warning");
+ new Label(disclaimerComposite, SWT.NONE).setText("This is a community project
and, as such is not supported with an SLA.");
+ Link link = new Link(disclaimerComposite, SWT.NONE);
+ link.setText("Any questions or problems can be raised through the <a>JBoss
AS 7 User Forum</a> where the community will provide their best efforts to
assist.");
+ Link link1 = new Link(disclaimerComposite, SWT.NONE);
+ link1.setText("This project is included in the JBoss Enterprise Application
Platform for which a <a>support subscription</a> is available.");
+
+ link.addSelectionListener( new SelectionAdapter( ) {
+
+ public void widgetSelected( SelectionEvent e )
+ {
+ String text = e.text;
+ if ("JBoss AS 7 User Forum".equals(text)) {
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ try {
+ URL url = new
URL("http://community.jboss.org/en/jbossas/as7_users?view=discussion...;
//$NON-NLS-1$
+ support.getExternalBrowser().openURL(url);
+ } catch (Exception e1) {
+ ProjectExamplesActivator.log(e1);
+ }
+ }
+
+ }
+ } );
+ link1.addSelectionListener( new SelectionAdapter( ) {
+
+ public void widgetSelected( SelectionEvent e )
+ {
+ String text = e.text;
+ if ("support subscription".equals(text)) {
+ IWorkbenchBrowserSupport support = PlatformUI.getWorkbench()
+ .getBrowserSupport();
+ try {
+ URL url = new
URL("http://www.redhat.com/jboss/"); //$NON-NLS-1$
+ support.getExternalBrowser().openURL(url);
+ } catch (Exception e1) {
+ ProjectExamplesActivator.log(e1);
+ }
+ }
+
+ }
+ } );
+ }
+ Label urlLabel = new Label(pathComposite, SWT.NONE);
+ urlLabel.setText("URL:");
+ Text urlText = new Text(pathComposite, SWT.READ_ONLY|SWT.BORDER);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.horizontalSpan=2;
+ urlText.setLayoutData(gd);
+ urlText.setText(downloadRuntime.getUrl());
Label pathLabel = new Label(pathComposite, SWT.NONE);
pathLabel.setText("Install folder:");
@@ -185,6 +245,9 @@
});
deleteOnExit = new Button(pathComposite, SWT.CHECK);
+ gd = new GridData(SWT.FILL, SWT.FILL, true, false);
+ gd.horizontalSpan=3;
+ deleteOnExit.setLayoutData(gd);
deleteOnExit.setText("Delete archive after installing");
delete = dialogSettings.get(DELETE_ON_EXIT);
Modified:
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/runtimes/DownloadRuntime.java
===================================================================
---
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/runtimes/DownloadRuntime.java 2012-02-17
20:24:33 UTC (rev 38893)
+++
trunk/examples/plugins/org.jboss.tools.project.examples/src/org/jboss/tools/project/examples/runtimes/DownloadRuntime.java 2012-02-17
21:27:41 UTC (rev 38894)
@@ -20,6 +20,7 @@
private String id;
private String version;
private String url;
+ private boolean disclaimer = true;
public DownloadRuntime(String id, String name, String version, String url) {
super();
@@ -85,4 +86,12 @@
+ version + ", url=" + url + "]";
}
+ public boolean isDisclaimer() {
+ return disclaimer;
+ }
+
+ public void setDisclaimer(boolean disclaimer) {
+ this.disclaimer = disclaimer;
+ }
+
}