Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonald.g.dunne2014-01-09 21:30:34 +0000
committerdonald.g.dunne2014-01-09 21:30:58 +0000
commit3d2cf72bdca98363bc0fa8884e4b01e86835f08e (patch)
treee6957daa4a06fc4bd44868378dda60dc4750f3a1 /plugins
parentb18f83a0f5d96efb79c6042f40345aed11ef1821 (diff)
downloadorg.eclipse.osee-3d2cf72bdca98363bc0fa8884e4b01e86835f08e.tar.gz
org.eclipse.osee-3d2cf72bdca98363bc0fa8884e4b01e86835f08e.tar.xz
org.eclipse.osee-3d2cf72bdca98363bc0fa8884e4b01e86835f08e.zip
bug[ats_ATS9613]: Remove illegal subclass of Label in HyperLinkLabel
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/HyperLinkLabel.java32
1 files changed, 21 insertions, 11 deletions
diff --git a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/HyperLinkLabel.java b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/HyperLinkLabel.java
index e5101d6552..f1371c1fb0 100644
--- a/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/HyperLinkLabel.java
+++ b/plugins/org.eclipse.osee.framework.ui.swt/src/org/eclipse/osee/framework/ui/swt/HyperLinkLabel.java
@@ -16,6 +16,7 @@ import org.eclipse.swt.events.MouseTrackAdapter;
import org.eclipse.swt.events.MouseTrackListener;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
import org.eclipse.ui.forms.widgets.FormToolkit;
/**
@@ -26,9 +27,10 @@ import org.eclipse.ui.forms.widgets.FormToolkit;
* @author Donald G. Dunne
*/
-public class HyperLinkLabel extends Label {
+public class HyperLinkLabel {
private boolean hyperEnabled = true;
+ private Label label = null;
/**
* Amount of the margin width around the hyperlink (default is 1).
*/
@@ -48,12 +50,12 @@ public class HyperLinkLabel extends Label {
}
public HyperLinkLabel(FormToolkit toolkit, Composite parent, int style, String text) {
- super(parent, style);
+ label = new Label(parent, style);
if (text != null) {
- setText(text);
+ label.setText(text);
}
if (toolkit != null) {
- toolkit.adapt(this, true, true);
+ toolkit.adapt(label, true, true);
}
refresh();
}
@@ -79,24 +81,24 @@ public class HyperLinkLabel extends Label {
@Override
public void mouseEnter(MouseEvent e) {
- setCursor(CursorManager.getCursor(SWT.CURSOR_HAND));
+ label.setCursor(CursorManager.getCursor(SWT.CURSOR_HAND));
}
@Override
public void mouseExit(MouseEvent e) {
- setCursor(null);
+ label.setCursor(null);
};
};
public void refresh() {
if (hyperEnabled) {
- setForeground(Displays.getSystemColor(SWT.COLOR_BLUE));
- removeMouseTrackListener(listener);
- addMouseTrackListener(listener);
+ label.setForeground(Displays.getSystemColor(SWT.COLOR_BLUE));
+ label.removeMouseTrackListener(listener);
+ label.addMouseTrackListener(listener);
} else {
- setForeground(Displays.getSystemColor(SWT.COLOR_BLACK));
- removeMouseTrackListener(listener);
+ label.setForeground(Displays.getSystemColor(SWT.COLOR_BLACK));
+ label.removeMouseTrackListener(listener);
}
}
@@ -109,4 +111,12 @@ public class HyperLinkLabel extends Label {
refresh();
}
+ public void setText(String text) {
+ label.setText(text);
+ }
+
+ public void addListener(int mouseup, Listener listener) {
+ label.addListener(mouseup, listener);
+ }
+
}

Back to the top