/***************************************************************************** * Copyright (c) 2010 CEA LIST. * * * 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: * Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - Initial API and implementation */ package org.eclipse.papyrus.uml.diagram.clazz.custom.ui; import org.eclipse.papyrus.uml.diagram.common.Activator; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CLabel; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.graphics.FontData; import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Dialog; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.ExpandBar; import org.eclipse.swt.widgets.ExpandItem; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Shell; /** * DO not modify manually, this class was generated by a visual editor * */ public class AbstractTemplateParameterConfigurationDialog extends Dialog { protected Object result; protected Shell shlTemplateparameterconfiguration; protected Button choosePararameteredElementButton; protected CLabel parameteredElementLabel; protected CLabel parameteredElementContent; protected Button chooseDefaultParameterButton; protected CLabel defaultElementLabel; protected CLabel defaultElementContent; protected Button btnCancel; protected Button btnExecute; /** * Create the dialog. * * @param parent * @param style */ public AbstractTemplateParameterConfigurationDialog(Shell parent, int style) { super(parent, SWT.DIALOG_TRIM | SWT.PRIMARY_MODAL); setText("SWT Dialog"); } public Button getBtnCancel() { return btnCancel; } public Button getBtnExecute() { return btnExecute; } /** * Open the dialog. * * @return the result */ public Object open() { createContents(); shlTemplateparameterconfiguration.open(); shlTemplateparameterconfiguration.layout(); Display display = getParent().getDisplay(); while(!shlTemplateparameterconfiguration.isDisposed()) { if(!display.readAndDispatch()) { display.sleep(); } } return result; } /** * Create contents of the dialog. */ protected void createContents() { Display display = Display.getCurrent(); Rectangle rect = display.getBounds(); shlTemplateparameterconfiguration = new Shell(getParent(), getStyle()); shlTemplateparameterconfiguration.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); shlTemplateparameterconfiguration.setSize(426, 281); shlTemplateparameterconfiguration.setText("TemplateParameterConfiguration"); shlTemplateparameterconfiguration.setLocation(new Point(rect.x + (rect.width / 2), rect.y + (rect.height / 2) - shlTemplateparameterconfiguration.getSize().y)); Label lblCreationOfA = new Label(shlTemplateparameterconfiguration, SWT.NONE); lblCreationOfA.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_LIGHT_SHADOW)); FontData[] fontdatas = { new FontData("Tahoma", 12, SWT.BOLD) }; lblCreationOfA.setFont(Activator.getFontManager().get(fontdatas)); lblCreationOfA.setText("Creation of a new template parameter:"); lblCreationOfA.setBounds(10, 10, 408, 28); ExpandBar expandBarRef = new ExpandBar(shlTemplateparameterconfiguration, SWT.NONE); expandBarRef.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); expandBarRef.setLocation(10, 43); expandBarRef.setSize(408, 70); ExpandItem xpndtmChooseYourParamter = new ExpandItem(expandBarRef, SWT.NONE); xpndtmChooseYourParamter.setExpanded(true); xpndtmChooseYourParamter.setText("Set the paramatered element in the model"); Composite composite_1 = new Composite(expandBarRef, SWT.NONE); composite_1.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); xpndtmChooseYourParamter.setControl(composite_1); choosePararameteredElementButton = new Button(composite_1, SWT.NONE); choosePararameteredElementButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { } }); choosePararameteredElementButton.setImage(Activator.getPluginIconImage("org.eclipse.papyrus.icons.uml", "resource/gif/Package.gif")); choosePararameteredElementButton.setBounds(322, 10, 68, 23); choosePararameteredElementButton.setText("..."); parameteredElementLabel = new CLabel(composite_1, SWT.NONE); parameteredElementLabel.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); parameteredElementLabel.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); parameteredElementLabel.setBounds(10, 10, 110, 19); parameteredElementLabel.setText("ParameteredElement:"); parameteredElementContent = new CLabel(composite_1, SWT.NONE); parameteredElementContent.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); parameteredElementContent.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); parameteredElementContent.setBounds(126, 10, 178, 19); parameteredElementContent.setText("New Label"); xpndtmChooseYourParamter.setHeight(40); ExpandBar expandBarDefault = new ExpandBar(shlTemplateparameterconfiguration, SWT.NONE); expandBarDefault.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); expandBarDefault.setBounds(10, 120, 408, 70); ExpandItem xpndtmSetTheDefault = new ExpandItem(expandBarDefault, SWT.NONE); xpndtmSetTheDefault.setExpanded(true); xpndtmSetTheDefault.setText("Set the default element for this parameter"); Composite composite = new Composite(expandBarDefault, SWT.NONE); composite.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); xpndtmSetTheDefault.setControl(composite); chooseDefaultParameterButton = new Button(composite, SWT.NONE); chooseDefaultParameterButton.setImage(Activator.getPluginIconImage("org.eclipse.papyrus.icons.uml", "resource/gif/Package.gif")); chooseDefaultParameterButton.setBounds(322, 10, 68, 23); chooseDefaultParameterButton.setText("..."); defaultElementLabel = new CLabel(composite, SWT.NONE); defaultElementLabel.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); defaultElementLabel.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); defaultElementLabel.setBounds(10, 10, 88, 19); defaultElementLabel.setText("DefaultElement:"); defaultElementContent = new CLabel(composite, SWT.NONE); defaultElementContent.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); defaultElementContent.setForeground(display.getSystemColor(SWT.COLOR_WIDGET_FOREGROUND)); defaultElementContent.setBounds(104, 10, 205, 19); defaultElementContent.setText("New Label"); xpndtmSetTheDefault.setHeight(40); btnExecute = new Button(shlTemplateparameterconfiguration, SWT.NONE); btnExecute.setBounds(342, 216, 68, 23); btnExecute.setText("Execute"); btnCancel = new Button(shlTemplateparameterconfiguration, SWT.NONE); btnCancel.setBounds(252, 216, 68, 23); btnCancel.setText("Cancel"); } /** * @return the result */ public Object getResult() { return result; } /** * @return the choosePararameteredElementButton */ public Button getChoosePararameteredElementButton() { return choosePararameteredElementButton; } /** * @return the parameteredElementLabel */ public CLabel getParameteredElementLabel() { return parameteredElementLabel; } /** * @return the parameteredElementContent */ public CLabel getParameteredElementContent() { return parameteredElementContent; } /** * @return the chooseDefaultParameterButton */ public Button getChooseDefaultParameterButton() { return chooseDefaultParameterButton; } /** * @return the defaultElementLabel */ public CLabel getDefaultElementLabel() { return defaultElementLabel; } /** * @return the defaultElementContent */ public CLabel getDefaultElementContent() { return defaultElementContent; } }