|
From: jistrawn <jis...@us...> - 2006-10-24 21:35:24
|
Update of /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv31120/src/net/sourceforge/modelWizard/backingModelAbstraction Modified Files: ExportParameter.java BooleanExportParameter.java StringExportParameter.java IAssociationClass.java ResourceExportParameter.java IModelExporter.java Log Message: removed unused imports Index: BooleanExportParameter.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction/BooleanExportParameter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** BooleanExportParameter.java 15 Nov 2005 20:37:58 -0000 1.2 --- BooleanExportParameter.java 24 Oct 2006 21:35:17 -0000 1.3 *************** *** 1,73 **** ! /* ! * Created on Oct 31, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.swt.SWT; ! import org.eclipse.swt.events.SelectionEvent; ! import org.eclipse.swt.events.SelectionListener; ! import org.eclipse.swt.layout.GridData; ! import org.eclipse.swt.widgets.Button; ! import org.eclipse.swt.widgets.Composite; ! import org.eclipse.swt.widgets.Widget; ! ! public class BooleanExportParameter extends ExportParameter { ! ! private boolean defaultValue; ! private boolean currentValue; ! private Button button; ! ! /** ! * Constructor ! * @param title ! * @param toolTip ! * @param defaultValue ! */ ! public BooleanExportParameter (String title, String toolTip, boolean defaultValue){ ! this.title = title; ! this.toolTip = toolTip; ! this.defaultValue = defaultValue; ! this.currentValue = defaultValue; ! } ! ! /** ! * Add the necessary widgets to ! * @param parent ! * @return ! */ ! public void addWidgets(Composite parent) { ! button = new Button(parent, SWT.CHECK); ! final GridData gridData = new GridData(); ! gridData.horizontalSpan = 3; ! button.setLayoutData(gridData); ! button.setText(this.title); ! button.setToolTipText(this.toolTip); ! button.addSelectionListener(new SelectionListener(){ ! ! public void widgetSelected(SelectionEvent e) { ! currentValue = button.getSelection(); ! } ! ! public void widgetDefaultSelected(SelectionEvent e) { ! } ! ! }); ! button.setSelection(defaultValue); ! } ! ! public boolean getValue(){ ! return currentValue; ! } ! } --- 1,72 ---- ! /* ! * Created on Oct 31, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.swt.SWT; ! import org.eclipse.swt.events.SelectionEvent; ! import org.eclipse.swt.events.SelectionListener; ! import org.eclipse.swt.layout.GridData; ! import org.eclipse.swt.widgets.Button; ! import org.eclipse.swt.widgets.Composite; ! ! public class BooleanExportParameter extends ExportParameter { ! ! private boolean defaultValue; ! private boolean currentValue; ! private Button button; ! ! /** ! * Constructor ! * @param title ! * @param toolTip ! * @param defaultValue ! */ ! public BooleanExportParameter (String title, String toolTip, boolean defaultValue){ ! this.title = title; ! this.toolTip = toolTip; ! this.defaultValue = defaultValue; ! this.currentValue = defaultValue; ! } ! ! /** ! * Add the necessary widgets to ! * @param parent ! * @return ! */ ! public void addWidgets(Composite parent) { ! button = new Button(parent, SWT.CHECK); ! final GridData gridData = new GridData(); ! gridData.horizontalSpan = 3; ! button.setLayoutData(gridData); ! button.setText(this.title); ! button.setToolTipText(this.toolTip); ! button.addSelectionListener(new SelectionListener(){ ! ! public void widgetSelected(SelectionEvent e) { ! currentValue = button.getSelection(); ! } ! ! public void widgetDefaultSelected(SelectionEvent e) { ! } ! ! }); ! button.setSelection(defaultValue); ! } ! ! public boolean getValue(){ ! return currentValue; ! } ! } Index: IModelExporter.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction/IModelExporter.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** IModelExporter.java 23 Nov 2005 23:27:08 -0000 1.4 --- IModelExporter.java 24 Oct 2006 21:35:17 -0000 1.5 *************** *** 1,50 **** ! /* ! * Created on Oct 4, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import java.util.Collection; ! import java.util.Iterator; ! import java.util.Map; ! ! import org.eclipse.core.runtime.IPath; ! import org.eclipse.core.runtime.IProgressMonitor; ! import org.eclipse.jface.operation.IRunnableContext; ! ! public interface IModelExporter { ! ! /** ! * Get the set of parameters that this export requires. For optimum usability these parameters should ! * be persisted as preferences. ! * @param m The model that is to be used for this export ! * @return A collection of parameters which will instances of ExportParameter subclasses. ! */ ! public Map getParameters(IModel m); ! ! /** ! * Actually perform the export. ! * ! * @param m The based model for the export ! * @param classNames. A list of classes to export. Note that the export should ensure that any dependencies are fulfilled during the export ! * @param parameters The parameters required for this export (as defined above and modified by the user). ! * @param filePath The workspace relative path for the exported file. ! * @param monitor The monitor for this export ! * @param runnableContext Context to run any long running tasks. ! * @throws ModelTransformationException ! * @throws InterruptedException ! */ ! public void exportModel(IModel m, Iterator classNames, Map parameters, IPath filePath, IProgressMonitor monitor, IRunnableContext runnableContext) throws ModelTransformationException, InterruptedException; ! ! } --- 1,49 ---- ! /* ! * Created on Oct 4, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import java.util.Iterator; ! import java.util.Map; ! ! import org.eclipse.core.runtime.IPath; ! import org.eclipse.core.runtime.IProgressMonitor; ! import org.eclipse.jface.operation.IRunnableContext; ! ! public interface IModelExporter { ! ! /** ! * Get the set of parameters that this export requires. For optimum usability these parameters should ! * be persisted as preferences. ! * @param m The model that is to be used for this export ! * @return A collection of parameters which will instances of ExportParameter subclasses. ! */ ! public Map getParameters(IModel m); ! ! /** ! * Actually perform the export. ! * ! * @param m The based model for the export ! * @param classNames. A list of classes to export. Note that the export should ensure that any dependencies are fulfilled during the export ! * @param parameters The parameters required for this export (as defined above and modified by the user). ! * @param filePath The workspace relative path for the exported file. ! * @param monitor The monitor for this export ! * @param runnableContext Context to run any long running tasks. ! * @throws ModelTransformationException ! * @throws InterruptedException ! */ ! public void exportModel(IModel m, Iterator classNames, Map parameters, IPath filePath, IProgressMonitor monitor, IRunnableContext runnableContext) throws ModelTransformationException, InterruptedException; ! ! } Index: ExportParameter.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction/ExportParameter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ExportParameter.java 15 Nov 2005 20:37:58 -0000 1.2 --- ExportParameter.java 24 Oct 2006 21:35:16 -0000 1.3 *************** *** 1,38 **** ! /* ! * Created on Oct 31, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.swt.widgets.Composite; ! import org.eclipse.swt.widgets.Widget; ! ! /** ! * @author stjerman ! * Date: Oct 31, 2005 ! */ ! public abstract class ExportParameter { ! ! String title; ! String toolTip; ! ! /** ! * Add the necessary widgets to the parent composite to handle this parameter. ! * The parent composite is assumed to have a grid layout with 3 columns ! * ! * @param parent The parent composite. ! * @return ! */ ! public abstract void addWidgets(Composite parent); ! } --- 1,37 ---- ! /* ! * Created on Oct 31, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.swt.widgets.Composite; ! ! /** ! * @author stjerman ! * Date: Oct 31, 2005 ! */ ! public abstract class ExportParameter { ! ! String title; ! String toolTip; ! ! /** ! * Add the necessary widgets to the parent composite to handle this parameter. ! * The parent composite is assumed to have a grid layout with 3 columns ! * ! * @param parent The parent composite. ! * @return ! */ ! public abstract void addWidgets(Composite parent); ! } Index: IAssociationClass.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction/IAssociationClass.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** IAssociationClass.java 7 Nov 2005 16:19:15 -0000 1.1 --- IAssociationClass.java 24 Oct 2006 21:35:17 -0000 1.2 *************** *** 1,26 **** ! /* ! * Created on Sep 21, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import java.util.Map; ! ! /** ! * @author stjerman Date: Sep 21, 2005 ! * ! */ ! public interface IAssociationClass extends IClass, IAssociation { ! ! } --- 1,25 ---- ! /* ! * Created on Sep 21, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! ! /** ! * @author stjerman Date: Sep 21, 2005 ! * ! */ ! public interface IAssociationClass extends IClass, IAssociation { ! ! } Index: StringExportParameter.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction/StringExportParameter.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StringExportParameter.java 15 Nov 2005 20:37:58 -0000 1.2 --- StringExportParameter.java 24 Oct 2006 21:35:17 -0000 1.3 *************** *** 1,70 **** ! /* ! * Created on Oct 31, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.swt.SWT; ! import org.eclipse.swt.events.ModifyEvent; ! import org.eclipse.swt.events.ModifyListener; ! import org.eclipse.swt.events.SelectionEvent; ! import org.eclipse.swt.events.SelectionListener; ! import org.eclipse.swt.layout.GridData; ! import org.eclipse.swt.widgets.Composite; ! import org.eclipse.swt.widgets.Label; ! import org.eclipse.swt.widgets.Text; ! ! /** ! * @author stjerman ! * Date: Oct 31, 2005 ! */ ! public class StringExportParameter extends ExportParameter { ! ! String defaultValue; ! String currentValue; ! private Text text; ! ! public StringExportParameter (String title, String toolTip, String defaultValue){ ! this.title = title; ! this.toolTip = toolTip; ! this.defaultValue = defaultValue; ! this.currentValue = defaultValue; ! } ! ! /* (non-Javadoc) ! * @see net.sourceforge.modelWizard.backingModelAbstraction.ExportParameter#addWidgets(org.eclipse.swt.widgets.Composite) ! */ ! public void addWidgets(Composite parent) { ! final Label label = new Label(parent, SWT.NONE); ! label.setText(this.title); ! text = new Text(parent, SWT.BORDER); ! text.setText(this.defaultValue); ! text.setToolTipText(this.toolTip); ! final GridData gridData = new GridData(GridData.FILL_HORIZONTAL); ! gridData.horizontalSpan = 2; ! text.setLayoutData(gridData); ! text.addModifyListener(new ModifyListener(){ ! ! public void modifyText(ModifyEvent e) { ! currentValue = text.getText(); ! } ! ! }); ! } ! ! public String getValue(){ ! return currentValue; ! } ! ! } --- 1,68 ---- ! /* ! * Created on Oct 31, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.swt.SWT; ! import org.eclipse.swt.events.ModifyEvent; ! import org.eclipse.swt.events.ModifyListener; ! import org.eclipse.swt.layout.GridData; ! import org.eclipse.swt.widgets.Composite; ! import org.eclipse.swt.widgets.Label; ! import org.eclipse.swt.widgets.Text; ! ! /** ! * @author stjerman ! * Date: Oct 31, 2005 ! */ ! public class StringExportParameter extends ExportParameter { ! ! String defaultValue; ! String currentValue; ! private Text text; ! ! public StringExportParameter (String title, String toolTip, String defaultValue){ ! this.title = title; ! this.toolTip = toolTip; ! this.defaultValue = defaultValue; ! this.currentValue = defaultValue; ! } ! ! /* (non-Javadoc) ! * @see net.sourceforge.modelWizard.backingModelAbstraction.ExportParameter#addWidgets(org.eclipse.swt.widgets.Composite) ! */ ! public void addWidgets(Composite parent) { ! final Label label = new Label(parent, SWT.NONE); ! label.setText(this.title); ! text = new Text(parent, SWT.BORDER); ! text.setText(this.defaultValue); ! text.setToolTipText(this.toolTip); ! final GridData gridData = new GridData(GridData.FILL_HORIZONTAL); ! gridData.horizontalSpan = 2; ! text.setLayoutData(gridData); ! text.addModifyListener(new ModifyListener(){ ! ! public void modifyText(ModifyEvent e) { ! currentValue = text.getText(); ! } ! ! }); ! } ! ! public String getValue(){ ! return currentValue; ! } ! ! } Index: ResourceExportParameter.java =================================================================== RCS file: /cvsroot/modelwizard/source/Model Wizard Plugin/src/net/sourceforge/modelWizard/backingModelAbstraction/ResourceExportParameter.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ResourceExportParameter.java 15 Nov 2005 20:37:58 -0000 1.1 --- ResourceExportParameter.java 24 Oct 2006 21:35:17 -0000 1.2 *************** *** 1,111 **** ! /* ! * Created on Nov 7, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.core.resources.IFile; ! import org.eclipse.core.resources.ResourcesPlugin; ! import org.eclipse.core.runtime.Path; ! import org.eclipse.swt.SWT; ! import org.eclipse.swt.events.ModifyEvent; ! import org.eclipse.swt.events.ModifyListener; ! import org.eclipse.swt.events.SelectionAdapter; ! import org.eclipse.swt.events.SelectionEvent; ! import org.eclipse.swt.layout.GridData; ! import org.eclipse.swt.widgets.Button; ! import org.eclipse.swt.widgets.Composite; ! import org.eclipse.swt.widgets.Label; ! import org.eclipse.swt.widgets.Shell; ! import org.eclipse.swt.widgets.Text; ! import org.eclipse.ui.dialogs.ContainerSelectionDialog; ! import org.eclipse.ui.dialogs.ResourceSelectionDialog; ! ! public class ResourceExportParameter extends ExportParameter { ! ! private String defaultValue; ! private String currentValue; ! private Shell shell; ! private Text text; ! ! /** ! * Constructor ! * @param title ! * @param toolTip ! * @param defaultValue null for no default ! */ ! public ResourceExportParameter (String title, String toolTip, String defaultValue){ ! this.title = title; ! this.toolTip = toolTip; ! this.defaultValue = defaultValue; ! this.currentValue = defaultValue; ! } ! ! public void addWidgets(Composite parent) { ! this.shell = parent.getShell(); ! final Label label = new Label(parent, SWT.NONE); ! label.setText(this.title); ! label.setToolTipText(this.toolTip); ! ! text = new Text(parent, SWT.BORDER); ! text.addModifyListener(new ModifyListener(){ ! ! public void modifyText(ModifyEvent e) { ! currentValue = text.getText(); ! } ! ! }); ! text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ! text.setToolTipText(this.toolTip); ! if (defaultValue != null) ! text.setText(defaultValue); ! ! final Button button = new Button(parent, SWT.NONE); ! button.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! handleBrowse(); ! } ! }); ! button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); ! button.setText("Browse..."); ! button.setToolTipText(this.toolTip); ! ! } ! ! /** ! * Uses the standard container st election dialog to ! * choose the new value for the container field. ! */ ! private void handleBrowse() ! { ! ResourceSelectionDialog dialog = ! new ResourceSelectionDialog( ! shell, ! ResourcesPlugin.getWorkspace().getRoot(), ! this.title); ! if (dialog.open() == ResourceSelectionDialog.OK) ! { ! Object[] result = dialog.getResult(); ! if (result.length == 1) ! { ! IFile f = (IFile) result[0]; ! text.setText(f.getFullPath().toOSString()); ! } ! } ! } ! ! public String getValue(){ ! return currentValue; ! } ! } --- 1,109 ---- ! /* ! * Created on Nov 7, 2005 ! * @author stjerman ! * <copyright> ! * ! * Copyright (c) 2005 Cisco Systems Inc, ! * All rights reserved. This program and the accompanying materials ! * are made available under the terms of the BSD License ! * which accompanies this distribution. ! * ! * Contributors: ! * CISCO - Initial API and implementation ! * ! * </copyright> ! */ ! package net.sourceforge.modelWizard.backingModelAbstraction; ! ! import org.eclipse.core.resources.IFile; ! import org.eclipse.core.resources.ResourcesPlugin; ! import org.eclipse.swt.SWT; ! import org.eclipse.swt.events.ModifyEvent; ! import org.eclipse.swt.events.ModifyListener; ! import org.eclipse.swt.events.SelectionAdapter; ! import org.eclipse.swt.events.SelectionEvent; ! import org.eclipse.swt.layout.GridData; ! import org.eclipse.swt.widgets.Button; ! import org.eclipse.swt.widgets.Composite; ! import org.eclipse.swt.widgets.Label; ! import org.eclipse.swt.widgets.Shell; ! import org.eclipse.swt.widgets.Text; ! import org.eclipse.ui.dialogs.ResourceSelectionDialog; ! ! public class ResourceExportParameter extends ExportParameter { ! ! private String defaultValue; ! private String currentValue; ! private Shell shell; ! private Text text; ! ! /** ! * Constructor ! * @param title ! * @param toolTip ! * @param defaultValue null for no default ! */ ! public ResourceExportParameter (String title, String toolTip, String defaultValue){ ! this.title = title; ! this.toolTip = toolTip; ! this.defaultValue = defaultValue; ! this.currentValue = defaultValue; ! } ! ! public void addWidgets(Composite parent) { ! this.shell = parent.getShell(); ! final Label label = new Label(parent, SWT.NONE); ! label.setText(this.title); ! label.setToolTipText(this.toolTip); ! ! text = new Text(parent, SWT.BORDER); ! text.addModifyListener(new ModifyListener(){ ! ! public void modifyText(ModifyEvent e) { ! currentValue = text.getText(); ! } ! ! }); ! text.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); ! text.setToolTipText(this.toolTip); ! if (defaultValue != null) ! text.setText(defaultValue); ! ! final Button button = new Button(parent, SWT.NONE); ! button.addSelectionListener(new SelectionAdapter() { ! public void widgetSelected(SelectionEvent e) { ! handleBrowse(); ! } ! }); ! button.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); ! button.setText("Browse..."); ! button.setToolTipText(this.toolTip); ! ! } ! ! /** ! * Uses the standard container st election dialog to ! * choose the new value for the container field. ! */ ! private void handleBrowse() ! { ! ResourceSelectionDialog dialog = ! new ResourceSelectionDialog( ! shell, ! ResourcesPlugin.getWorkspace().getRoot(), ! this.title); ! if (dialog.open() == ResourceSelectionDialog.OK) ! { ! Object[] result = dialog.getResult(); ! if (result.length == 1) ! { ! IFile f = (IFile) result[0]; ! text.setText(f.getFullPath().toOSString()); ! } ! } ! } ! ! public String getValue(){ ! return currentValue; ! } ! } |