Re-structure LTTng sub-project as per the Linux Tools guidelines
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.ui / src / org / eclipse / linuxtools / tmf / ui / views / colors / ColorSetting.java
index bd6d772e1d767153502d8135f4b63affdb23a023..f2e67aeed0972567bec8a60504c09e4ff8ad72b0 100644 (file)
 \r
 package org.eclipse.linuxtools.tmf.ui.views.colors;\r
 \r
-import org.eclipse.linuxtools.tmf.filter.model.ITmfFilterTreeNode;\r
+import org.eclipse.linuxtools.tmf.core.filter.model.ITmfFilterTreeNode;\r
 import org.eclipse.swt.SWT;\r
 import org.eclipse.swt.graphics.Color;\r
 import org.eclipse.swt.graphics.RGB;\r
 import org.eclipse.swt.widgets.Display;\r
 import org.eclipse.ui.themes.ColorUtil;\r
 \r
+/**\r
+ * Application code must explicitly invoke the ColorSetting.dispose() method to release the operating system\r
+ * resources managed by each instance when those instances are no longer required. \r
+ */\r
+\r
 public class ColorSetting {\r
 \r
        private RGB fForegroundRGB;\r
@@ -30,6 +35,9 @@ public class ColorSetting {
        private int fTickColorIndex;\r
        private ITmfFilterTreeNode fFilter;\r
        \r
+       /**\r
+        * You must dispose the color setting when it is no longer required.\r
+        */\r
        public ColorSetting(RGB foreground, RGB background, int tickColorIndex, ITmfFilterTreeNode filter) {\r
                fForegroundRGB = foreground;\r
                fBackgroundRGB = background;\r
@@ -44,6 +52,16 @@ public class ColorSetting {
                                fBackgroundRGB, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB()));\r
        }\r
        \r
+       /**\r
+        * Dispose the color setting resources\r
+        */\r
+       public void dispose() {\r
+               fForegroundColor.dispose();\r
+               fBackgroundColor.dispose();\r
+               fDimmedForegroundColor.dispose();\r
+               fDimmedBackgroundColor.dispose();\r
+       }\r
+       \r
        /**\r
         * @return the foreground\r
         */\r
This page took 0.02639 seconds and 5 git commands to generate.