package hibergui;

import static org.eclipse.swt.SWT.*;

import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.widgets.Display;

/**
 * Utility class for defining constants used in HiberGUI components.
 * 
 * @author Miklós Espák
 *
 */
public class HiberGUI {

    public static final int 
    NONE = 0, 

    // Edit styles:
    
    NO_LABEL = 1<<1,
//    FIXED = 1<<2,
    NOT_NULL = 1<<3,
    MULTI = 1<<4,       // multiline TextEdits
    READ_ONLY = 1<<5,
    
    // Form styles:
    
    NO_MODIFY = 1<<1, 
    NO_FIELDS = 1<<2,
    NO_BUTTONS = 1<<3,
    NO_SELECTOR = 1<<4,
//    SEARCH_MODE = 1<<5,
    AUTO_COMMIT = 1<<6,
    SINGLE_SELECTION = 1<<7,
    MULTIPLE_SELECTION = 1<<8,
    NO_SELECTION = 1<<9;
    
    public static final Color
    COLOR_DEFAULT_BACKGROUND,
    COLOR_READ_ONLY,
    COLOR_FIXED,
    COLOR_DIRTY, 
    COLOR_INVALID, 
    COLOR_UNAMBIGUOUS, 
    COLOR_EXACT, 
    COLOR_SEARCH;
    
    static {
    	Display d = Display.getCurrent();
    	COLOR_DEFAULT_BACKGROUND = d.getSystemColor(COLOR_WIDGET_BACKGROUND);
    	COLOR_READ_ONLY = d.getSystemColor(COLOR_WIDGET_DARK_SHADOW);
    	COLOR_FIXED = d.getSystemColor(COLOR_BLUE);
    	COLOR_DIRTY = d.getSystemColor(COLOR_INFO_BACKGROUND);
    	COLOR_INVALID = d.getSystemColor(COLOR_RED);
    	COLOR_UNAMBIGUOUS = d.getSystemColor(COLOR_YELLOW);
    	COLOR_EXACT = d.getSystemColor(COLOR_GREEN);
    	COLOR_SEARCH = d.getSystemColor(COLOR_YELLOW);
    }
    
}
