diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2012-11-08 23:38:34 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2012-11-08 23:38:34 +1300 |
commit | efc59ab19fc92242d3532f990d129908f79be480 (patch) | |
tree | 260ba7069d834dd3e6d992e67398821c6d9013f8 /src | |
parent | fdcaf4c391020ea30881019938707b411dc9c426 (diff) | |
download | trackermap-web-efc59ab19fc92242d3532f990d129908f79be480.tar.gz trackermap-web-efc59ab19fc92242d3532f990d129908f79be480.tar.bz2 trackermap-web-efc59ab19fc92242d3532f990d129908f79be480.zip |
Add login dialog
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/web/client/Traccar.java | 6 | ||||
-rw-r--r-- | src/main/java/org/traccar/web/client/login/LoginDialog.java | 50 |
2 files changed, 56 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/web/client/Traccar.java b/src/main/java/org/traccar/web/client/Traccar.java index 6c8cdf18..9ba3e774 100644 --- a/src/main/java/org/traccar/web/client/Traccar.java +++ b/src/main/java/org/traccar/web/client/Traccar.java @@ -8,6 +8,8 @@ import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.HLayout; import com.smartgwt.client.widgets.layout.VLayout; +import org.traccar.web.client.login.LoginDialog; + /** * Entry point class */ @@ -22,6 +24,10 @@ public class Traccar implements EntryPoint { */ public void onModuleLoad() { + /*LoginDialog loginDialog = new LoginDialog(); + loginDialog.draw(); + loginDialog.centerInPage();*/ + devicePanel = new DevicePanel(); devicePanel.setWidth("20%"); devicePanel.setShowResizeBar(true); diff --git a/src/main/java/org/traccar/web/client/login/LoginDialog.java b/src/main/java/org/traccar/web/client/login/LoginDialog.java new file mode 100644 index 00000000..3ac01ccd --- /dev/null +++ b/src/main/java/org/traccar/web/client/login/LoginDialog.java @@ -0,0 +1,50 @@ +package org.traccar.web.client.login; + +import com.smartgwt.client.widgets.Window; +import com.smartgwt.client.widgets.form.DynamicForm; +import com.smartgwt.client.widgets.form.fields.PasswordItem; +import com.smartgwt.client.widgets.form.fields.TextItem; +import com.smartgwt.client.widgets.form.fields.ButtonItem; +import com.smartgwt.client.types.Alignment; +import com.smartgwt.client.types.TitleOrientation; +import com.smartgwt.client.widgets.layout.Layout; +import com.smartgwt.client.widgets.form.fields.ToolbarItem; +import com.smartgwt.client.widgets.IButton; +import com.smartgwt.client.widgets.Button; + +public class LoginDialog extends Window { + + private DynamicForm form; + + public LoginDialog() { + + // Window properties + setTitle("User Authentication"); + setShowCloseButton(false); + setShowMinimizeButton(false); + setAutoSize(true); + + // Login form + form = new DynamicForm(); + form.setHeight100(); + form.setWidth100(); + TextItem loginEdit = new TextItem(); + loginEdit.setTitle("Login"); + PasswordItem passwordEdit = new PasswordItem(); + passwordEdit.setTitle("Password"); + + ToolbarItem toolbarItem = new ToolbarItem(); + toolbarItem.setButtons(new IButton("Login"), new IButton("Register")); + + form.setFields(loginEdit, passwordEdit, toolbarItem); + form.setCellPadding(5); + + Layout layout = new Layout(); + layout.setPadding(10); + + layout.addMember(form); + + addItem(layout); + } + +} |