1 package net.mograsim.preferences;
3 import java.util.Objects;
5 import org.eclipse.swt.graphics.Color;
7 public abstract class Preferences
9 private static Preferences currentPreferences;
11 public static void setPreferences(Preferences preferences)
13 currentPreferences = Objects.requireNonNull(preferences);
16 public static Preferences current()
18 if (currentPreferences == null)
19 currentPreferences = new DefaultPreferences();
20 return currentPreferences;
23 public abstract boolean getBoolean(String name);
25 public abstract int getInt(String name);
27 public abstract double getDouble(String name);
29 public abstract ColorDefinition getColorDefinition(String name);
31 public Color getColor(String name)
33 return ColorManager.current().toColor(getColorDefinition(name));