use of com.extjs.gxt.ui.client.widget.TabPanel in project kapua by eclipse.
the class DeviceTabPackages method initPackagesTabs.
private void initPackagesTabs() {
tabsPanel = new TabPanel();
tabsPanel.setPlain(true);
tabsPanel.setBorders(false);
tabsPanel.setTabPosition(TabPosition.BOTTOM);
//
// Packages installed tab
installedPackageTab = new DeviceTabPackagesInstalled(this);
installedPackageTab.setText(MSGS.deviceInstallTabInstalled());
installedPackageTab.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.packageGreen16()));
installedPackageTab.setBorders(false);
installedPackageTab.setLayout(new FitLayout());
installedPackageTab.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
refresh();
}
});
tabsPanel.add(installedPackageTab);
//
// In progress packages install tab
inProgressPackageTab = new DeviceTabPackagesInProgress(this);
inProgressPackageTab.setText(MSGS.deviceInstallTabInProgress());
inProgressPackageTab.setIcon(AbstractImagePrototype.create(Resources.INSTANCE.packageGo16()));
inProgressPackageTab.setBorders(false);
inProgressPackageTab.setLayout(new FitLayout());
inProgressPackageTab.addListener(Events.Select, new Listener<ComponentEvent>() {
public void handleEvent(ComponentEvent be) {
refresh();
}
});
tabsPanel.add(inProgressPackageTab);
add(tabsPanel);
}
use of com.extjs.gxt.ui.client.widget.TabPanel in project kapua by eclipse.
the class UserForm method onRender.
protected void onRender(Element parent, int index) {
super.onRender(parent, index);
FormData formData = new FormData("0");
// Create separate tabs
m_tabsPanel = new TabPanel();
m_tabsPanel.setPlain(true);
m_tabsPanel.setBorders(false);
m_tabsPanel.setBodyBorder(false);
m_formPanel = new FormPanel();
m_formPanel.setFrame(false);
m_formPanel.setBorders(false);
m_formPanel.setBodyBorder(false);
m_formPanel.setHeaderVisible(false);
m_formPanel.setLayout(new FitLayout());
m_formPanel.setPadding(0);
m_formPanel.add(m_tabsPanel);
//
// User info tab
//
FieldSet infoFieldSet = new FieldSet();
infoFieldSet.setHeading(MSGS.userFormInfo());
infoFieldSet.setBorders(true);
infoFieldSet.setStyleAttribute("margin", "0px 10px 0px 10px");
FormLayout layout = new FormLayout();
layout.setLabelWidth(Constants.LABEL_WIDTH_FORM);
infoFieldSet.setLayout(layout);
username = new TextField<String>();
username.setAllowBlank(false);
username.setName("userName");
username.setFieldLabel("* " + MSGS.userFormName());
username.setValidator(new TextFieldValidator(username, FieldType.NAME));
infoFieldSet.add(username, formData);
password = new TextField<String>();
password.setAllowBlank(false);
password.setName("password");
password.setFieldLabel("* " + MSGS.userFormPassword());
password.setValidator(new PasswordFieldValidator(password));
password.setPassword(true);
infoFieldSet.add(password, formData);
confirmPassword = new TextField<String>();
confirmPassword.setAllowBlank(false);
confirmPassword.setName("confirmPassword");
confirmPassword.setFieldLabel("* " + MSGS.userFormConfirmPassword());
confirmPassword.setValidator(new ConfirmPasswordFieldValidator(confirmPassword, password));
confirmPassword.setPassword(true);
infoFieldSet.add(confirmPassword, formData);
LabelField tooltip = new LabelField();
tooltip.setValue(MSGS.userFormPasswordTooltip());
tooltip.setStyleAttribute("margin-top", "-5px");
tooltip.setStyleAttribute("color", "gray");
tooltip.setStyleAttribute("font-size", "10px");
infoFieldSet.add(tooltip, formData);
displayName = new TextField<String>();
displayName.setName("displayName");
displayName.setFieldLabel(MSGS.userFormDisplayName());
infoFieldSet.add(displayName, formData);
email = new TextField<String>();
email.setName("userEmail");
email.setFieldLabel(MSGS.userFormEmail());
email.setValidator(new TextFieldValidator(email, FieldType.EMAIL));
infoFieldSet.add(email, formData);
phoneNumber = new TextField<String>();
phoneNumber.setName("phoneNumber");
phoneNumber.setFieldLabel(MSGS.userFormPhoneNumber());
infoFieldSet.add(phoneNumber, formData);
optlock = new NumberField();
optlock.setName("optlock");
optlock.setEditable(false);
optlock.setVisible(false);
infoFieldSet.add(optlock, formData);
// status field set
FormLayout userLayout = new FormLayout();
userLayout.setLabelWidth(Constants.LABEL_WIDTH_FORM);
statusFieldSet = new FieldSet();
statusFieldSet.setBorders(true);
statusFieldSet.setStyleAttribute("margin", "5px 10px 0px 10px");
statusFieldSet.setHeading(MSGS.userFormStatus());
statusFieldSet.setLayout(userLayout);
statusCombo = new SimpleComboBox<String>();
statusCombo.setName("comboStatus");
statusCombo.setFieldLabel(MSGS.userFormStatus());
statusCombo.setLabelSeparator(":");
statusCombo.setEditable(false);
statusCombo.setTypeAhead(true);
statusCombo.setTriggerAction(TriggerAction.ALL);
// show account status combo box
for (GwtUserStatus status : GwtUserStatus.values()) {
statusCombo.add(MessageUtils.get(status.name()));
}
statusCombo.setSimpleValue(MessageUtils.get(GwtUserStatus.ENABLED.name()));
statusFieldSet.add(statusCombo, formData);
m_tabUserInfo = new TabItem(MSGS.userFormInformation());
m_tabUserInfo.setBorders(false);
m_tabUserInfo.setStyleAttribute("background-color", "#E8E8E8");
m_tabUserInfo.setScrollMode(Scroll.AUTOY);
m_tabUserInfo.add(infoFieldSet);
m_tabUserInfo.add(statusFieldSet);
m_tabsPanel.add(m_tabUserInfo);
// button bar
m_status = new Status();
m_status.setBusy(MSGS.waitMsg());
m_status.hide();
m_status.setAutoWidth(true);
submitButton = new Button(MSGS.submitButton(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
if (!m_formPanel.isValid()) {
return;
}
// Hold the dialog until the action comes back
m_status.show();
m_formPanel.getButtonBar().disable();
submitAccount();
}
});
Button cancelButton = new Button(MSGS.cancelButton(), new SelectionListener<ButtonEvent>() {
@Override
public void componentSelected(ButtonEvent ce) {
hide();
}
});
m_formPanel.getButtonBar().add(m_status);
m_formPanel.getButtonBar().add(new FillToolItem());
m_formPanel.setButtonAlign(HorizontalAlignment.CENTER);
m_formPanel.addButton(submitButton);
m_formPanel.addButton(cancelButton);
loadUser();
add(m_formPanel);
setEditability();
}
Aggregations