| CODENOTIFIER | HelpYou are not signed inSign in |
Project: UFace
Revision: 2265
Author: kenneth.westelinck
Date: 17 Aug 2008 06:07:42
Changes:Diff:| ... | ...@@ -10,21 +10,67 @@ | |
| 10 | 10 | *******************************************************************************/ |
| 11 | 11 | package org.ufacekit.ui; |
| 12 | 12 | |
| 13 | /** | |
| 14 | * A decorator is used to put decorations on a control. E.g. an exclamation mark | |
| 15 | * to indicate the input is invalid. | |
| 16 | * | |
| 17 | * @since 1.0 | |
| 18 | */ | |
| 13 | 19 | public interface UIDecorator { |
| 20 | /** | |
| 21 | * Make the decoration visible on the control. | |
| 22 | * | |
| 23 | * @since 1.0 | |
| 24 | */ | |
| 14 | 25 | void show(); |
| 15 | 26 | |
| 27 | /** | |
| 28 | * Make the decoration visible on the control. | |
| 29 | * | |
| 30 | * @param o | |
| 31 | * Object that can hold some extra info on why the decoration is | |
| 32 | * shown. E.g. validation errors. | |
| 33 | * @since 1.0 | |
| 34 | */ | |
| 16 | 35 | void show(Object o); |
| 17 | 36 | |
| 37 | /** | |
| 38 | * Make the decoration invisible. | |
| 39 | * | |
| 40 | * @since 1.0 | |
| 41 | */ | |
| 18 | 42 | void hide(); |
| 19 | 43 | |
| 44 | /** | |
| 45 | * Tells the decoration where it should appear. | |
| 46 | * | |
| 47 | * @since 1.0 | |
| 48 | */ | |
| 20 | 49 | public class DecoratorInfo { |
| 50 | /** Make the decoration appear in the top right corner of the control. */ | |
| 21 | 51 | public static final int TOP_RIGHT = 0; |
| 52 | /** Make the decoration appear in the top left corner of the control. */ | |
| 22 | 53 | public static final int TOP_LEFT = 1; |
| 54 | /** | |
| 55 | * Make the decoration appear in the bottom right corner of the control. | |
| 56 | */ | |
| 23 | 57 | public static final int BOTTOM_RIGHT = 2; |
| 58 | /** Make the decoration appear in the bottom left corner of the control. */ | |
| 24 | 59 | public static final int BOTTOM_LEFT = 3; |
| 25 | 60 | |
| 26 | 61 | private int position; |
| 27 | 62 | |
| 63 | /** | |
| 64 | * Construct a decorator info object for the given position. | |
| 65 | * | |
| 66 | * @see #TOP_RIGHT | |
| 67 | * @see #TOP_LEFT | |
| 68 | * @see #BOTTOM_RIGHT | |
| 69 | * @see #BOTTOM_LEFT | |
| 70 | * | |
| 71 | * @param position | |
| 72 | * @since 1.0 | |
| 73 | */ | |
| 28 | 74 | public DecoratorInfo(int position) { |
| 29 | 75 | this.position = position; |
| 30 | 76 | } |