/*******************************************************************************
* Copyright (c) 2015 Inria
* 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:
* - Philippe Merle <philippe.merle@inria.fr>
*******************************************************************************/
package org.occiware.clouddesigner.occi.connector.jocci.dialogs;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Text;
import org.occiware.clouddesigner.occi.connector.jocci.Messages;
public class OcciServerDialog extends Dialog {
private Text txtOcciServerUrl;
private String occiServerUrl;
public OcciServerDialog(Shell parentShell) {
super(parentShell);
}
@Override
protected void configureShell(Shell shell) {
super.configureShell(shell);
shell.setText(Messages.OcciServerDialog_WindowTitle);
}
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
Label lbtOcciServerUrl = new Label(container, SWT.NONE);
lbtOcciServerUrl.setText(Messages.OcciServerDialog_Label);
txtOcciServerUrl = new Text(container, SWT.BORDER);
txtOcciServerUrl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
return area;
}
@Override
protected boolean isResizable() {
return true;
}
@Override
protected void okPressed() {
occiServerUrl = txtOcciServerUrl.getText();
super.okPressed();
}
public String getOcciServerUrl() {
return occiServerUrl;
}
}