瀏覽代碼

Tidy up DisplayProperty a bit.

pull/519/head
Chris Smith 9 年之前
父節點
當前提交
5ed767ba72
共有 1 個檔案被更改,包括 7 行新增4 行删除
  1. 7
    4
      src/com/dmdirc/events/DisplayProperty.java

+ 7
- 4
src/com/dmdirc/events/DisplayProperty.java 查看文件

@@ -27,13 +27,16 @@ import com.dmdirc.util.colours.Colour;
27 27
 /**
28 28
  * Describes a property that may be set on a {@link DisplayableEvent} to affect its display.
29 29
  */
30
-public final class DisplayProperty<T> {
30
+@SuppressWarnings("UnusedDeclaration") // Generic type used for compile-time validation only
31
+public interface DisplayProperty<T> {
31 32
 
32 33
     /** The foreground colour of text relating to the event. */
33
-    public static final DisplayProperty<Colour> FOREGROUND_COLOUR = new DisplayProperty<>();
34
+    DisplayProperty<Colour> FOREGROUND_COLOUR = new DisplayPropertyImpl<>();
34 35
     /** The background colour of text relating to the event. */
35
-    public static final DisplayProperty<Colour> BACKGROUND_COLOUR = new DisplayProperty<>();
36
+    DisplayProperty<Colour> BACKGROUND_COLOUR = new DisplayPropertyImpl<>();
36 37
     /** Whether to suppress display of the event. */
37
-    public static final DisplayProperty<Void> DO_NOT_DISPLAY = new DisplayProperty<>();
38
+    DisplayProperty<Void> DO_NOT_DISPLAY = new DisplayPropertyImpl<>();
39
+
40
+    final class DisplayPropertyImpl<T> implements DisplayProperty<T> {}
38 41
 
39 42
 }

Loading…
取消
儲存