diff --git a/org.ntlab.interactiveFeatureLocator/.classpath b/org.ntlab.interactiveFeatureLocator/.classpath new file mode 100644 index 0000000..cb502d1 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/.classpath @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/org.ntlab.interactiveFeatureLocator/.gitignore b/org.ntlab.interactiveFeatureLocator/.gitignore new file mode 100644 index 0000000..ae3c172 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/org.ntlab.interactiveFeatureLocator/.project b/org.ntlab.interactiveFeatureLocator/.project new file mode 100644 index 0000000..067ed3d --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/.project @@ -0,0 +1,29 @@ + + + org.ntlab.interactiveFeatureLocator + + + jedit + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.ntlab.interactiveFeatureLocator/.settings/org.eclipse.jdt.core.prefs b/org.ntlab.interactiveFeatureLocator/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..295926d --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Minus/Minus.trace b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Minus/Minus.trace new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Minus/Minus.trace diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Plus/Mark.mark b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Plus/Mark.mark new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Plus/Mark.mark diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Plus/Plus.trace b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Plus/Plus.trace new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/Plus/Plus.trace diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/scenario.xml b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/scenario.xml new file mode 100644 index 0000000..c68d442 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/Pattern1/scenario.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1/feature1.xml b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/feature1.xml new file mode 100644 index 0000000..fdbe23a --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1/feature1.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Minus/1593375-.trace b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Minus/1593375-.trace new file mode 100644 index 0000000..eb09175 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Minus/1593375-.trace Binary files differ diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Plus/1593375.trace b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Plus/1593375.trace new file mode 100644 index 0000000..f44c019 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Plus/1593375.trace Binary files differ diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Plus/Mark.mark b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Plus/Mark.mark new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/Plus/Mark.mark diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/scenario.xml b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/scenario.xml new file mode 100644 index 0000000..bdc5797 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/Pattern1/scenario.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/feature1593375.xml b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/feature1593375.xml new file mode 100644 index 0000000..1092415 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/Feature/Feature1593375/feature1593375.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/org.ntlab.interactiveFeatureLocator/META-INF/MANIFEST.MF b/org.ntlab.interactiveFeatureLocator/META-INF/MANIFEST.MF new file mode 100644 index 0000000..d567738 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/META-INF/MANIFEST.MF @@ -0,0 +1,15 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: InteractiveFeatureLocator +Bundle-SymbolicName: org.ntlab.interactiveFeatureLocator;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Activator: interactivefeaturelocator.Activator +Require-Bundle: org.eclipse.ui, + org.eclipse.core.runtime, + org.eclipse.core.resources, + org.eclipse.jdt.core, + org.eclipse.zest.core;bundle-version="1.5.200", + org.eclipse.zest.layouts;bundle-version="1.1.200", + org.eclipse.ui.ide;bundle-version="3.10.0" +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-ActivationPolicy: lazy diff --git a/org.ntlab.interactiveFeatureLocator/UML/InteractiveFeatureLocator.uxf b/org.ntlab.interactiveFeatureLocator/UML/InteractiveFeatureLocator.uxf new file mode 100644 index 0000000..6d86a1a --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/UML/InteractiveFeatureLocator.uxf @@ -0,0 +1,275 @@ + + + 10 + + Relation + + 670 + 90 + 140 + 140 + + lt=<<<<-> +m1=1 +m2=1 + 120.0;10.0;120.0;110.0;10.0;110.0 + + + UMLClass + + 680 + 30 + 280 + 70 + + InteractiveFeatureLocatorAction +-- + +-- + + + + + UMLClass + + 530 + 170 + 150 + 70 + + TraceView +-- + +-- + + + + + UMLClass + + 1000 + 160 + 150 + 70 + + DerivationManager +-- + +-- + + + + + UMLClass + + 230 + 170 + 200 + 70 + + InteractiveDerivationView +-- + +-- + + + + + Relation + + 420 + 200 + 130 + 40 + + lt=<<<<-> +m1=1 +m2=1 + 110.0;10.0;10.0;10.0 + + + UMLClass + + 230 + 320 + 150 + 70 + + SelectMethodTabFolder +-- + +-- + + + + + Relation + + 340 + 230 + 90 + 110 + + lt=<<<<-> +tabFolders +m1=1 +m2=* + 10.0;10.0;10.0;90.0 + + + Relation + + 260 + 230 + 100 + 110 + + lt=<<<<-> +focusFolder +m1=1 +m2=1 + 10.0;10.0;10.0;90.0 + + + UMLClass + + 230 + 470 + 150 + 70 + + SelectMethodSession +-- + +-- + + + + + Relation + + 300 + 380 + 80 + 110 + + lt=<<<<-> +sessions +m1=1 +m2=* + 10.0;10.0;10.0;90.0 + + + UMLClass + + 50 + 630 + 150 + 70 + + CallTreeGraph +-- + +-- + + + + + UMLClass + + 380 + 620 + 150 + 70 + + SelectionComposite +-- + +-- + + + + + Relation + + 130 + 530 + 160 + 120 + + lt=<<<<-> +graph +m1=1 +m2=1 + 140.0;10.0;140.0;50.0;10.0;50.0;10.0;100.0 + + + Relation + + 310 + 530 + 170 + 110 + + lt=<<<<-> +selectionComposite +m1=1 +m2=1 + 10.0;10.0;10.0;50.0;150.0;50.0;150.0;90.0 + + + UMLClass + + 40 + 790 + 150 + 70 + + TreeGraphNode +-- + +-- + + + + + Relation + + 110 + 690 + 100 + 120 + + lt=<<<<-> +currentNode +m1=1 +m2=1 + 10.0;10.0;10.0;100.0 + + + Relation + + 860 + 90 + 160 + 130 + + lt=<<<<-> +m1=1 +m2=1 + 10.0;10.0;10.0;100.0;140.0;100.0 + + + Relation + + 670 + 210 + 350 + 40 + + lt=<<<<-> +m1=1 +m2=1 + 10.0;10.0;330.0;10.0 + + diff --git a/org.ntlab.interactiveFeatureLocator/UML/SelectionMethodSession.uxf b/org.ntlab.interactiveFeatureLocator/UML/SelectionMethodSession.uxf new file mode 100644 index 0000000..0312f8c --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/UML/SelectionMethodSession.uxf @@ -0,0 +1,64 @@ + + + 10 + + UMLClass + + 650 + 90 + 200 + 30 + + SelectMethodSession + + + + + UMLClass + + 840 + 170 + 180 + 30 + + SelectComposite + + + + + UMLClass + + 480 + 170 + 160 + 30 + + CallTreeGraph + + + + + Relation + + 550 + 110 + 200 + 80 + + lt=<- +m1=1 + 10.0;60.0;10.0;30.0;180.0;30.0;180.0;10.0 + + + Relation + + 770 + 110 + 190 + 80 + + lt=<- +m1=1 + 170.0;60.0;170.0;30.0;10.0;30.0;10.0;10.0 + + diff --git a/org.ntlab.interactiveFeatureLocator/build.properties b/org.ntlab.interactiveFeatureLocator/build.properties new file mode 100644 index 0000000..255e23b --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + contexts.xml diff --git a/org.ntlab.interactiveFeatureLocator/contexts.xml b/org.ntlab.interactiveFeatureLocator/contexts.xml new file mode 100644 index 0000000..b3b18ae --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/contexts.xml @@ -0,0 +1,13 @@ + + + + This is the context help for the sample view with a table viewer. It was generated by a PDE template. + + + + + + + + + diff --git a/org.ntlab.interactiveFeatureLocator/icons/sample.gif b/org.ntlab.interactiveFeatureLocator/icons/sample.gif new file mode 100644 index 0000000..34fb3c9 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/icons/sample.gif Binary files differ diff --git a/org.ntlab.interactiveFeatureLocator/plugin.xml b/org.ntlab.interactiveFeatureLocator/plugin.xml new file mode 100644 index 0000000..5fd4757 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/plugin.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/Activator.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/Activator.java new file mode 100644 index 0000000..94b176d --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/Activator.java @@ -0,0 +1,61 @@ +package interactivefeaturelocator; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends AbstractUIPlugin { + + // The plug-in ID + public static final String PLUGIN_ID = "InteractiveFeatureLocation"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** + * The constructor + */ + public Activator() { + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) + */ + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + /* + * (non-Javadoc) + * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) + */ + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } + + /** + * Returns an image descriptor for the image file at the given + * plug-in relative path + * + * @param path the path + * @return the image descriptor + */ + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java new file mode 100644 index 0000000..1958f58 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java @@ -0,0 +1,385 @@ +package interactivefeaturelocator.actions; + +import interactivefeaturelocator.model.Feature; +import interactivefeaturelocator.model.DerivationManager; +import interactivefeaturelocator.model.Pattern; +import interactivefeaturelocator.model.ProgressMonitor; +import interactivefeaturelocator.test.Test; +import interactivefeaturelocator.views.InteractiveDerivationView; +import interactivefeaturelocator.views.TraceView; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; + +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jface.action.IAction; +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.graphics.Font; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.DirectoryDialog; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.FileDialog; +import org.eclipse.swt.widgets.Group; +import org.eclipse.swt.widgets.Label; +import org.eclipse.swt.widgets.List; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.IWorkbenchWindowActionDelegate; +import org.eclipse.ui.PartInitException; +import org.ntlab.trace.IMethodExecutionVisitor; +import org.ntlab.trace.MethodExecution; +import org.ntlab.trace.SoftwareReconnaissance; +import org.ntlab.trace.ThreadInstance; +import org.ntlab.trace.Trace; +import org.xml.sax.SAXException; + +public class InteractiveFeatureLocatorAction implements IWorkbenchWindowActionDelegate { + private IWorkbenchWindow window; + private Display display; + private String featureFolderPath = null; // �{�ԗp +// private String featureFolderPath = "C:\\Users\\student\\git\\org.ntlab.interactiveFeatureLocator\\InteractiveFeatureLocator\\Feature\\Feature1593375"; // �e�X�g�p + private String featureXMLPath = null; + private String otherfeatureTraceName = null; + // private int featureNo = 0; // �{�ԗp + private int featureNo = 1593375; // �e�X�g�p + private DerivationManager derivationManager; + private TraceView threadListView; + private IWorkbenchPage page; + private ProgressMonitor monitor; + + @Override + public void run(IAction action) { + // TODO Auto-generated method stub + + final int width = 700; + final int height = 600; + page = window.getActivePage(); + + final Shell shell = new Shell(SWT.SHELL_TRIM | SWT.APPLICATION_MODAL); + shell.setText("�@�\���o"); + display = shell.getDisplay(); + + // Shell�S�̂̃��C�A�E�g + shell.setLayout(new FormLayout()); + + // �㕔�̃e�L�X�g + Label topLabel = new Label(shell, SWT.NONE); + topLabel.setText("\n�֐S�̂���@�\�Ɋ֘A���郁�\�b�h�𒊏o����c�[���ł��B\n "); + topLabel.setBackground(display.getSystemColor(SWT.COLOR_WHITE)); + topLabel.setFont(new Font(display, "", 8, SWT.BOLD)); + FormData topLabelForm = new FormData(); + topLabelForm.top = new FormAttachment(0, 0); + topLabelForm.left = new FormAttachment(0, 0); + topLabelForm.right = new FormAttachment(100, 0); + topLabel.setLayoutData(topLabelForm); + + // �L�����Z���{�^�� + final Button canselButton = new Button(shell, SWT.PUSH); + canselButton.setText("�L�����Z��"); + canselButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent arg0) { + shell.dispose(); + } + }); + // �L�����Z���{�^���̃��C�A�E�g + FormData canselButtonForm = new FormData(); + canselButtonForm.bottom = new FormAttachment(100, -10); + canselButtonForm.right = new FormAttachment(100, -20); + canselButtonForm.left = new FormAttachment(100, -120); + canselButton.setLayoutData(canselButtonForm); + + // ��̓{�^�� + final Button analysisButton = new Button(shell, SWT.PUSH); + analysisButton.setText("���"); + // ��̓{�^���̃��C�A�E�g + FormData analysisButtonForm = new FormData(); + analysisButtonForm.bottom = new FormAttachment(100, -10); + analysisButtonForm.right = new FormAttachment(canselButton, -20); + analysisButtonForm.left = new FormAttachment(canselButton, -220); + analysisButton.setLayoutData(analysisButtonForm); + + // ���s�g���[�X���͕����̃��C�A�E�g + Composite bodyComposite = new Composite(shell, SWT.NONE); + bodyComposite.setLayout(new FormLayout()); + FormData bodyForm = new FormData(); + bodyForm.top = new FormAttachment(topLabel, 0); + bodyForm.left = new FormAttachment(0, 0); + bodyForm.right = new FormAttachment(100, 0); + bodyForm.bottom = new FormAttachment(canselButton, -10); + bodyComposite.setLayoutData(bodyForm); + + // �Ώۋ@�\�t�H���_�I�𕔕��̃��C�A�E�g + Group featureGroup = new Group(bodyComposite, SWT.NONE); + featureGroup.setLayout(new FormLayout()); + featureGroup.setText("�Ώۋ@�\�t�@�C��"); + FormData featureGroupForm = new FormData(); + featureGroupForm.top = new FormAttachment(topLabel, 5); + featureGroupForm.left = new FormAttachment(0, 10); + featureGroupForm.right = new FormAttachment(100, -10); + featureGroupForm.bottom = new FormAttachment(featureGroup, 100); + featureGroup.setLayoutData(featureGroupForm); + + // �e�L�X�g�̃��C�A�E�g + Label featureGroupLabel = new Label(featureGroup, SWT.NONE); + featureGroupLabel.setText("�Ώۋ@�\�Ɋւ���feature�t�@�C���Ȃǂ����ƒt�H���_��I�����Ă��������B"); + FormData labelForm = new FormData(); + labelForm.top = new FormAttachment(0, 10); + labelForm.left = new FormAttachment(0, 10); + labelForm.right = new FormAttachment(100, -100); + labelForm.bottom = new FormAttachment(featureGroupLabel, 30); + featureGroupLabel.setLayoutData(labelForm); + + // �t�H���_���\�� + Label folderNameLabel = new Label(featureGroup, SWT.BORDER); + folderNameLabel.setText(featureFolderPath); + FormData folderNameForm = new FormData(); + folderNameForm.top = new FormAttachment(featureGroupLabel, 0); + folderNameForm.left = new FormAttachment(0, 10); + folderNameForm.right = new FormAttachment(100, -100); + folderNameForm.bottom = new FormAttachment(folderNameLabel, 30); + folderNameLabel.setLayoutData(folderNameForm); + + // �t�H���_�I���{�^���̃��C�A�E�g + Button selectButton = new Button(featureGroup, SWT.PUSH); + selectButton.setText("�I��"); + selectButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + DirectoryDialog f = new DirectoryDialog(shell, SWT.OPEN); + f.setText("�Ώۋ@�\�̃t�H���_��I�����Ă��������B"); + if (f.open() == null) return; + featureFolderPath = f.getFilterPath(); + String[] fragments = featureFolderPath.split("\\\\"); + String[] fragments2 = fragments[fragments.length - 1].split("Feature"); + featureNo = Integer.parseInt(fragments2[fragments2.length - 1]); + folderNameLabel.setText(featureFolderPath); + System.out.println(featureFolderPath); + } + }); + FormData selectButtonForm = new FormData(); + selectButtonForm.top = new FormAttachment(0, 40); + selectButtonForm.left = new FormAttachment(folderNameLabel, 20); + selectButtonForm.right = new FormAttachment(100, -10); + selectButton.setLayoutData(selectButtonForm); + + // ���̑��̋@�\�̎��s�g���[�X + Group otherFeatureGroup = new Group(bodyComposite, SWT.NONE); + otherFeatureGroup.setLayout(new FormLayout()); + otherFeatureGroup.setText("���̑��̋@�\�̎��s�g���[�X"); + FormData otherFeatureGroupForm = new FormData(); + otherFeatureGroupForm.top = new FormAttachment(featureGroup, 5); + otherFeatureGroupForm.left = new FormAttachment(0, 10); + otherFeatureGroupForm.right = new FormAttachment(100, -10); + otherFeatureGroupForm.bottom = new FormAttachment(100, -5); + otherFeatureGroup.setLayoutData(otherFeatureGroupForm); + + // �e�L�X�g�̃��C�A�E�g + Label otherFeatureGroupLabel = new Label(otherFeatureGroup, SWT.NONE); + otherFeatureGroupLabel.setText("�Ώۋ@�\�ɉe����^������s�g���[�X��lj����Ă��������B"); + otherFeatureGroupLabel.setLayoutData(labelForm); + + // ���s�g���[�X�lj��{�^���̃��C�A�E�g + Button addButton = new Button(otherFeatureGroup, SWT.PUSH); + addButton.setText("�lj�"); + FormData addButtonForm = new FormData(); + addButtonForm.top = new FormAttachment(otherFeatureGroupLabel, 10); + addButtonForm.left = new FormAttachment(0, 10); + addButtonForm.right = new FormAttachment(addButton, 110); + addButton.setLayoutData(addButtonForm); + + // �폜�{�^���̃��C�A�E�g + Button deleteButton = new Button(otherFeatureGroup, SWT.PUSH); + deleteButton.setText("�폜"); + FormData deleteButtonForm = new FormData(); + deleteButtonForm.top = new FormAttachment(otherFeatureGroupLabel, 10); + deleteButtonForm.left = new FormAttachment(addButton, 10); + deleteButtonForm.right = new FormAttachment(deleteButton, 110); + deleteButton.setLayoutData(deleteButtonForm); + + // �S�č폜�{�^���̃��C�A�E�g + Button allDeleteButton = new Button(otherFeatureGroup, SWT.PUSH); + allDeleteButton.setText("�S�č폜"); + FormData allDeleteButtonForm = new FormData(); + allDeleteButtonForm.top = new FormAttachment(otherFeatureGroupLabel, 10); + allDeleteButtonForm.left = new FormAttachment(deleteButton, 10); + allDeleteButtonForm.right = new FormAttachment(allDeleteButton, 110); + allDeleteButton.setLayoutData(allDeleteButtonForm); + + // �lj����ꂽ���s�g���[�X���X�g�̃��C�A�E�g + List list = new List(otherFeatureGroup, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL); + FormData listForm = new FormData(); + listForm.top = new FormAttachment(addButton, 10); + listForm.left = new FormAttachment(0, 10); + listForm.right = new FormAttachment(100, -10); + listForm.bottom = new FormAttachment(100, -10); + list.setLayoutData(listForm); + + // �lj��{�^���������̏��� + addButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + FileDialog f = new FileDialog(shell, SWT.OPEN); + f.setText("�Ώۋ@�\�ɉe����^������s�g���[�X��I�����Ă��������B"); + if (f.open() == null) return; + otherfeatureTraceName = f.getFileName(); // �e�X�g�p + // otherFeatureGroupLabel.setText(otherfeatureTraceName); // �{�ԗp + list.add(otherfeatureTraceName); + } + }); + + // �폜�{�^���������̏��� + deleteButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent event) { + try { + list.remove(list.getSelectionIndex()); + } catch (IllegalArgumentException e) { + MessageDialog.openError(shell, "�G���[", + "�폜������s�g���[�X��I�����Ă��������B"); + } + } + }); + + // �S�č폜�{�^���������̏��� + allDeleteButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + if (list.getItemCount() != 0) { + boolean ok = MessageDialog.openConfirm(shell, "�m�F", + "���̑��̎��s�g���[�X��S�č폜���Ă�낵���ł����H"); + if (ok) { + list.removeAll(); + } + } + } + }); + + // ��̓{�^���������̏��� + analysisButton.addSelectionListener(new SelectionAdapter() { + + public void widgetSelected(SelectionEvent arg0) { + featureXMLPath = featureFolderPath + "\\feature" + featureNo + ".xml"; + File featureFile = new File(featureXMLPath); + // feature.xml�����݂��邩�̔��� + if (featureFile.exists()) { + boolean ok = MessageDialog.openConfirm(shell, "�m�F", + "�Ώۋ@�\�t�H���_ : " + folderNameLabel.getText() + "\n��͂��n�߂܂��B"); + if (ok) { + threadListView = TraceView.theInstance; + if (threadListView == null) { + try { + page.showView(TraceView.ID, null, IWorkbenchPage.VIEW_VISIBLE); + System.out.println("ThreadListView���J���܂��B"); + } catch (PartInitException e) { + page.findView(TraceView.ID); + } + } + InteractiveDerivationView.theInstance.reset(); + shell.dispose(); + try { + Feature feature = new Feature(featureFolderPath); + derivationManager = new DerivationManager(feature); + derivationManager.firstInference(); + + threadListView.setInferanceManager(derivationManager); + threadListView.updateViewer(); + } catch (ParserConfigurationException | SAXException | IOException e2) { + e2.printStackTrace(); + } + } + } else { + MessageDialog.openError(shell, "�G���[", + "�Ώۋ@�\�t�H���_��I�����Ă��������B(feature.xml�����ƒt�H���_��I�����Ă��������B)"); + } + } + }); + + // ���s�g���[�X���̓V�F���̕\������ + // shell.pack(); + shell.setSize(width, height); + shell.open(); + + while (!shell.isDisposed()) { + if (!display.readAndDispatch()) { + display.sleep(); + } + } + + } + + @Override + public void selectionChanged(IAction action, ISelection selection) { + // TODO Auto-generated method stub + + } + + @Override + public void dispose() { + // TODO Auto-generated method stub + + } + + @Override + public void init(IWorkbenchWindow window) { + // TODO Auto-generated method stub + this.window = window; + } + + // scenario.xml�����Ƃɉ�� + public DerivationManager doAnalyze(Feature feature) { + System.out.println("��͊J�n"); +// monitor = new ProgressMonitor(window.getShell()); +// monitor.getMonitor().worked(1); + + DerivationManager im = new DerivationManager(feature); + + // �i���_�C�A���O + im.firstInference(); +// HashMap> threadsWithSRMethodsMap = new HashMap<>(); // SR���ʂ��܂�Trace�Ƃ���Threads +// HashMap> threadToSRMethods = new HashMap<>(); // SR���ʂ��܂�Thread�Ƃ���Methods + +// selectMethodView.setThreadToMethods(threadToSRMethods); + + return im; + } + + public ArrayList getFolder(File[] files) { + ArrayList dir = new ArrayList<>(); + for (File f : files) { + if (f.isDirectory()) { + dir.add(f); + } + } + return dir; + } + + public ArrayList getFile(File[] files) { + ArrayList fil = new ArrayList<>(); + for (File f : files) { + if (f.isFile()) { + fil.add(f); + } + } + return fil; + } + + public ProgressMonitor getMonitor() { + return monitor; + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphConnection.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphConnection.java new file mode 100644 index 0000000..791da18 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphConnection.java @@ -0,0 +1,15 @@ +package interactivefeaturelocator.model; + +import org.eclipse.zest.core.widgets.Graph; +import org.eclipse.zest.core.widgets.GraphConnection; +import org.eclipse.zest.core.widgets.GraphNode; + +public class CallTreeGraphConnection extends GraphConnection { + + public CallTreeGraphConnection(Graph graphModel, int style, GraphNode source, + GraphNode destination) { + super(graphModel, style, source, destination); + // TODO Auto-generated constructor stub + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphLayoutAlgorithm.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphLayoutAlgorithm.java new file mode 100644 index 0000000..2be0959 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphLayoutAlgorithm.java @@ -0,0 +1,11 @@ +package interactivefeaturelocator.model; + +import org.eclipse.zest.layouts.algorithms.TreeLayoutAlgorithm; + +public class CallTreeGraphLayoutAlgorithm extends TreeLayoutAlgorithm { + + public CallTreeGraphLayoutAlgorithm(int styles) { + // TODO Auto-generated constructor stub + super(styles); + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java new file mode 100644 index 0000000..ed608bf --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java @@ -0,0 +1,40 @@ +package interactivefeaturelocator.model; + +import interactivefeaturelocator.test.Test; + +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.zest.core.widgets.GraphNode; +import org.eclipse.zest.core.widgets.IContainer; +import org.ntlab.trace.MethodExecution; + +public class CallTreeGraphNode extends GraphNode { + private boolean current = false; + private boolean focus = false; + + public CallTreeGraphNode(IContainer graphModel, int style, String text) { + super(graphModel, style, text); + // TODO Auto-generated constructor stub + } + + public CallTreeGraphNode(IContainer graphModel, int style, MethodExecution method) { + super(graphModel, style, method.getMethodName(), method); + setSize(20.0, 5.0); + } + + public void highlight() { + this.focus = true; + try { + Test test = new Test(); + test.openEditor(this.getMethod()); + } catch (JavaModelException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + public MethodExecution getMethod() { + return (MethodExecution)this.getData(); + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java new file mode 100644 index 0000000..3133624 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java @@ -0,0 +1,45 @@ +package interactivefeaturelocator.model; + +import java.util.ArrayList; +import java.util.HashSet; + +import org.ntlab.trace.MethodExecution; + +public class DerivationManager { + private ArrayList units = new ArrayList<>(); + private HashSet results = new HashSet<>(); + + public DerivationManager(Feature feature) { + for (Pattern pattern : feature.getPatterns()) { + units.add(new DerivationUnit(pattern)); + } + } + + public DerivationUnit getInferenceUnit(int index) { + return units.get(index); + } + + public int getInferenceUnitCount() { + return units.size(); + } + + public DerivationResults nextInference(DerivationUnit unit, MethodProperty property) { + return unit.nextInference(property); + } + + public HashSet getResults() { + return results; + } + + public HashSet firstInference() { + for (DerivationUnit unit : units) { +// HashSet irs = unit.firstInference(); +// for (InferenceResults ir : irs) { +// results.add(ir); +// } + results.add(unit.firstInference()); + } + return results; + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationResults.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationResults.java new file mode 100644 index 0000000..e8ce3fb --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationResults.java @@ -0,0 +1,38 @@ +package interactivefeaturelocator.model; + +import java.util.ArrayList; +import java.util.HashSet; + +import org.eclipse.jdt.core.IMethod; +import org.ntlab.trace.MethodExecution; + +public class DerivationResults { + + HashSet methodSignatures = new HashSet<>(); + + public ArrayList getCreatedSessions() { + return null; + } + + public ArrayList getCompletedSessions() { + return null; + } + + public ArrayList getModifiedSessions() { + return null; + } + + public HashSet getMethodSignatures() { + return this.methodSignatures; + } + + public void addMethodSignatures(HashSet methodSignatures) { + this.methodSignatures.addAll(methodSignatures); + } + + public void addMethodSignature(String methodSignature) { + if (methodSignature != null) { + this.methodSignatures.add(methodSignature); + } + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationSession.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationSession.java new file mode 100644 index 0000000..d3d15ec --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationSession.java @@ -0,0 +1,87 @@ +package interactivefeaturelocator.model; + +import java.util.HashSet; +import java.util.Set; + +import org.ntlab.trace.MethodExecution; +import org.ntlab.trace.ThreadInstance; + +public class DerivationSession implements IMethodListener { + private ThreadInstance currentThreadInstance; + private MethodExecution currentMethodExecution; + private Set reflectedMethodExecutions; //���[�U�̔��f�𔽉f�������\�b�h���s�̏W�� + Set unreflectedExecutions = new HashSet<>(); //���[�U�̔��f�����f�ł��Ă��Ȃ����\�b�h���s�̏W�� + + public DerivationSession(MethodExecution seed) { + currentMethodExecution = seed; + } + + public MethodExecution getCurrentMethodExecution() { + return currentMethodExecution; + } + + /* + * �J�����g���\�b�h���s�̃��\�b�h�̑���(�V�K�lj�, �C������, �C���Ȃ�)����ӂɒ�߂�. + * @param property ��ӂɒ�߂�ꂽ���\�b�h�̑��� + * @return property����ɑ�������ӂɒ�߂�ꂽ�J�����g���\�b�h���s�̃��\�b�h�̑S�Ẵ��\�b�h���s + */ + public Set decideMethodProperty(MethodProperty property) { + return ((MethodInfo)currentMethodExecution.getAugmentation()).discardOtherProperties(property); + } + + public void moveCurrentMethodExecution(MethodExecution me) { + if (me == null) return; + MethodExecution parent = currentMethodExecution.getParent(); + if (parent != null) { + ((MethodInfo)parent.getAugmentation()).removeMethodListener(this); + } + ((MethodInfo)currentMethodExecution.getAugmentation()).removeMethodListener(this); + for (MethodExecution child : currentMethodExecution.getChildren()) { + ((MethodInfo)child.getAugmentation()).removeMethodListener(this); + } + this.currentMethodExecution = me; + parent = currentMethodExecution.getParent(); + if (parent != null) { + ((MethodInfo)parent.getAugmentation()).addMethodListener(this); + } + ((MethodInfo)currentMethodExecution.getAugmentation()).addMethodListener(this); + for (MethodExecution child : currentMethodExecution.getChildren()) { + ((MethodInfo)child.getAugmentation()).addMethodListener(this); + } + } + + @Override + public void notify(MethodInfo changedMethod) { + reflectedMethodExecutions = new HashSet<>(); + Set newProperties = changedMethod.getProperties(); + if (currentMethodExecution.getAugmentation() == changedMethod) { + // ���_ (���ł��邩�J�����g���ǂ����Ɉڂ����𔻒f, �e�����󂯂郁�\�b�h�͑��݂��Ȃ���) + +// moveCurrentMethodExecution(null); + reflectedMethodExecutions.add(currentMethodExecution); + } else if (currentMethodExecution.getCallerMethodExecution().getAugmentation() == changedMethod + && newProperties.size() == 1 && newProperties.contains(MethodProperty.unmodified)) { + // ����9�K�p + unreflectedExecutions = ((MethodInfo)currentMethodExecution.getAugmentation()).discardProperty(MethodProperty.created); + reflectedMethodExecutions.add(currentMethodExecution.getParent()); + } else { + for (MethodExecution me : currentMethodExecution.getChildren()) { + if (me.getAugmentation() == changedMethod + && newProperties.size() == 1 && newProperties.contains(MethodProperty.created)) { + // ����9�K�p + unreflectedExecutions.addAll(((MethodInfo)currentMethodExecution.getAugmentation()).discardProperty(MethodProperty.unmodified)); + reflectedMethodExecutions.add(me); + } + } + + } + } + + public Set getReflectedMethodExecutions() { + return reflectedMethodExecutions; + } + + public Set getUnreflectedMethodExecutions() { + return unreflectedExecutions; + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java new file mode 100644 index 0000000..3ad6675 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java @@ -0,0 +1,94 @@ +package interactivefeaturelocator.model; + +//import interactivefeaturelocator.layout.CallTreeLayout; +import interactivefeaturelocator.test.Test; + +import java.util.ArrayList; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.JavaModelException; +import org.ntlab.trace.MethodExecution; +import org.ntlab.trace.Trace; + +public class DerivationUnit { + private Trace plusTrace = null; + private Trace minusTrace = null; + private ArrayList marks = new ArrayList<>(); + private ArrayList sessions = null; + private DerivationSession activeSession = null; +// private CallTreeLayout callTreeLayout = null; + private DerivationResults result = new DerivationResults(); + + public DerivationUnit(Pattern pattern) { + this.plusTrace = new Trace(pattern.getPlusTraceFilePath()); + this.minusTrace = new Trace(pattern.getMinusTraceFilePath()); + this.marks = readMarkFile(pattern.getMarkFilePath()); +// this.callTreeLayout = new CallTreeLayout(); + } + + public Trace getPlusTrace() { + return plusTrace; + } + public Trace getMinusTrace() { + return minusTrace; + } + + public DerivationSession getActiveSession() { + return activeSession; + } + + public DerivationSession getSession(int index) { + return sessions.get(index); + } + + public int getSessionCount() { + return sessions.size(); + } + +// public CallTreeLayout getCallTree() { +// return callTreeLayout; +// } + + public DerivationResults nextInference(MethodProperty property) { + Set unreflectedExecutions = activeSession.decideMethodProperty(property); + // �Z�b�V��������鏈�� + for (MethodExecution unreflectedExecution : unreflectedExecutions) { + sessions.add(new DerivationSession(unreflectedExecution)); + } + return null; + } + + public DerivationResults firstInference() { + HashSet minus = minusTrace.getAllMethodSignatures(); + for (String plus : plusTrace.getAllMethodSignatures()) { + if (!minus.contains(plus)) { + System.out.println(plus); + result.addMethodSignature(plus); +// plusTrace.getMethodExecutions(plus); + } + } + return result; + } + + private ArrayList readMarkFile(String path) { + ArrayList marks = new ArrayList<>(); + return marks; + } + + public HashSet getMethodExecutions() { + HashSet methodExecutions = new HashSet<>(); + for (String methodSignature : result.getMethodSignatures()) { + methodExecutions.addAll(plusTrace.getMethodExecutions(methodSignature)); + } + HashSet testExecutions = new HashSet<>(); + for (MethodExecution execution : methodExecutions) { + testExecutions.add(execution); + if (testExecutions.size() >= 10) break; + } +// return methodExecutions; + return testExecutions; + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java new file mode 100644 index 0000000..d432194 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java @@ -0,0 +1,69 @@ + package interactivefeaturelocator.model; + + import java.io.File; + import java.io.IOException; + import java.util.ArrayList; + + import javax.xml.parsers.DocumentBuilder; + import javax.xml.parsers.DocumentBuilderFactory; + import javax.xml.parsers.ParserConfigurationException; + + import org.ntlab.trace.Trace; + import org.w3c.dom.Document; + import org.w3c.dom.Element; + import org.w3c.dom.Node; + import org.w3c.dom.NodeList; + import org.w3c.dom.views.DocumentView; + import org.xml.sax.SAXException; + + public class Feature { + + private ArrayList patterns = new ArrayList<>(); + private File featureXml; + private String description; + + public Feature(String featurePath) throws ParserConfigurationException, SAXException, IOException { + File featureFolder = new File(featurePath); + File[] files = featureFolder.listFiles(); + + // Feature�N���X�̃C���X�^���X��patterns��feature.xml���i�[ + for (File f : files) { + if (f.isDirectory()) { + if (f.getName().startsWith("Pattern")) { + patterns.add(new Pattern(f.getPath())); + } + } + if (f.isFile()) { + if (f.getName().endsWith("xml")) { + featureXml = f; + } + } + } + + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(featureXml); + + Element root = document.getDocumentElement(); + //���[�g�v�f�̃m�[�h�����擾���� + System.out.println("�m�[�h���F" +root.getNodeName()); + + //���[�g�v�f�̑������擾���� + System.out.println("���[�g�v�f�̑��� name:" + root.getAttribute("name") + ", description: " + root.getAttribute("description")); + description = root.getAttribute("description"); + System.out.println("------------------"); + + } + + public File getFeatureXml() { + return featureXml; + } + + public ArrayList getPatterns() { + return patterns; + } + + public String getDescription() { + return description; + } + } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/IMethodListener.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/IMethodListener.java new file mode 100644 index 0000000..12e702d --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/IMethodListener.java @@ -0,0 +1,5 @@ +package interactivefeaturelocator.model; + +public interface IMethodListener { + public void notify(MethodInfo method); +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Mark.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Mark.java new file mode 100644 index 0000000..d7b0eb5 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Mark.java @@ -0,0 +1,5 @@ +package interactivefeaturelocator.model; + +public class Mark { + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/MethodInfo.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/MethodInfo.java new file mode 100644 index 0000000..38a8134 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/MethodInfo.java @@ -0,0 +1,69 @@ +package interactivefeaturelocator.model; + +import java.lang.reflect.Array; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.ntlab.trace.AugmentationInfo; +import org.ntlab.trace.MethodExecution; + +public class MethodInfo extends AugmentationInfo { + private Set executions = new HashSet<>(); + private Set properties = new HashSet<>(); + private ArrayList listeners = new ArrayList<>(); + + public MethodInfo() { + // TODO Auto-generated constructor stub + super(); + for (MethodProperty property : MethodProperty.values()) { + properties.add(property); + } +// properties.addAll(Arrays.asList(MethodProperty.values())); + } + + public void addMethodListener(IMethodListener listener) { + listeners.add(listener); + } + + public void removeMethodListener(IMethodListener listener) { + listeners.remove(listener); + } + + public Set discardProperty(MethodProperty property) { + Set unreflectedExecutions = (Set)((HashSet)executions).clone(); + if (properties.contains(property)) { + properties.remove(property); + for (IMethodListener listener : listeners) { + listener.notify(this); + unreflectedExecutions.removeAll(((DerivationSession)listener).getReflectedMethodExecutions()); + unreflectedExecutions.addAll(((DerivationSession)listener).getUnreflectedMethodExecutions()); + } + } + return unreflectedExecutions; + } + + public Set discardOtherProperties(MethodProperty property) { + Set unreflectedExecutions = (Set)((HashSet)executions).clone(); + if (properties.size() == 0 || (properties.contains(property) && properties.size() == 1)) { + return unreflectedExecutions; + } +// for (MethodProperty prop : properties) { + for (MethodProperty prop : MethodProperty.values()) { + if (prop != property) { + properties.remove(prop); + } + } + for (IMethodListener listener : listeners) { + listener.notify(this); + unreflectedExecutions.removeAll(((DerivationSession)listener).getReflectedMethodExecutions()); + unreflectedExecutions.addAll(((DerivationSession)listener).getUnreflectedMethodExecutions()); + } + return unreflectedExecutions; + } + + public Set getProperties() { + return properties; + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/MethodProperty.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/MethodProperty.java new file mode 100644 index 0000000..a36e226 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/MethodProperty.java @@ -0,0 +1,7 @@ +package interactivefeaturelocator.model; + +public enum MethodProperty { + created, + modified, + unmodified; +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Pattern.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Pattern.java new file mode 100644 index 0000000..163ac81 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Pattern.java @@ -0,0 +1,115 @@ +package interactivefeaturelocator.model; + +import java.io.File; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.ntlab.trace.Trace; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.xml.sax.SAXException; + +public class Pattern { + + private String patternFolderPath; + private String plusTraceFilePath; + private String minusTraceFilePath; + private File scenarioXml; + private String markFilePath; + + public Pattern(String patternPath) throws ParserConfigurationException, SAXException, IOException { + this.patternFolderPath = patternPath; + File patternFolder = new File(patternFolderPath); + File[] files = patternFolder.listFiles(); + + // Feature�N���X�̃C���X�^���X��patterns��feature.xml���i�[ + for (File f : files) { + if (f.isFile()) { + if (f.getName().endsWith("xml")) { + scenarioXml = f; + } + } + } + domRead(); + } + + public String getPlusTraceFilePath() { + return plusTraceFilePath; + } + + public String getMinusTraceFilePath() { + return minusTraceFilePath; + } + + public File getScenarioXml() { + return scenarioXml; + } + + public String getMarkFilePath() { + return markFilePath; + } + + private void domRead() throws ParserConfigurationException, SAXException, IOException { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + DocumentBuilder documentBuilder = factory.newDocumentBuilder(); + Document document = documentBuilder.parse(scenarioXml); + + Element root = document.getDocumentElement(); + + //���[�g�v�f�̃m�[�h�����擾���� + System.out.println("�m�[�h���F" +root.getNodeName()); + + //���[�g�v�f�̑������擾���� + System.out.println("���[�g�v�f�̑����F" + root.getAttribute("name")); + + //���[�g�v�f�̎q�m�[�h���擾���� + NodeList rootChildren = root.getChildNodes(); + + System.out.println("�q�v�f�̐��F" + rootChildren.getLength()); + System.out.println("------------------"); + + for(int i=0; i < rootChildren.getLength(); i++) { + Node node = rootChildren.item(i); + + if (node.getNodeType() == Node.ELEMENT_NODE) { + Element element = (Element)node; + if (element.getNodeName().equals("traces")) { + NodeList tracesChildren = node.getChildNodes(); + + for (int j=0; j < tracesChildren.getLength(); j++) { + Node tracesNode = tracesChildren.item(j); + + if (tracesNode.getNodeType() == Node.ELEMENT_NODE) { + Element traceElement = (Element)tracesNode; + if (traceElement.getNodeName().equals("trace")) { + + if (traceElement.getAttribute("attr").equals("plus")) { + System.out.println("--trace(plus)--"); + this.plusTraceFilePath = patternFolderPath + "\\Plus\\" + traceElement.getAttribute("traceFile"); + System.out.println("�@PlusTracePath:" + plusTraceFilePath); + this.markFilePath = patternFolderPath + "\\Plus\\" + traceElement.getAttribute("markFile"); + System.out.println("�@MarkFilePath:" + markFilePath); + } else if (traceElement.getAttribute("attr").equals("minus")) { + System.out.println("--trace(minus)--"); + this.minusTraceFilePath = patternFolderPath + "\\Minus\\" + traceElement.getAttribute("traceFile"); + System.out.println("�@MinusTracePath:" + minusTraceFilePath); + } + } + + + } + } + System.out.println("------------------"); + } + } + + + } + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/ProgressMonitor.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/ProgressMonitor.java new file mode 100644 index 0000000..d040d4d --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/ProgressMonitor.java @@ -0,0 +1,79 @@ +package interactivefeaturelocator.model; + +import java.lang.reflect.InvocationTargetException; + +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; +import org.eclipse.jface.operation.IRunnableWithProgress; +import org.eclipse.swt.browser.ProgressEvent; +import org.eclipse.swt.browser.ProgressListener; +import org.eclipse.swt.widgets.Shell; + +public class ProgressMonitor { + + private ProgressMonitorDialog dialog; +// private IProgressMonitor monitor; + private IProgressMonitor pMonitor; + + public ProgressMonitor() { + } + + public ProgressMonitor(Shell parent) { + dialog = new ProgressMonitorDialog(parent); + try { + dialog.run(true, true, new IRunnableWithProgress() { + private ProgressListener listener; + @Override + public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { + monitor.beginTask("��͒�...", 10); +// listener = new ProgressListener() { +// +// @Override +// public void completed(ProgressEvent event) { +// // TODO Auto-generated method stub +// System.out.println("�����I"); +// } +// +// @Override +// public void changed(ProgressEvent event) { +// // TODO Auto-generated method stub +//// monitor.worked(1); +// } +// }; +// while (monitor.) { +// +// } +// setMonitor(monitor); +// for (int i = 0; i < 10; i++) { +// if (monitor.isCanceled()) { +// throw new InterruptedException("Cancel has been requested."); +// } else { +// monitor.subTask((i + 1) + "���"); +// Thread.sleep(1000); +// monitor.worked(1); +// } +// } + } + }); + } catch (InvocationTargetException | InterruptedException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +// public IProgressMonitor getMonitor() { +// return monitor; +// } +// +// public void setMonitor(IProgressMonitor monitor) { +// this.monitor = monitor; +// } + + public IProgressMonitor getMonitor() { + return pMonitor; + } + + public void setMonitor(IProgressMonitor monitor) { + this.pMonitor = monitor; + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/TreeModel.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/TreeModel.java new file mode 100644 index 0000000..24e6010 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/TreeModel.java @@ -0,0 +1,31 @@ +package interactivefeaturelocator.model; + +public class TreeModel { + private String name = null; + private int type = 0; + + public TreeModel(String name, int type) { + this.name = name; + this.type = type; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public int getType() { + return type; + } + + public void setType(int type) { + this.type = type; + } + + public String toString() { + return this.name; + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/perspective/IFLPerspectiveFactory.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/perspective/IFLPerspectiveFactory.java new file mode 100644 index 0000000..d8dadc7 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/perspective/IFLPerspectiveFactory.java @@ -0,0 +1,24 @@ +package interactivefeaturelocator.perspective; + +import interactivefeaturelocator.views.InteractiveDerivationView; +import interactivefeaturelocator.views.TraceView; + +import org.eclipse.ui.IFolderLayout; +import org.eclipse.ui.IPageLayout; +import org.eclipse.ui.IPerspectiveFactory; + +public class IFLPerspectiveFactory implements IPerspectiveFactory { + @Override + public void createInitialLayout(IPageLayout layout) { + // TODO Auto-generated method stub + String eArea = layout.getEditorArea(); + System.out.println(eArea); + + IFolderLayout left = layout.createFolder("left_folder", IPageLayout.LEFT, (float)0.2f, eArea); + left.addView(TraceView.ID); + + IFolderLayout top = layout.createFolder("top_folder", IPageLayout.TOP, (float)0.7f, eArea); + top.addView(InteractiveDerivationView.ID); + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Constraint.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Constraint.java new file mode 100644 index 0000000..8afcc53 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Constraint.java @@ -0,0 +1,64 @@ +package interactivefeaturelocator.test; + +import java.util.HashSet; + +import org.ntlab.trace.Trace; + +public class Constraint { + + public void proposition1() { + + } + + public void proposition2() { + + } + + public void proposition3() { + + } + + public void assumption4() { + + } + + public void proposition5() { + + } + + public HashSet assumption6(Trace plus, Trace minus) { + HashSet plusMethodSignatures = plus.getAllMethodSignatures(); + HashSet minusMethodSignatures = minus.getAllMethodSignatures(); + HashSet difference = plusMethodSignatures; + plusMethodSignatures.removeAll(minusMethodSignatures); + return difference; + } + + public void assumption7() { + + } + + public void proposition8() { + + } + + public void proposition9() { + + } + + public void assumption10() { + + } + + public void assumption11() { + + } + + public void assumption12() { + + } + + public void assumption13() { + + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Main.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Main.java new file mode 100644 index 0000000..d2228f9 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Main.java @@ -0,0 +1,71 @@ +package interactivefeaturelocator.test; + +import interactivefeaturelocator.model.Feature; +import interactivefeaturelocator.model.DerivationManager; +import interactivefeaturelocator.model.DerivationUnit; +import interactivefeaturelocator.model.Pattern; + + + + +import java.io.File; +import java.io.IOException; +import java.util.ArrayList; + +import javax.xml.parsers.ParserConfigurationException; + +import org.eclipse.core.commands.ITypedParameter; +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.dom.AST; +import org.eclipse.jdt.core.dom.ASTParser; +import org.eclipse.jdt.internal.compiler.ClassFile; +import org.eclipse.jdt.internal.core.builder.SourceFile; +import org.eclipse.swt.graphics.Path; +import org.ntlab.trace.Trace; +import org.xml.sax.SAXException; + +public class Main { + private static String featureFolderPath = "C:\\Users\\student\\Desktop\\fujioka\\workspace_FeatureLocation\\InteractiveFeatureLocator\\Feature\\Feature1593375"; + private static DerivationManager im = null; + private static DerivationUnit unit = null; + + public static void main(String[] args) { + // TODO Auto-generated method stub + System.out.println("Test"); +// String dir = System.getProperty("user.dir"); +// System.out.println(dir); +// ClassFile classFile = new ClassFil +// ASTParser astParser = ASTParser.newParser(AST.JLS8); +// astParser.setResolveBindings(true); +// astParser.setEnvironment(Envs.get, sourcepathEntries, encodings, includeRunningVMBootclasspath); + IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); + IProject[] projects = root.getProjects(); +// IJavaProject javaProject = JavaCore.create(project); + + Trace plusTrace; + Trace minusTrace; + Constraint constraint = new Constraint(); + try { + Feature feature = new Feature(featureFolderPath); + for (Pattern pattern : feature.getPatterns()) { + unit = new DerivationUnit(pattern); + } + plusTrace = unit.getPlusTrace(); + minusTrace = unit.getMinusTrace(); + for (String methodSignature : constraint.assumption6(plusTrace, minusTrace)){ + System.out.println(methodSignature); + } + + } catch (ParserConfigurationException | SAXException | IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java new file mode 100644 index 0000000..3c10c28 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java @@ -0,0 +1,104 @@ +package interactivefeaturelocator.test; + +import java.io.File; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.resources.IWorkspaceRoot; +import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.jdt.core.IJavaElement; +import org.eclipse.jdt.core.IJavaProject; +import org.eclipse.jdt.core.IMethod; +import org.eclipse.jdt.core.IType; +import org.eclipse.jdt.core.JavaCore; +import org.eclipse.jdt.core.JavaModelException; +import org.eclipse.jface.viewers.IDecoration; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.ide.IDE; +import org.eclipse.ui.part.FileEditorInput; +import org.ntlab.trace.MethodExecution; + +public class Test { + private IJavaProject javaProject; + private IWorkspaceRoot root; + + public Test() throws JavaModelException { + root = ResourcesPlugin.getWorkspace().getRoot(); + IProject project = root.getProject("jedit"); + javaProject = JavaCore.create(project); + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + page.getActiveEditor(); +// System.out.println(javaProject.getChildren()[0].getElementName()); +// IFile file = new IFile("C:\\Users\\student\\Desktop\\fujioka\\workspace_FeatureLocation\\InteractiveFeatureLocator\\src\\interactivefeaturelocator\\test\\Test.java"); +// page.openEditor(input, editorId); +// IType type = javaProject.findType("org.gjt.sp.jedit.gui.LogViewer$MyFilteredListModel"); +// System.out.println(type.getDeclaringType().getElementName()); +// if (type.isClass()) { +// System.out.println("Class!"); +// IMethod[] methods = type.getMethods(); +// for (IMethod method : methods) { +// System.out.println(method.getElementName()); +//// method.get +// } +// } else { +// System.out.println("Not Class"); +// } + } + + public IMethod m(String methodSigniture) throws JavaModelException { + String[] fragments = methodSigniture.split("\\s", 3); + String signature = fragments[fragments.length-1]; + int n = signature.split("\\(")[0].lastIndexOf("."); + String classSignature = signature.substring(0, n); + String methodData = signature.substring(n+1); + String[] fragments2 = methodData.split("\\("); + String methodName = fragments2[0]; +// int m = fragments2[1].indexOf("\\)"); + String s = fragments2[1].substring(0, fragments2[1].length()-1); + String[] parameters = s.split(","); +// String[] parameters = fragments2[1].substring(0, fragments2[1].indexOf("\\)")).split(","); + IType type = javaProject.findType(classSignature); +// System.out.println(type.getDeclaringType().getElementName()); +// if (type.isClass()) { +// System.out.println("Class!"); +// IMethod[] methods = type.getMethods(); +// for (IMethod method : methods) { +// System.out.println(method.getElementName()); +//// method.get +// } +// } else { +// System.out.println("Not Class"); +// } +// System.out.println("type: " + type.getElementName()); + if (type.getMethods().length != 0) { + IMethod method = type.getMethod(methodName, parameters); + return method; + } + return null; + } + + public void openEditor(MethodExecution me) { + String signature = me.getSignature(); + System.out.println("Signature: " + signature); + IPath path = new Path("/jedit/jEdit/org/gjt/sp/jedit/GUIUtilities.java"); + IFile file = root.getFile(path); + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); + try { + IDE.openEditor(page, file); + System.out.println("open: " + file.getName()); + } catch (PartInitException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java new file mode 100644 index 0000000..2d68300 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/CallTreeGraph.java @@ -0,0 +1,72 @@ +package interactivefeaturelocator.views; + +import interactivefeaturelocator.model.DerivationSession; +import interactivefeaturelocator.model.CallTreeGraphConnection; +import interactivefeaturelocator.model.CallTreeGraphLayoutAlgorithm; +import interactivefeaturelocator.model.CallTreeGraphLayoutAlgorithm; +import interactivefeaturelocator.model.CallTreeGraphNode; + +import org.eclipse.core.resources.IFile; +import org.eclipse.swt.SWT; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IWorkbench; +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.PlatformUI; +import org.eclipse.ui.internal.WorkbenchWindow; +import org.eclipse.zest.core.widgets.Graph; +import org.eclipse.zest.core.widgets.IContainer; +import org.eclipse.zest.core.widgets.ZestStyles; +import org.ntlab.trace.MethodExecution; + +public class CallTreeGraph extends Graph { + private CallTreeGraphNode currentNode; + + public CallTreeGraph(Composite parent, int style) { + super(parent, style); + // TODO Auto-generated constructor stub + } + + public void createGraph(DerivationSession session) { +// CallTreeGraphNode n1 = new CallTreeGraphNode(this, SWT.NONE, "�m�[�h1"); +// CallTreeGraphNode n2 = new CallTreeGraphNode(this, SWT.NONE, "�m�[�h2"); +// CallTreeGraphNode n3 = new CallTreeGraphNode(this, SWT.NONE, "�m�[�h3"); + + CallTreeGraphNode node = createTreeGraphNode(this, SWT.NONE, session.getCurrentMethodExecution()); + setCurrentNode(node); +// new CallTreeGraphConnection(this, ZestStyles.CONNECTIONS_DIRECTED, n1, n2); +// new CallTreeGraphConnection(this, SWT.NONE, n2, n3); + this.setLayoutAlgorithm(new CallTreeGraphLayoutAlgorithm(ZestStyles.NODES_NO_LAYOUT_RESIZE), true); + } + + public CallTreeGraphNode createTreeGraphNode(IContainer graph, int style, MethodExecution method) { + CallTreeGraphNode node = new CallTreeGraphNode(this, SWT.NONE, method); + applyLayout(); + return node; + } + + public CallTreeGraphNode createCallerTreeGraphNode(CallTreeGraphNode calleeNode) { + MethodExecution parent = calleeNode.getMethod().getCallerMethodExecution(); + if (parent == null) return null; + CallTreeGraphNode callerNode = createTreeGraphNode(this, SWT.NONE, parent); + setCurrentNode(callerNode); + new CallTreeGraphConnection(this, ZestStyles.CONNECTIONS_DIRECTED, callerNode, calleeNode); + applyLayout(); + return callerNode; + } + + public void openFile() { + IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); +// IEditorPart editorPart = page.openEditor + + } + + public CallTreeGraphNode getCurrentNode() { + return currentNode; + } + public void setCurrentNode(CallTreeGraphNode currentNode) { + this.currentNode = currentNode; + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/DataflowComposite.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/DataflowComposite.java new file mode 100644 index 0000000..1ba3e46 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/DataflowComposite.java @@ -0,0 +1,135 @@ +package interactivefeaturelocator.views; + +import interactivefeaturelocator.model.MethodInfo; +import interactivefeaturelocator.model.MethodProperty; +import java.util.ArrayList; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +import org.eclipse.swt.events.SelectionListener; +import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.layout.FormAttachment; +import org.eclipse.swt.layout.FormData; +import org.eclipse.swt.layout.FormLayout; +import org.eclipse.swt.widgets.Button; +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Group; +import org.ntlab.trace.MethodExecution; + +public class DataflowComposite extends Composite { + MethodExecution me; +// Group radioGroup; + Combo propertyCombo; + Button nextButton; + Button currentRadioButton = null; + + + public DataflowComposite(Composite parent, int style, MethodExecution me) { + super(parent, style); + // TODO Auto-generated constructor stub + this.me = me; + setLayout(new FormLayout()); + + propertyCombo = new Combo(this, SWT.READ_ONLY); + FormData comboData = new FormData(); + comboData.top = new FormAttachment(0, 10); + comboData.right = new FormAttachment(100, -10); + propertyCombo.setLayoutData(comboData); + updateCombo(me); + +// radioGroup = new Group(this, SWT.NONE); +// FormData groupData = new FormData(); +// groupData.left = new FormAttachment(0, 0); +// groupData.right = new FormAttachment(propertyCombo, -10); +// groupData.bottom = new FormAttachment(100, 0); +// radioGroup.setLayoutData(groupData); + updateExSelectionButton(me); + + nextButton = new Button(this, SWT.NONE); + FormData nextButtonData = new FormData(); + nextButtonData.right = new FormAttachment(100, -10); + nextButtonData.bottom = new FormAttachment(100, -10); + nextButton.setLayoutData(nextButtonData); + nextButton.setText("����"); + nextButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { + if (currentRadioButton == null) { + MessageDialog.openInformation(parent.getShell(), "�G���[", "����I�����Ă�������"); + } else { + MessageDialog.openInformation(parent.getShell(), "����", + me.getSignature() + "��" + currentRadioButton.getText() + "��" + propertyCombo.getText() + "�Ɍ���B"); + } + } + }); + + + } + + public void update(MethodExecution me) { + updateCombo(me); + updateExSelectionButton(me); + } + + public void updateCombo(MethodExecution me) { + ArrayList propertyList = new ArrayList<>(((MethodInfo)me.getAugmentation()).getProperties()); + setData(propertyList); + for (MethodProperty property : (ArrayList)this.getData()) { + switch (property) { + case created: + propertyCombo.add("�V�K�쐬"); + propertyCombo.setText("�V�K�쐬"); + break; + case modified: + propertyCombo.add("�C������"); + propertyCombo.setText("�C������"); + break; + case unmodified: + propertyCombo.add("�C���Ȃ�"); + propertyCombo.setText("�C���Ȃ�"); + break; + + default: + break; + } + } + } + + public void updateExSelectionButton(MethodExecution me) { + ArrayList