diff options
| author | selvam <selvam@selvam-Studio-XPS-1340.(none)> | 2011-05-26 18:46:55 +0530 |
|---|---|---|
| committer | selvam <selvam@selvam-Studio-XPS-1340.(none)> | 2011-05-26 18:46:55 +0530 |
| commit | 1877432b9bb416e74a7783da86be544c2c98bada (patch) | |
| tree | e317d27dfb9f1a0761a7ed4f0a0c15f88d243fef /src | |
| parent | 4cfe9767fd0ccff8d5880cab7d689e1416041469 (diff) | |
| parent | cec3ee3bba0a26e72c77ab02be1ddd86bdfb6f29 (diff) | |
Merge branch 'feedback'
Conflicts:
src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/BrickTableLabelProvider.java
Diffstat (limited to 'src')
3 files changed, 44 insertions, 9 deletions
diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/BrickTableLabelProvider.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/BrickTableLabelProvider.java index 64defb60..d8ace927 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/BrickTableLabelProvider.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/BrickTableLabelProvider.java @@ -50,6 +50,10 @@ public class BrickTableLabelProvider extends TableLabelProviderAdapter { return guiHelper.getImage(IImageKeys.STATUS_ONLINE); case IO_ERROR: return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); + case UNINITIALIZED: + return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); + case INITIALIZING: + return guiHelper.getImage(IImageKeys.STATUS_OFFLINE); default: throw new GlusterRuntimeException("Invalid brick status [" + status + "]"); } diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java index 89c5a78e..90b5d587 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/utils/GUIHelper.java @@ -134,7 +134,7 @@ public class GUIHelper { layout.verticalSpacing = 15; layout.marginBottom = 20; layout.marginTop = 5; - + client.setLayout(layout); section.setClient(client); diff --git a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java index c1597bae..6871c683 100644 --- a/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java +++ b/src/com.gluster.storage.management.gui/src/com/gluster/storage/management/gui/views/VolumeSummaryView.java @@ -1,5 +1,7 @@ package com.gluster.storage.management.gui.views; +import java.net.MalformedURLException; +import java.net.URL; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; @@ -20,8 +22,11 @@ import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; import org.eclipse.ui.forms.events.HyperlinkAdapter; import org.eclipse.ui.forms.events.HyperlinkEvent; +import org.eclipse.ui.forms.widgets.FormText; import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.Hyperlink; import org.eclipse.ui.forms.widgets.ScrolledForm; @@ -136,10 +141,10 @@ public class VolumeSummaryView extends ViewPart { lblAlert.redraw(); } - private Label setLabelStyle(Label label, String fontName, int size, int style) { + private FormText setFormTextStyle(FormText formText, String fontName, int size, int style ) { Font font = new Font(Display.getCurrent(), new FontData(fontName, size, style)); - label.setFont(font); - return label; + formText.setFont(font); + return formText; } private void createVolumeMountingInfoSection() { @@ -151,17 +156,43 @@ public class VolumeSummaryView extends ViewPart { String nfsMountInfo = "mount -t nfs " + firstOnlineServer + ":/" + volume.getName() + " <mount-point>"; String info = "Server can be any server name in the storage cloud eg. <" + onlineServers + ">"; //TODO: if more than 10 servers... - Composite section = guiHelper.createSection(form, toolkit, "Mounting Information", null, 2, false); - + Composite section = guiHelper.createSection(form, toolkit, "Mounting Information", null, 3, false); + toolkit.createLabel(section, glusterFs, SWT.NORMAL); - setLabelStyle(toolkit.createLabel(section, glusterFsMountInfo, SWT.NONE), COURIER_FONT, 10, SWT.NONE); + FormText glusterfsMountText = setFormTextStyle(toolkit.createFormText(section, true), COURIER_FONT, 10, SWT.NONE); + glusterfsMountText.setText(glusterFsMountInfo, false, false); + glusterfsMountText.setLayoutData(new GridData(GridData.BEGINNING, GridData.VERTICAL_ALIGN_CENTER, false, false, 2, 0)); // Label spanned two column // TODO: Check required if nfs is optional toolkit.createLabel(section, nfs, SWT.NORMAL); - setLabelStyle(toolkit.createLabel(section, nfsMountInfo, SWT.NONE), COURIER_FONT, 10, SWT.NONE); + FormText glusterNfsMountText = setFormTextStyle(toolkit.createFormText(section, true), COURIER_FONT, 10, SWT.NONE); + glusterNfsMountText.setText(nfsMountInfo, false, false); + glusterNfsMountText.setLayoutData(new GridData(GridData.BEGINNING, GridData.VERTICAL_ALIGN_CENTER, false, false, 2, 0)); + + toolkit.createLabel(section, ""); + Label infoLabel = toolkit.createLabel(section, info, SWT.NONE); + infoLabel.setLayoutData(new GridData(GridData.BEGINNING, GridData.VERTICAL_ALIGN_CENTER, false, false, 2, 0)); + + //TODO: implement a logic to identify the corresponding glusterfs client download link + String message = "You can download gluster FS client from"; + String glusterClientDownloadlinkText = "here."; + final String glusterClientDownloadlink = "http://www.gluster.com"; toolkit.createLabel(section, ""); - toolkit.createLabel(section, info, SWT.NONE); + toolkit.createLabel(section, message ); + Hyperlink link = toolkit.createHyperlink(section, glusterClientDownloadlinkText, SWT.NORMAL); + link.addHyperlinkListener(new HyperlinkAdapter() { + public void linkActivated(HyperlinkEvent e) { + try { + System.out.println(e.getLabel() + " [" + e.getHref() + "]"); + PlatformUI.getWorkbench().getBrowserSupport().getExternalBrowser().openURL(new URL( glusterClientDownloadlink )); + } catch (PartInitException e1) { + e1.printStackTrace(); + } catch (MalformedURLException e1) { + e1.printStackTrace(); + } + } + }); } private String getOnlineServers(int maxServers) { |
