aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDirk Fauth2013-07-25 06:46:01 (EDT)
committerDirk Fauth2013-07-25 06:46:01 (EDT)
commit085887e6241ed580e4d67ea103e6200113ca783f (patch)
tree1fb9ba60042b149d1130cbb359d427f77f381266
parent4472745729447e901ff80b65b5dcc732ef1e2596 (diff)
downloadorg.eclipse.nebula-085887e6241ed580e4d67ea103e6200113ca783f.zip
org.eclipse.nebula-085887e6241ed580e4d67ea103e6200113ca783f.tar.gz
org.eclipse.nebula-085887e6241ed580e4d67ea103e6200113ca783f.tar.bz2
Bug 413718 - Adding the possibility to configure if the text of an event
should be drawed or not. It is possible to configure this globally via ISettings.drawEventString() or for every GanttEvent itself by setting the property _showText
-rw-r--r--widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/AbstractSettings.java4
-rw-r--r--widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java2
-rw-r--r--widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttEvent.java16
-rw-r--r--widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/ISettings.java2
4 files changed, 23 insertions, 1 deletions
diff --git a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/AbstractSettings.java b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/AbstractSettings.java
index 235446e..97a37ea 100644
--- a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/AbstractSettings.java
+++ b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/AbstractSettings.java
@@ -526,4 +526,8 @@ public abstract class AbstractSettings implements ISettings {
public boolean shiftHorizontalCenteredEventString() {
return false;
}
+
+ public boolean drawEventString() {
+ return true;
+ }
}
diff --git a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java
index b430738..ba2db54 100644
--- a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java
+++ b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttComposite.java
@@ -3375,7 +3375,7 @@ public final class GanttComposite extends Canvas implements MouseListener, Mouse
}
// draw the text if any, o
- if (ge.getParsedString() != null) {
+ if (_settings.drawEventString() && ge.getParsedString() != null && ge.isShowText()) {
_paintManager.drawEventString(this, _settings, _colorManager, ge, gc, ge.getParsedString(), _threeDee, xStart, yDrawPos, xEventWidth, bounds);
}
diff --git a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttEvent.java b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttEvent.java
index 7b0d94e..b816dca 100644
--- a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttEvent.java
+++ b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/GanttEvent.java
@@ -120,6 +120,8 @@ public class GanttEvent extends AbstractGanttEvent implements IGanttChartItem, C
private int _horizontalTextLocation = SWT.RIGHT;
private int _verticalTextLocation = SWT.CENTER;
+ private boolean _showText = true;
+
private Font _textFont;
private int _daysBetweenStartAndEnd;
@@ -2058,4 +2060,18 @@ public class GanttEvent extends AbstractGanttEvent implements IGanttChartItem, C
return clone;
}
+ /**
+ * @return the _showText
+ */
+ public boolean isShowText() {
+ return _showText;
+ }
+
+ /**
+ * @param _showText the _showText to set
+ */
+ public void setShowText(boolean _showText) {
+ this._showText = _showText;
+ }
+
}
diff --git a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/ISettings.java b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/ISettings.java
index 601a315..041a5ba 100644
--- a/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/ISettings.java
+++ b/widgets/ganttchart/org.eclipse.nebula.widgets.ganttchart/src/org/eclipse/nebula/widgets/ganttchart/ISettings.java
@@ -1106,4 +1106,6 @@ public interface ISettings {
* @return <code>true</code> if the event String should be shifted, <code>false</code> if not
*/
public boolean shiftHorizontalCenteredEventString();
+
+ public boolean drawEventString();
}