X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.ui%2Fsrc%2Forg%2Fsimantics%2Fui%2Fauth%2FLoginDialog.java;h=b31782014a864b06e2428ccb62bd2e049f69df63;hp=a82823f0568692c6c15b4c711d5eb0b316575376;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.ui/src/org/simantics/ui/auth/LoginDialog.java b/bundles/org.simantics.ui/src/org/simantics/ui/auth/LoginDialog.java index a82823f05..b31782014 100644 --- a/bundles/org.simantics.ui/src/org/simantics/ui/auth/LoginDialog.java +++ b/bundles/org.simantics.ui/src/org/simantics/ui/auth/LoginDialog.java @@ -1,89 +1,89 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 Association for Decentralized Information Management - * in Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.ui.auth; - -import org.eclipse.jface.dialogs.IDialogSettings; -import org.eclipse.jface.dialogs.TrayDialog; -import org.eclipse.jface.layout.GridDataFactory; -import org.eclipse.swt.SWT; -import org.eclipse.swt.graphics.Point; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Shell; -import org.simantics.ui.auth.model.LoginModel; - -/** - * @author Tuukka Lehtonen - */ -public class LoginDialog extends TrayDialog { - - private static final String LOGIN_DIALOG = "LoginDialog"; //$NON-NLS-1$ - - private IDialogSettings dialogBoundsSettings; - - private LoginComposite c; - - private final LoginModel model; - - protected LoginDialog(Shell parentShell, IDialogSettings settings, LoginModel model) { - super(parentShell); - this.model = model; - - dialogBoundsSettings = settings.getSection(LOGIN_DIALOG); - if (dialogBoundsSettings == null) - dialogBoundsSettings = settings.addNewSection(LOGIN_DIALOG); - } - - @Override - protected int getShellStyle() { - return super.getShellStyle() /*| SWT.RESIZE */; - } - - @Override - protected void configureShell(Shell newShell) { - newShell.setText("Login - " + model.getServer().getName()); - super.configureShell(newShell); - } - - @Override - protected Control createDialogArea(Composite parent) { - Composite composite = (Composite) super.createDialogArea(parent); - - c = new LoginComposite(composite, SWT.NONE, model); - - GridDataFactory.fillDefaults().grab(true, false).applyTo(c); - - applyDialogFont(composite); - - return composite; - } - - @Override - protected IDialogSettings getDialogBoundsSettings() { - return dialogBoundsSettings; - } - - @Override - protected Point getInitialSize() { - Point defaultSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); - Point result = super.getInitialSize(); - if (defaultSize.equals(result)) - return new Point(400, 220); - return result; - } - - @Override - protected void createButtonsForButtonBar(Composite parent) { - super.createButtonsForButtonBar(parent); - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 Association for Decentralized Information Management + * in Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.ui.auth; + +import org.eclipse.jface.dialogs.IDialogSettings; +import org.eclipse.jface.dialogs.TrayDialog; +import org.eclipse.jface.layout.GridDataFactory; +import org.eclipse.swt.SWT; +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Shell; +import org.simantics.ui.auth.model.LoginModel; + +/** + * @author Tuukka Lehtonen + */ +public class LoginDialog extends TrayDialog { + + private static final String LOGIN_DIALOG = "LoginDialog"; //$NON-NLS-1$ + + private IDialogSettings dialogBoundsSettings; + + private LoginComposite c; + + private final LoginModel model; + + protected LoginDialog(Shell parentShell, IDialogSettings settings, LoginModel model) { + super(parentShell); + this.model = model; + + dialogBoundsSettings = settings.getSection(LOGIN_DIALOG); + if (dialogBoundsSettings == null) + dialogBoundsSettings = settings.addNewSection(LOGIN_DIALOG); + } + + @Override + protected int getShellStyle() { + return super.getShellStyle() /*| SWT.RESIZE */; + } + + @Override + protected void configureShell(Shell newShell) { + newShell.setText("Login - " + model.getServer().getName()); + super.configureShell(newShell); + } + + @Override + protected Control createDialogArea(Composite parent) { + Composite composite = (Composite) super.createDialogArea(parent); + + c = new LoginComposite(composite, SWT.NONE, model); + + GridDataFactory.fillDefaults().grab(true, false).applyTo(c); + + applyDialogFont(composite); + + return composite; + } + + @Override + protected IDialogSettings getDialogBoundsSettings() { + return dialogBoundsSettings; + } + + @Override + protected Point getInitialSize() { + Point defaultSize = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT, true); + Point result = super.getInitialSize(); + if (defaultSize.equals(result)) + return new Point(400, 220); + return result; + } + + @Override + protected void createButtonsForButtonBar(Composite parent) { + super.createButtonsForButtonBar(parent); + } + +}