01: /*
02: * GWT-Ext Widget Library
03: * Copyright(c) 2007-2008, GWT-Ext.
04: * licensing@gwt-ext.com
05: *
06: * http://www.gwt-ext.com/license
07: */
08: package com.gwtext.client.core;
09:
10: /**
11: * Position constants.
12: */
13: public class RegionPosition {
14:
15: public static RegionPosition NORTH = new RegionPosition("north");
16: public static RegionPosition SOUTH = new RegionPosition("south");
17: public static RegionPosition EAST = new RegionPosition("east");
18: public static RegionPosition WEST = new RegionPosition("west");
19: public static RegionPosition CENTER = new RegionPosition("center");
20:
21: private String position;
22:
23: private RegionPosition(String position) {
24: this .position = position;
25: }
26:
27: public String getPosition() {
28: return position;
29: }
30:
31: public static RegionPosition getPosition(String position) {
32: if (position.equalsIgnoreCase(NORTH.getPosition())) {
33: return NORTH;
34: } else if (position.equalsIgnoreCase(SOUTH.getPosition())) {
35: return SOUTH;
36: } else if (position.equalsIgnoreCase(EAST.getPosition())) {
37: return EAST;
38: } else if (position.equalsIgnoreCase(WEST.getPosition())) {
39: return WEST;
40: } else if (position.equalsIgnoreCase(CENTER.getPosition())) {
41: return CENTER;
42: } else {
43: return null;
44: }
45: }
46: }
|