From 964da928d8762d460caacd3a3f34edc15c32a68b Mon Sep 17 00:00:00 2001 From: "minkee.lee" Date: Tue, 15 Dec 2015 20:21:08 +0900 Subject: [PATCH] dialog: add essential mark ("*") for user input - Show mark ("*") when mandatory option is empty or not selected. - In New base image dialog, apply highlight box to image file text box. Change-Id: I9c49ec8db0d959c223e31f32befa585a66383d62 Signed-off-by: minkee.lee --- resource/renewal/res/9p_text_input_box_lead_b.png | Bin 0 -> 2800 bytes resource/renewal/res/9p_text_input_box_lead_l.png | Bin 0 -> 2798 bytes resource/renewal/res/9p_text_input_box_lead_lb.png | Bin 0 -> 2816 bytes resource/renewal/res/9p_text_input_box_lead_lt.png | Bin 0 -> 2816 bytes resource/renewal/res/9p_text_input_box_lead_r.png | Bin 0 -> 2798 bytes resource/renewal/res/9p_text_input_box_lead_rb.png | Bin 0 -> 2822 bytes resource/renewal/res/9p_text_input_box_lead_rt.png | Bin 0 -> 2822 bytes resource/renewal/res/9p_text_input_box_lead_t.png | Bin 0 -> 2800 bytes .../manager/renewal/resources/ColorResources.java | 2 + .../manager/renewal/resources/ImageResources.java | 10 ++ .../manager/ui/renewal/item/ItemState.java | 44 +++++++++ .../item/modify/baseimage/BaseImageFileItem.java | 23 ++++- .../item/modify/baseimage/BaseImageNameItem.java | 10 +- .../ui/renewal/item/modify/common/ComboItem.java | 10 +- .../renewal/item/modify/common/FileDialogItem.java | 12 ++- .../item/modify/common/ModifyDialogItem.java | 65 +++++++++---- .../ui/renewal/item/modify/common/NameItem.java | 10 +- .../item/modify/common/TextInputBoxItem.java | 26 ++++- .../ui/renewal/item/modify/comp/IconItemTitle.java | 16 +++- .../ui/renewal/item/modify/comp/ItemTitle.java | 106 +++++++++++++++++++-- .../ui/renewal/item/modify/comp/SubItemTitle.java | 44 +++++++-- .../ui/renewal/item/modify/comp/TreeItemTitle.java | 10 +- .../ui/renewal/item/modify/vm/CameraImageItem.java | 5 +- .../renewal/item/modify/vm/DeviceTemplateItem.java | 5 +- .../ui/renewal/item/modify/vm/NetDnsItem.java | 14 ++- .../ui/renewal/item/modify/vm/NetIPSubItem.java | 34 ++++++- .../ui/renewal/item/modify/vm/NetProxyItem.java | 4 +- .../item/modify/vm/NetTapDeviceItemForWin.java | 4 +- .../ui/renewal/item/modify/vm/TunerTableItem.java | 4 +- .../manager/ui/renewal/widgets/NinePatchBox.java | 13 +-- .../manager/ui/renewal/widgets/TextBox.java | 11 +++ .../manager/ui/renewal/widgets/TextInputBox.java | 11 +++ .../manager/ui/renewal/widgets/WSTATE.java | 3 +- .../manager/ui/renewal/widgets/WidgetHelper.java | 11 +++ 34 files changed, 432 insertions(+), 75 deletions(-) create mode 100644 resource/renewal/res/9p_text_input_box_lead_b.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_l.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_lb.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_lt.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_r.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_rb.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_rt.png create mode 100644 resource/renewal/res/9p_text_input_box_lead_t.png create mode 100644 src/org/tizen/emulator/manager/ui/renewal/item/ItemState.java diff --git a/resource/renewal/res/9p_text_input_box_lead_b.png b/resource/renewal/res/9p_text_input_box_lead_b.png new file mode 100644 index 0000000000000000000000000000000000000000..17c595ffcde6d41e4adec669bdc2dca2469ba1f6 GIT binary patch literal 2800 zcmV*(P)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJx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peI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000PNklH%m4rY07*qoM6N<$g87*; ADgXcg literal 0 HcmV?d00001 diff --git a/resource/renewal/res/9p_text_input_box_lead_lb.png b/resource/renewal/res/9p_text_input_box_lead_lb.png new file mode 100644 index 0000000000000000000000000000000000000000..9b025e488f1fa10011f5c3556c543a9a33ae47bd GI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{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0000RNkl + * JiHye Kim + * SeokYeon Hwang + * Sangho Park + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * Contributors: + * - S-Core Co., Ltd + * + */ + +package org.tizen.emulator.manager.ui.renewal.item; + +public enum ItemState { + NORMAL(0), + WARNING(1), + ERROR(2), + EMPTY(3); + + int code; + + private ItemState(int code) { + this.code = code; + } +} diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageFileItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageFileItem.java index b095701..587be84 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageFileItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageFileItem.java @@ -45,8 +45,10 @@ import org.tizen.emulator.manager.resources.FilePathResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.ui.renewal.MainDialog; import org.tizen.emulator.manager.ui.renewal.dialog.MessageBox; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.FileDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; +import org.tizen.emulator.manager.ui.renewal.widgets.WSTATE; import org.tizen.emulator.manager.vms.VMProperty.Architecture; import org.tizen.emulator.manager.vms.helper.HelperClass; import org.tizen.emulator.manager.vms.helper.QemuImgProc; @@ -190,23 +192,38 @@ public class BaseImageFileItem extends FileDialogItem { public boolean isValid() { boolean isValid = true; String msg = ""; + ItemState itemState = ItemState.NORMAL; if (filePath == null || filePath.isEmpty()) { msg = "select base image path"; isValid = false; + itemState = ItemState.EMPTY; } - changeItemState(!isValid, TEXT_BOX_WIDTH + 37 /* TODO: dialog button width*/, msg); + changeItemState(itemState, TEXT_BOX_WIDTH + 37 /* TODO: dialog button width*/, msg); return isValid; } + @Override - public void changeWidgetState(boolean isError) { + public void changeWidgetState() { if (textBox == null) { return; } if (getItemListComp().isCreateMode()) { - textBox.setError(isError); + if (isNormalState()) { + textBox.setWidgetState(WSTATE.NORMAL); + item.getItemTitle().redrawMark(false); + + } else if (isErrorState()) { + textBox.setWidgetState(WSTATE.ERROR); + item.getItemTitle().redrawMark(false); + + } else if (isEmptyState()) { + textBox.setWidgetState(WSTATE.LEAD); + item.getItemTitle().redrawMark(true); + } } } + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java index d26c5e3..840f41c 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/baseimage/BaseImageNameItem.java @@ -36,6 +36,7 @@ import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.platform.BaseImage; import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.resources.StringResources; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.NameItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.TextInputBoxItem; @@ -124,12 +125,19 @@ public class BaseImageNameItem extends TextInputBoxItem { // create(clone), modify mode msg = checkBaseImageName(value); + ItemState itemState = ItemState.NORMAL; if (!msg.isEmpty()) { isValid = false; + if (value.isEmpty()) { + itemState = ItemState.EMPTY; + + } else { + itemState = ItemState.ERROR; + } } // changeItemState() -> changeWidgetState() - changeItemState(!isValid, INPUT_BOX_WIDTH, msg); + changeItemState(itemState, INPUT_BOX_WIDTH, msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java index bead0d7..1199d20 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ComboItem.java @@ -38,6 +38,7 @@ import org.eclipse.swt.widgets.Listener; import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem; import org.tizen.emulator.manager.ui.renewal.widgets.ComboBox; +import org.tizen.emulator.manager.ui.renewal.widgets.WSTATE; public abstract class ComboItem extends ModifyDialogItem { @@ -97,8 +98,13 @@ public abstract class ComboItem extends ModifyDialogItem { @Override - public void changeWidgetState(boolean isError) { - comboBox.setError(isError); + public void changeWidgetState() { + if (isNormalState()) { + comboBox.setWidgetState(WSTATE.NORMAL); + + } else if (isErrorState()) { + comboBox.setWidgetState(WSTATE.ERROR); + } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java index 070626a..0e75ece 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/FileDialogItem.java @@ -47,6 +47,7 @@ import org.tizen.emulator.manager.ui.renewal.item.modify.comp.IconItemTitle; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem; import org.tizen.emulator.manager.ui.renewal.widgets.BlueButton; import org.tizen.emulator.manager.ui.renewal.widgets.TextBox; +import org.tizen.emulator.manager.ui.renewal.widgets.WSTATE; import org.tizen.emulator.manager.ui.renewal.widgets.WidgetHelper; public abstract class FileDialogItem extends ModifyDialogItem { @@ -204,12 +205,19 @@ public abstract class FileDialogItem extends ModifyDialogItem { } @Override - public void changeWidgetState(boolean isError) { + public void changeWidgetState() { if (!getItemListComp().isDetailMode()) { - textBox.setError(isError); + if (isNormalState()) { + textBox.setWidgetState(WSTATE.NORMAL); + + } else if (isErrorState()) { + textBox.setWidgetState(WSTATE.ERROR); + } } } + + @Override public boolean isItemDisabled() { if (textBox.isDisabled()) { diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java index 0e2471a..9142fee 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/ModifyDialogItem.java @@ -41,6 +41,7 @@ import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Canvas; import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.ui.renewal.dialog.ItemListComp; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.IconItemTitle; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ItemTitle; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem; @@ -63,6 +64,7 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { protected PropertyValue propertyValue; protected Canvas stateIconCanvas; + private ItemState itemState; public static final int ERROR_ICON_SIZE = 16; public static final int ERROR_ICON_SPACING = 6; @@ -243,28 +245,38 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { return ModifyItem.ITEM_HEIGHT; } - public void changeWidgetState(boolean isError) { + public void changeWidgetState() { // Override this. // In this function, you change widget in item to error state. // For example, change border color red of combobox, input text box. } /** This change item's state : error or normal */ - public void changeItemState(boolean isError, int contentRight, String msg) { - changeWidgetState(isError); - changeStateIcon(isError, ModifyItem.BODY_MARGIN_LEFT + contentRight, msg); + public void changeItemState(ItemState itemState, int contentRight, String msg) { + this.itemState = itemState; + changeWidgetState(); + changeStateIcon(ModifyItem.BODY_MARGIN_LEFT + contentRight, msg); } public void removeStateIcon() { - changeStateIcon(false, 0, ""); + itemState = ItemState.NORMAL; + changeStateIcon(0, ""); } - public void changeStateIcon(boolean isError, int contentRight, String msg) { + public void changeStateIcon(int contentRight, String msg) { if (item == null) { return; } - if (isError) { + if (isNormalState() || isEmptyState()) { + if (stateIconCanvas == null || stateIconCanvas.isDisposed()) { + return; + } + // hide error icon + FormData data = new FormData(0, 0); + stateIconCanvas.setLayoutData(data); + + } else { // show error icon if (stateIconCanvas == null || stateIconCanvas.isDisposed()) { stateIconCanvas = new Canvas(item.getBody(), SWT.NONE); @@ -278,17 +290,8 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { stateIconCanvas.setLayoutData(data); stateIconCanvas.setToolTipText(msg); stateIconCanvas.moveAbove(null); - - } else { - if (stateIconCanvas == null || stateIconCanvas.isDisposed()) { - return; - } - // hide error icon - FormData data = new FormData(0, 0); - stateIconCanvas.setLayoutData(data); } stateIconCanvas.redraw(); - item.getBody().layout(true,true); } @@ -346,4 +349,34 @@ public abstract class ModifyDialogItem implements IModifyDialogItem { public boolean isDetailMode() { return itemListComp.isDetailMode(); } + + public boolean isNormalState() { + return itemState == ItemState.NORMAL; + } + + public ItemState getItemState() { + return itemState; + } + + public boolean isWarningState() { + return itemState == ItemState.WARNING; + } + + public boolean isErrorState() { + return itemState == ItemState.ERROR; + } + + public boolean isEmptyState() { + return itemState == ItemState.EMPTY; + } + + public void checkEmptyState() { + if (isEmptyState()) { + item.getItemTitle().redrawMark(true); + return; + } + + item.getItemTitle().redrawMark(false); + } } + diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/NameItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/NameItem.java index d22b162..0aa4d4e 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/NameItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/NameItem.java @@ -36,6 +36,7 @@ import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.ui.Messages; import org.tizen.emulator.manager.ui.renewal.dialog.DIALOG_MODE; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.vms.VMProperty; import org.tizen.emulator.manager.vms.helper.HelperClass; @@ -114,11 +115,18 @@ public class NameItem extends TextInputBoxItem { // TODO } + ItemState itemState = ItemState.NORMAL; if (!msg.isEmpty()) { isValid = false; + if (value.isEmpty()) { + itemState = ItemState.EMPTY; + + } else { + itemState = ItemState.ERROR; + } } - changeItemState(!isValid, INPUT_BOX_WIDTH, msg); + changeItemState(itemState, INPUT_BOX_WIDTH, msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/TextInputBoxItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/TextInputBoxItem.java index 34332b6..4d3a7a7 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/TextInputBoxItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/common/TextInputBoxItem.java @@ -43,6 +43,7 @@ import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.IconItemTitle; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.ModifyItem; import org.tizen.emulator.manager.ui.renewal.widgets.TextInputBox; +import org.tizen.emulator.manager.ui.renewal.widgets.WSTATE; import org.tizen.emulator.manager.ui.renewal.widgets.WidgetHelper; public abstract class TextInputBoxItem extends ModifyDialogItem { @@ -51,6 +52,8 @@ public abstract class TextInputBoxItem extends ModifyDialogItem { protected String value = ""; + private int bodyMarginLeft = ModifyItem.BODY_MARGIN_LEFT; + /** This is called when text is modified */ public abstract void textModified(); @@ -78,6 +81,7 @@ public abstract class TextInputBoxItem extends ModifyDialogItem { item.setTitleEnable(enable); textInputBox.setEnabled(enable); removeStateIcon(); + item.getItemTitle().redrawMark(false); } } @@ -122,6 +126,9 @@ public abstract class TextInputBoxItem extends ModifyDialogItem { } } + public void setBodyMarginLeft(int margin) { + bodyMarginLeft = margin; + } private void createDetailItem() { item.setBodyLayoutForm(); @@ -152,7 +159,7 @@ public abstract class TextInputBoxItem extends ModifyDialogItem { protected void createTextBox(int textBoxWidth, boolean needClearButton) { FormData data = new FormData(textBoxWidth, ModifyItem.WIDGET_HEIGHT); data.top = new FormAttachment(0, (item.getHeight() - ModifyItem.WIDGET_HEIGHT) / 2); - data.left = new FormAttachment(0, ModifyItem.BODY_MARGIN_LEFT); + data.left = new FormAttachment(0, bodyMarginLeft); textInputBox = new TextInputBox(item.getBody(), SWT.NONE, needClearButton); textInputBox.setLayoutData(data); @@ -191,9 +198,22 @@ public abstract class TextInputBoxItem extends ModifyDialogItem { } @Override - public void changeWidgetState(boolean isError) { + public void changeWidgetState() { if (!getItemListComp().isDetailMode()) { - textInputBox.setError(isError); + changeInputboxState(); } } + + public void changeInputboxState() { + checkEmptyState(); + + if (isNormalState() || isEmptyState()) { + textInputBox.setWidgetState(WSTATE.NORMAL); + + } else if (isErrorState()) { + textInputBox.setWidgetState(WSTATE.ERROR); + } + // TODO warning state + } + } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/IconItemTitle.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/IconItemTitle.java index 2d2f5a8..ecd8a4f 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/IconItemTitle.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/IconItemTitle.java @@ -34,7 +34,8 @@ import org.eclipse.swt.SWT; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.GC; -import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.renewal.resources.ColorResources; @@ -76,9 +77,13 @@ public class IconItemTitle extends ItemTitle { private void makeIcon() { // init - GridData data = new GridData(ICON_WIDTH, ICON_HEIGHT); - data.verticalAlignment = SWT.CENTER; - data.grabExcessVerticalSpace = true; + + FormData data = new FormData(); + data.left = new FormAttachment(0, marginLeft); + data.width = ICON_WIDTH; + data.top = new FormAttachment(0, 0); + data.bottom = new FormAttachment(100, -1); + iconCanvas = new Canvas(this, SWT.NONE); iconCanvas.setLayoutData(data); @@ -86,7 +91,8 @@ public class IconItemTitle extends ItemTitle { @Override public void paintControl(PaintEvent e) { GC gc = e.gc; - gc.drawImage(iconResource.getImage(), 0, 0); + int itemHeight = ((Canvas)e.widget).getBounds().height - ModifyItem.LINE_WIDTH; + gc.drawImage(iconResource.getImage(), 0, (itemHeight - ICON_HEIGHT) / 2); } }); } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java index bc616d6..bbcc6f6 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/ItemTitle.java @@ -35,12 +35,15 @@ import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.renewal.resources.FontResources; +import org.tizen.emulator.manager.ui.renewal.widgets.WidgetHelper; public class ItemTitle extends Canvas{ @@ -52,12 +55,18 @@ public class ItemTitle extends Canvas{ ColorResources.MODIFY_ITEM_TITLE_BACKGROUND; protected final String title; - private int marginLeft = 0; + protected int marginLeft = 0; private int titleIndent = 0; protected final ColorResources background; boolean isDrawBottomLine = true; + protected Canvas titleCanvas; + protected Canvas markCanvas; // for essential mark ("*") + private boolean drawMark = false; + private static final String ESSENTIAL_MARK = "*"; + private static final int MARK_SPACING = 4; + protected boolean isTitleEnable = true; public ItemTitle(Composite parent, String title, int marginLeft, int titleIndent, ColorResources background) { @@ -72,6 +81,57 @@ public class ItemTitle extends Canvas{ init(); isDrawBottomLine = drawLine; makeTitle(); + makeMark(); + } + + protected void makeMark() { + markCanvas = new Canvas(this, SWT.NONE); + FormData data = new FormData(); + layoutMark(data); + markCanvas.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + int itemHeight = ((Canvas)e.widget).getBounds().height - ModifyItem.LINE_WIDTH; + + // draw text + String text = ""; + if (drawMark) { + text = ESSENTIAL_MARK; + } + gc.setFont(FontResources.MODIFY_ITEM_TITLE.getFont()); + gc.setForeground(ColorResources.ESSENTIAL_MARK.getColor()); + Point textExt = gc.textExtent(text); + int titleY = (itemHeight - textExt.y) / 2 + 1; + gc.drawText(text, 0, titleY); + } + }); + } + + private void layoutMark(FormData data) { + if (drawMark) { + data.left = new FormAttachment(titleCanvas, MARK_SPACING); + data.top = new FormAttachment(0, 0); + data.bottom = new FormAttachment(100, -1); + data.width = WidgetHelper.calcTextWidth(markCanvas, ESSENTIAL_MARK, + FontResources.MODIFY_ITEM_TITLE.getFont()); + + } else { + data.left = new FormAttachment(0,-1); + data.top = new FormAttachment(0,-1); + data.width = 0; + data.height = 0; + } + + markCanvas.setLayoutData(data); + layout(); + } + + public void redrawMark(boolean draw) { + drawMark = draw; + layoutMark((FormData)markCanvas.getLayoutData()); + markCanvas.redraw(); } public boolean isTitleEnable() { @@ -88,6 +148,13 @@ public class ItemTitle extends Canvas{ redraw(); } + @Override + public void redraw() { + super.redraw(); + titleCanvas.redraw(); + markCanvas.redraw(); + } + protected void init() { GridData data = new GridData(); data.grabExcessVerticalSpace = true; @@ -98,17 +165,25 @@ public class ItemTitle extends Canvas{ this.setBackgroundMode(SWT.INHERIT_FORCE); // layout - GridLayout layout = new GridLayout(); - layout.numColumns = 1; - layout.marginWidth = marginLeft; - this.setLayout(layout); + this.setLayout(new FormLayout()); + } private void makeTitle() { - // draw title, under line - this.addPaintListener(new PaintListener() { + titleCanvas = new Canvas(this, SWT.NONE); + + FormData data = new FormData(); + data.left = new FormAttachment(0, titleIndent); + data.top = new FormAttachment(0, 0); + data.bottom = new FormAttachment(100, -1); + data.width = WidgetHelper.calcTextWidth(titleCanvas, title, + FontResources.MODIFY_ITEM_TITLE.getFont()); + titleCanvas.setLayoutData(data); + + // draw title + titleCanvas.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { @@ -125,8 +200,19 @@ public class ItemTitle extends Canvas{ Point textExt = gc.textExtent(title); int titleY = (itemHeight - textExt.y) / 2; - gc.drawText(title, - titleIndent, titleY); + gc.drawText(title, 0, titleY); + + } + + }); + + // draw under line + this.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + int itemHeight = ((Canvas)e.widget).getBounds().height - ModifyItem.LINE_WIDTH; // draw under line if (isDrawBottomLine) { diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/SubItemTitle.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/SubItemTitle.java index 109ab3b..86fec27 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/SubItemTitle.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/SubItemTitle.java @@ -36,11 +36,15 @@ import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.renewal.resources.FontResources; +import org.tizen.emulator.manager.ui.renewal.widgets.WidgetHelper; public class SubItemTitle extends ItemTitle{ @@ -67,6 +71,14 @@ public class SubItemTitle extends ItemTitle{ protected void create(boolean drawBottomLine) { init(); makeTitle(drawBottomLine); + makeEmptyMark(); + } + + + private void makeEmptyMark() { + super.makeMark(); +// markCanvas = new Canvas(this, SWT.NONE); +// markCanvas.setLayoutData(new FormData(0, 0)); } @Override @@ -80,20 +92,28 @@ public class SubItemTitle extends ItemTitle{ this.setBackgroundMode(SWT.INHERIT_FORCE); // layout -// GridLayout layout = new GridLayout(); -// layout.numColumns = 1; -// layout.marginWidth = MARGIN_LEFT; -// this.setLayout(layout); + this.setLayout(new FormLayout()); } private void makeTitle(final boolean drawLine) { - // draw title, under line - this.addPaintListener(new PaintListener() { + titleCanvas = new Canvas(this, SWT.NONE); + + FormData data = new FormData(); + data.left = new FormAttachment(0, MARGIN_LEFT); + data.top = new FormAttachment(0, 0); + data.bottom = new FormAttachment(100, -1); + data.width = WidgetHelper.calcTextWidth(titleCanvas, title, + FontResources.MODIFY_ITEM_TITLE.getFont()); + titleCanvas.setLayoutData(data); + + // draw title + titleCanvas.addPaintListener(new PaintListener() { @Override public void paintControl(PaintEvent e) { + // TODO Auto-generated method stub GC gc = e.gc; int itemHeight = ((Canvas)e.widget).getBounds().height - ModifyItem.LINE_WIDTH; @@ -107,7 +127,17 @@ public class SubItemTitle extends ItemTitle{ gc.setFont(FontResources.MODIFY_ITEM_TITLE.getFont()); Point textExt = gc.textExtent(title); int titleY = (itemHeight - textExt.y) / 2; - gc.drawText(title, MARGIN_LEFT, titleY); + gc.drawText(title, 0, titleY); + } + }); + + // draw under line + this.addPaintListener(new PaintListener() { + + @Override + public void paintControl(PaintEvent e) { + GC gc = e.gc; + int itemHeight = ((Canvas)e.widget).getBounds().height - ModifyItem.LINE_WIDTH; // draw right vertical line if (drawVerticalLine) { diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/TreeItemTitle.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/TreeItemTitle.java index a623fec..dd69c82 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/TreeItemTitle.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/comp/TreeItemTitle.java @@ -36,7 +36,8 @@ import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Rectangle; -import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; import org.eclipse.swt.widgets.Canvas; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Listener; @@ -69,9 +70,10 @@ public class TreeItemTitle extends IconItemTitle { private void makeArrow() { // init - GridData data = new GridData(IconItemTitle.ICON_WIDTH, IconItemTitle.ICON_HEIGHT); - data.verticalAlignment = SWT.CENTER; - data.grabExcessVerticalSpace = true; + FormData data = new FormData(ICON_WIDTH, ICON_HEIGHT); + data.left = new FormAttachment(0, marginLeft); + data.top = new FormAttachment(0, (ModifyItem.ITEM_HEIGHT - ICON_HEIGHT) / 2); + arrowCanvas = new Canvas(this, SWT.NONE); arrowCanvas.setLayoutData(data); diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java index a6b9e2f..5f33876 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/CameraImageItem.java @@ -37,6 +37,7 @@ import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.resources.FilePathResources; import org.tizen.emulator.manager.ui.Messages; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.FileDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; @@ -154,11 +155,13 @@ public class CameraImageItem extends FileDialogItem { } } + ItemState itemState = ItemState.NORMAL; if (!msg.isEmpty()) { isValid = false; + itemState = ItemState.ERROR; } - changeItemState(!isValid, getContentRight(SubModifyItem.BOX_WIDTH), msg); + changeItemState(itemState, getContentRight(SubModifyItem.BOX_WIDTH), msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java index f51a787..d43bc72 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/DeviceTemplateItem.java @@ -36,6 +36,7 @@ import org.tizen.emulator.manager.devices.DeviceTemplate; import org.tizen.emulator.manager.platform.Profile; import org.tizen.emulator.manager.platform.ProfileList; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ComboItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubTreeModifyItem; @@ -179,12 +180,14 @@ public class DeviceTemplateItem extends ComboItem { String msg = ""; boolean isValid = true; + ItemState itemState = ItemState.NORMAL; if (template == null) { isValid = false; msg = "Please select device-template."; + itemState = ItemState.ERROR; } - changeItemState(!isValid, COMBO_WIDTH, msg); + changeItemState(itemState, COMBO_WIDTH, msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetDnsItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetDnsItem.java index 11199cc..0e64e7a 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetDnsItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetDnsItem.java @@ -35,6 +35,7 @@ import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.tool.TapUtil; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.TextInputBoxItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; @@ -92,15 +93,24 @@ public class NetDnsItem extends TextInputBoxItem { @Override public boolean isValid() { - if (getItemListComp().isDetailMode()) { + if (getItemListComp().isDetailMode() || !textInputBox.isEnabled()) { return true; } boolean isValid = true; String msg = TapUtil.checkIPString(textInputBox.isEnabled(), super.value, getTitle()); + + ItemState itemState = ItemState.NORMAL; if (!msg.isEmpty()) { isValid = false; + + if (super.value.isEmpty()) { + itemState = ItemState.EMPTY; + + } else { + itemState = ItemState.ERROR; + } } - changeItemState(!isValid, INPUT_BOX_WIDTH, msg); + changeItemState(itemState, INPUT_BOX_WIDTH, msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetIPSubItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetIPSubItem.java index bcdc7b3..ffcac3a 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetIPSubItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetIPSubItem.java @@ -37,15 +37,17 @@ import org.eclipse.swt.widgets.Composite; import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.tool.TapUtil; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.TextInputBoxItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubModifyItem; +import org.tizen.emulator.manager.ui.renewal.widgets.WSTATE; public class NetIPSubItem extends TextInputBoxItem { private final int BOX_WIDTH = 125; - private final int TITLE_WIDTH = 80; + private final int TITLE_WIDTH = 85; public NetIPSubItem(String name, String title) { super(name, title); @@ -61,6 +63,7 @@ public class NetIPSubItem extends TextInputBoxItem { setDrawBottomLine(false); // for item body item.create(); + setBodyMarginLeft(5); makeBody(BOX_WIDTH, false, true); resetItem(); @@ -138,14 +141,39 @@ public class NetIPSubItem extends TextInputBoxItem { boolean isValid = true; String msg = ""; msg = TapUtil.checkIPString(textInputBox.isEnabled(), super.value, getTitle()); + + ItemState itemState = ItemState.NORMAL; if (!msg.isEmpty()) { isValid = false; - } - changeItemState(!isValid, BOX_WIDTH, msg); + if (super.value.isEmpty()) { + itemState = ItemState.EMPTY; + + } else { + itemState = ItemState.ERROR; + } + } + changeItemState(itemState, BOX_WIDTH, msg); return isValid; } + @Override + public void changeInputboxState() { + if (isEmptyState()) { + textInputBox.setWidgetState(WSTATE.NORMAL); + item.getItemTitle().redrawMark(true); + + } else if (isNormalState()) { + textInputBox.setWidgetState(WSTATE.NORMAL); + item.getItemTitle().redrawMark(false); + + } else if (isErrorState()) { + textInputBox.setWidgetState(WSTATE.ERROR); + item.getItemTitle().redrawMark(false); + } + // TODO warning state + } + public void resetItem() { boolean useDHCP = propertyValue.getCheckBoxValue( ItemName.NET_IP_INFO, ItemName.NET_USE_DHCP); diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetProxyItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetProxyItem.java index acefe29..bba469f 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetProxyItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetProxyItem.java @@ -46,6 +46,7 @@ import org.tizen.emulator.manager.resources.StringResources; import org.tizen.emulator.manager.ui.Messages; import org.tizen.emulator.manager.ui.dialog.ProxyDialog; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ComboItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; @@ -225,7 +226,8 @@ public class NetProxyItem extends ComboItem{ } } - changeItemState(!isValid, SubModifyItem.ERROR_BUTTON_RIGHT, msg); + changeItemState(isValid? ItemState.NORMAL : ItemState.ERROR, + SubModifyItem.ERROR_BUTTON_RIGHT, msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetTapDeviceItemForWin.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetTapDeviceItemForWin.java index ae0b757..88429cf 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetTapDeviceItemForWin.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/NetTapDeviceItemForWin.java @@ -40,6 +40,7 @@ import org.tizen.emulator.manager.renewal.resources.ImageResources; import org.tizen.emulator.manager.tool.TapUtil; import org.tizen.emulator.manager.ui.renewal.dialog.TapDeviceDialogForWin; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubModifyItem; import org.tizen.emulator.manager.ui.renewal.widgets.ImageButton; @@ -136,7 +137,8 @@ public class NetTapDeviceItemForWin extends NetTapDeviceItem { isValid = false; } } - changeItemState(!isValid, SubModifyItem.BOX_WIDTH + SubModifyItem.BUTTON_SPACE + changeItemState(isValid? ItemState.NORMAL : ItemState.ERROR, + SubModifyItem.BOX_WIDTH + SubModifyItem.BUTTON_SPACE + SubModifyItem.BUTTON_WIDTH, msg); return isValid; } diff --git a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/TunerTableItem.java b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/TunerTableItem.java index 4e5795e..8d0ed22 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/TunerTableItem.java +++ b/src/org/tizen/emulator/manager/ui/renewal/item/modify/vm/TunerTableItem.java @@ -39,6 +39,7 @@ import org.eclipse.swt.widgets.FileDialog; import org.tizen.emulator.manager.renewal.resources.ColorResources; import org.tizen.emulator.manager.ui.renewal.MainDialog; import org.tizen.emulator.manager.ui.renewal.item.ItemName; +import org.tizen.emulator.manager.ui.renewal.item.ItemState; import org.tizen.emulator.manager.ui.renewal.item.modify.common.FileDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.common.ModifyDialogItem; import org.tizen.emulator.manager.ui.renewal.item.modify.comp.SubItemTitle; @@ -159,7 +160,8 @@ public class TunerTableItem extends FileDialogItem { } } - changeItemState(!isValid, BOX_WIDTH + 37 /* TODO: dialog button width*/, msg); + changeItemState(isValid? ItemState.NORMAL : ItemState.ERROR, + BOX_WIDTH + 37 /* TODO: dialog button width*/, msg); return isValid; } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/widgets/NinePatchBox.java b/src/org/tizen/emulator/manager/ui/renewal/widgets/NinePatchBox.java index 1dc1717..2fc4ebb 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/widgets/NinePatchBox.java +++ b/src/org/tizen/emulator/manager/ui/renewal/widgets/NinePatchBox.java @@ -135,16 +135,9 @@ public abstract class NinePatchBox extends Canvas{ }); } - public void setError(boolean isError) { - if (isError) { - setState(WSTATE.ERROR); - - } else { - // TODO is enough ? - if (!isDisabled()) { - setState(WSTATE.NORMAL); - } - } + + public void setWidgetState(WSTATE state) { + setState(state); redraw(); } diff --git a/src/org/tizen/emulator/manager/ui/renewal/widgets/TextBox.java b/src/org/tizen/emulator/manager/ui/renewal/widgets/TextBox.java index 547a4f9..7e01639 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/widgets/TextBox.java +++ b/src/org/tizen/emulator/manager/ui/renewal/widgets/TextBox.java @@ -179,5 +179,16 @@ public class TextBox extends NinePatchBox { ImageResources.INPUT_BOX_ERROR_B, ImageResources.INPUT_BOX_ERROR_LB, ImageResources.INPUT_BOX_ERROR_L); + + ninePatchResourceMap.setImages(WSTATE.LEAD, ColorResources.WHITE, + ColorResources.WHITE, + ImageResources.TEXT_INPUT_BOX_LEAD_LT, + ImageResources.TEXT_INPUT_BOX_LEAD_T, + ImageResources.TEXT_INPUT_BOX_LEAD_RT, + ImageResources.TEXT_INPUT_BOX_LEAD_R, + ImageResources.TEXT_INPUT_BOX_LEAD_RB, + ImageResources.TEXT_INPUT_BOX_LEAD_B, + ImageResources.TEXT_INPUT_BOX_LEAD_LB, + ImageResources.TEXT_INPUT_BOX_LEAD_L); } } diff --git a/src/org/tizen/emulator/manager/ui/renewal/widgets/TextInputBox.java b/src/org/tizen/emulator/manager/ui/renewal/widgets/TextInputBox.java index 902386a..9ae3b21 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/widgets/TextInputBox.java +++ b/src/org/tizen/emulator/manager/ui/renewal/widgets/TextInputBox.java @@ -327,6 +327,17 @@ public class TextInputBox extends NinePatchBox{ ImageResources.INPUT_BOX_ERROR_B, ImageResources.INPUT_BOX_ERROR_LB, ImageResources.INPUT_BOX_ERROR_L); + + ninePatchResourceMap.setImages(WSTATE.LEAD, ColorResources.WHITE, + ColorResources.BLACK, + ImageResources.TEXT_INPUT_BOX_LEAD_LT, + ImageResources.TEXT_INPUT_BOX_LEAD_T, + ImageResources.TEXT_INPUT_BOX_LEAD_RT, + ImageResources.TEXT_INPUT_BOX_LEAD_R, + ImageResources.TEXT_INPUT_BOX_LEAD_RB, + ImageResources.TEXT_INPUT_BOX_LEAD_B, + ImageResources.TEXT_INPUT_BOX_LEAD_LB, + ImageResources.TEXT_INPUT_BOX_LEAD_L); } public void setClearButtonStatus() { diff --git a/src/org/tizen/emulator/manager/ui/renewal/widgets/WSTATE.java b/src/org/tizen/emulator/manager/ui/renewal/widgets/WSTATE.java index c0ad098..749bec0 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/widgets/WSTATE.java +++ b/src/org/tizen/emulator/manager/ui/renewal/widgets/WSTATE.java @@ -39,7 +39,8 @@ public enum WSTATE { SELECTED_PUSH(5), DISABLE_ON(6), DISABLE_OFF(7), - ERROR(8); + ERROR(8), + LEAD(9); // highlight box private int id; WSTATE(int id) { diff --git a/src/org/tizen/emulator/manager/ui/renewal/widgets/WidgetHelper.java b/src/org/tizen/emulator/manager/ui/renewal/widgets/WidgetHelper.java index 2e53cbb..3d439ce 100644 --- a/src/org/tizen/emulator/manager/ui/renewal/widgets/WidgetHelper.java +++ b/src/org/tizen/emulator/manager/ui/renewal/widgets/WidgetHelper.java @@ -33,6 +33,7 @@ package org.tizen.emulator.manager.ui.renewal.widgets; import org.eclipse.swt.SWT; import org.eclipse.swt.events.PaintEvent; import org.eclipse.swt.events.PaintListener; +import org.eclipse.swt.graphics.Font; import org.eclipse.swt.graphics.GC; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; @@ -92,6 +93,16 @@ public class WidgetHelper { }); } + public static int calcTextWidth(Composite comp, String text, Font font) { + Point p = null; + comp.setFont(font); + GC gc = new GC(comp); + gc.setFont(comp.getFont()); + p = gc.textExtent(text); + gc.dispose(); + return p.x; + } + public static void drawSubTitle(Composite comp, final String text, final int horizentalAlign, final int titleWidth) { comp.addPaintListener(new PaintListener() { -- 2.7.4