diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java index b77bbdc..8ab2517 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/actions/InteractiveFeatureLocatorAction.java @@ -55,8 +55,8 @@ public class InteractiveFeatureLocatorAction implements IWorkbenchWindowActionDelegate { private IWorkbenchWindow window; private Display display; - private String featureFolderPath = ""; // �{�ԗp -// private String featureFolderPath = "C:\\Users\\student\\git\\org.ntlab.interactiveFeatureLocator\\InteractiveFeatureLocator\\Feature\\Feature1593375"; // �e�X�g�p +// private String featureFolderPath = ""; // �{�ԗp + private String featureFolderPath = "C:\\Users\\student\\Desktop\\fujioka\\org.ntlab.interactiveFeatureLocator\\InteractiveFeatureLocator\\Feature\\Feature1593375"; // �e�X�g�p private String featureXMLPath = null; private String otherfeatureTraceName = null; // private int featureNo = 0; // �{�ԗp @@ -343,7 +343,7 @@ public void doAnalyze(Feature feature) { // System.out.println("��͊J�n"); derivationManager = new DerivationManager(feature); - derivationManager.firstInference(); + derivationManager.firstDerivation(); } public ArrayList getFolder(File[] files) { diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java index ed608bf..79874dd 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/CallTreeGraphNode.java @@ -19,12 +19,14 @@ public CallTreeGraphNode(IContainer graphModel, int style, MethodExecution method) { super(graphModel, style, method.getMethodName(), method); setSize(20.0, 5.0); +// set } public void highlight() { this.focus = true; try { Test test = new Test(); + System.out.println(this.getSize().height() + ", " + this.getSize().width()); test.openEditor(this.getMethod()); } catch (JavaModelException e) { // TODO Auto-generated catch block diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java index 3133624..a1099a2 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationManager.java @@ -15,29 +15,29 @@ } } - public DerivationUnit getInferenceUnit(int index) { + public DerivationUnit getDerivationUnit(int index) { return units.get(index); } - public int getInferenceUnitCount() { + public int getDerivationUnitCount() { return units.size(); } - public DerivationResults nextInference(DerivationUnit unit, MethodProperty property) { - return unit.nextInference(property); + public DerivationResults nextDerivation(DerivationUnit unit, MethodProperty property) { + return unit.nextDerivation(property); } public HashSet getResults() { return results; } - public HashSet firstInference() { + public HashSet firstDerivation() { for (DerivationUnit unit : units) { // HashSet irs = unit.firstInference(); // for (InferenceResults ir : irs) { // results.add(ir); // } - results.add(unit.firstInference()); + results.add(unit.firstDerivation()); } return results; } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java index 3ad6675..efb64f2 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/DerivationUnit.java @@ -51,7 +51,7 @@ // return callTreeLayout; // } - public DerivationResults nextInference(MethodProperty property) { + public DerivationResults nextDerivation(MethodProperty property) { Set unreflectedExecutions = activeSession.decideMethodProperty(property); // �Z�b�V��������鏈�� for (MethodExecution unreflectedExecution : unreflectedExecutions) { @@ -60,10 +60,10 @@ return null; } - public DerivationResults firstInference() { - HashSet minus = minusTrace.getAllMethodSignatures(); + public DerivationResults firstDerivation() { + HashSet minusSet = minusTrace.getAllMethodSignatures(); for (String plus : plusTrace.getAllMethodSignatures()) { - if (!minus.contains(plus)) { + if (!minusSet.contains(plus)) { System.out.println(plus); result.addMethodSignature(plus); // plusTrace.getMethodExecutions(plus); @@ -82,6 +82,7 @@ for (String methodSignature : result.getMethodSignatures()) { methodExecutions.addAll(plusTrace.getMethodExecutions(methodSignature)); } + // �� HashSet testExecutions = new HashSet<>(); for (MethodExecution execution : methodExecutions) { testExecutions.add(execution); diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java index d432194..e28bf49 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/model/Feature.java @@ -34,7 +34,7 @@ } } if (f.isFile()) { - if (f.getName().endsWith("xml")) { + if (f.getName().endsWith(".xml")) { featureXml = f; } } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java index 3c10c28..8c338e3 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/test/Test.java @@ -6,9 +6,11 @@ import java.util.Set; import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IMarker; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IPath; import org.eclipse.core.runtime.Path; import org.eclipse.jdt.core.IJavaElement; @@ -90,13 +92,17 @@ 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"); + IPath path = new Path("jEdit/org/gjt/sp/jedit/GUIUtilities.java"); IFile file = root.getFile(path); + int line = 10; IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); try { - IDE.openEditor(page, file); + IMarker marker = file.createMarker(IMarker.TEXT); + marker.setAttribute(IMarker.LINE_NUMBER, line); +// IDE.openEditor(page, file); + IDE.openEditor(page, marker); System.out.println("open: " + file.getName()); - } catch (PartInitException e) { + } catch (CoreException e) { // TODO Auto-generated catch block e.printStackTrace(); } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java new file mode 100644 index 0000000..663ae21 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractionComposite.java @@ -0,0 +1,124 @@ +package interactivefeaturelocator.views; + +import interactivefeaturelocator.model.DerivationSession; +import interactivefeaturelocator.model.MethodInfo; +import interactivefeaturelocator.model.MethodProperty; +import interactivefeaturelocator.model.CallTreeGraphNode; + +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.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.Label; +import org.ntlab.trace.MethodExecution; + +public class InteractionComposite extends Composite { + private MethodExecution me; + private boolean dataflow; + private Composite dataflowComposite; + private Combo combo; + private Label discription; + private Button decideButton; + + public InteractionComposite(Composite parent, int style, MethodExecution me, boolean dataflow) { + super(parent, style); + // TODO Auto-generated constructor stub + this.me = me; + this.dataflow = dataflow; + + setLayout(new FormLayout()); + + combo = new Combo(this, SWT.READ_ONLY); + FormData comboData = new FormData(); + comboData.top = new FormAttachment(0, 10); + comboData.right = new FormAttachment(100, -10); + combo.setLayoutData(comboData); + updateCombo(me); + combo.setVisible(!dataflow); + + decideButton = new Button(this, SWT.NONE); + FormData decideButtonData = new FormData(); + decideButtonData.right = new FormAttachment(100, -10); + decideButtonData.bottom = new FormAttachment(100, -10); + decideButton.addSelectionListener(new SelectionAdapter() { + public void widgetSelected(SelectionEvent e) { +// session.decideMethodProperty(property) +// int index = combo.getSelectionIndex(); +// DerivationSession session = this; +// session.decideMethodProperty(((ArrayList)combo.getData()).get(index)); + MessageDialog.openInformation(parent.getShell(), "����", + me.getSignature() + "��" + combo.getText() + "�Ɍ���B"); + } + }); + decideButton.setText("����"); + decideButton.setLayoutData(decideButtonData); + + discription = new Label(this, SWT.NONE); + updateDiscription(me); + FormData textData = new FormData(); + textData.top = new FormAttachment(0, 0); + textData.left = new FormAttachment(0, 0); + if (dataflow) { + textData.right = new FormAttachment(100, -10); + } else { + textData.right = new FormAttachment(combo, -10); + } + discription.setLayoutData(textData); + + dataflowComposite = new DataflowComposite(this, SWT.BORDER, me); + FormData dataflowCompData = new FormData(); + dataflowCompData.top = new FormAttachment(discription, 10); + dataflowCompData.bottom = new FormAttachment(decideButton, -10); + dataflowCompData.right = new FormAttachment(100, -10); + dataflowCompData.left = new FormAttachment(0, 10); + dataflowComposite.setLayoutData(dataflowCompData); + dataflowComposite.setVisible(dataflow); + + + } + + public void update(MethodExecution me) { + updateCombo(me); + updateDiscription(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: + combo.add("�V�K�쐬"); + combo.setText("�V�K�쐬"); + break; + case modified: + combo.add("�C������"); + combo.setText("�C������"); + break; + case unmodified: + combo.add("�C���Ȃ�"); + combo.setText("�C���Ȃ�"); + break; + + default: + break; + } + } + } + + public void updateDiscription(MethodExecution me) { + String text = ""; + text += "Current Method : " + me.getSignature() + "\n"; + discription.setText(text); + } + + +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSession.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSession.java deleted file mode 100644 index 7c7eb35..0000000 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSession.java +++ /dev/null @@ -1,86 +0,0 @@ -package interactivefeaturelocator.views; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.Set; - -import interactivefeaturelocator.model.DerivationSession; -import interactivefeaturelocator.model.MethodInfo; -import interactivefeaturelocator.model.MethodProperty; -import interactivefeaturelocator.model.CallTreeGraphNode; - -import org.eclipse.jface.dialogs.MessageDialog; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.CTabFolder; -import org.eclipse.swt.custom.CTabItem; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -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.Label; -import org.ntlab.trace.MethodExecution; - -public class InteractiveDerivationSession extends CTabItem { - private DerivationSession session; - private Composite bodyComposite; - private CallTreeGraph graph; - private SelectionComposite selectionComposite; - private CTabFolder parent; - - public InteractiveDerivationSession(CTabFolder parent, int style, MethodExecution seed) { - super(parent, style); - // TODO Auto-generated constructor stub - this.parent = parent; - session = new DerivationSession(seed); -// SelectMethodLayout layout = new SelectMethodLayout(this); - bodyComposite = new Composite(this.getParent(), SWT.NONE); - bodyComposite.setLayout(new FormLayout()); - - createCallTreeGraph(); - createSelectionComposite(); - - setControl(bodyComposite); - - } - - public void createCallTreeGraph() { - // �㕔�̌Ăяo���؂�`�悷��Composite - graph = new CallTreeGraph(bodyComposite, SWT.BORDER); - FormData graphForm = new FormData(); - graphForm.top = new FormAttachment(0, 0); - graphForm.left = new FormAttachment(0, 0); - graphForm.right = new FormAttachment(100, 0); - graphForm.bottom = new FormAttachment(70, -5); - graph.setLayoutData(graphForm); - graph.setPreferredSize(1000, 500); - graph.createGraph(session); - } - - public void createSelectionComposite() { - createSelectionComposite(false); - } - - public void createSelectionComposite(boolean dataflow) { - // �����̃J�����g���\�b�h�̐����ƑI���{�^����\������Composite - selectionComposite = new SelectionComposite(bodyComposite, SWT.NONE, session.getCurrentMethodExecution(), false); - selectionComposite.setLayout(new FormLayout()); - FormData selectionData = new FormData(); - selectionData.top = new FormAttachment(graph, 0); - selectionData.left = new FormAttachment(0, 0); - selectionData.right = new FormAttachment(100, 0); - selectionData.bottom = new FormAttachment(100, 0); - selectionComposite.setLayoutData(selectionData); - } - - public CallTreeGraph getCallTreeGraph() { - return this.graph; - } - - public DerivationSession getSession() { - return this.session; - } -} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java new file mode 100644 index 0000000..b139673 --- /dev/null +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationSessionTab.java @@ -0,0 +1,86 @@ +package interactivefeaturelocator.views; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.Set; + +import interactivefeaturelocator.model.DerivationSession; +import interactivefeaturelocator.model.MethodInfo; +import interactivefeaturelocator.model.MethodProperty; +import interactivefeaturelocator.model.CallTreeGraphNode; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.swt.SWT; +import org.eclipse.swt.custom.CTabFolder; +import org.eclipse.swt.custom.CTabItem; +import org.eclipse.swt.events.SelectionAdapter; +import org.eclipse.swt.events.SelectionEvent; +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.Label; +import org.ntlab.trace.MethodExecution; + +public class InteractiveDerivationSessionTab extends CTabItem { + private DerivationSession session; + private Composite bodyComposite; + private CallTreeGraph graph; + private InteractionComposite interactionComposite; + private CTabFolder parent; + + public InteractiveDerivationSessionTab(CTabFolder parent, int style, MethodExecution seed) { + super(parent, style); + // TODO Auto-generated constructor stub + this.parent = parent; + session = new DerivationSession(seed); +// SelectMethodLayout layout = new SelectMethodLayout(this); + bodyComposite = new Composite(this.getParent(), SWT.NONE); + bodyComposite.setLayout(new FormLayout()); + + createCallTreeGraph(); + createInteractionComposite(); + + setControl(bodyComposite); + + } + + public void createCallTreeGraph() { + // �㕔�̌Ăяo���؂�`�悷��Composite + graph = new CallTreeGraph(bodyComposite, SWT.BORDER); + FormData graphForm = new FormData(); + graphForm.top = new FormAttachment(0, 0); + graphForm.left = new FormAttachment(0, 0); + graphForm.right = new FormAttachment(100, 0); + graphForm.bottom = new FormAttachment(70, -5); + graph.setLayoutData(graphForm); + graph.setPreferredSize(1000, 500); + graph.createGraph(session); + } + + public void createInteractionComposite() { + createInteractionComposite(false); + } + + public void createInteractionComposite(boolean dataflow) { + // �����̃J�����g���\�b�h�̐����ƑI���{�^����\������Composite + interactionComposite = new InteractionComposite(bodyComposite, SWT.NONE, session.getCurrentMethodExecution(), false); + interactionComposite.setLayout(new FormLayout()); + FormData interactionData = new FormData(); + interactionData.top = new FormAttachment(graph, 0); + interactionData.left = new FormAttachment(0, 0); + interactionData.right = new FormAttachment(100, 0); + interactionData.bottom = new FormAttachment(100, 0); + interactionComposite.setLayoutData(interactionData); + } + + public CallTreeGraph getCallTreeGraph() { + return this.graph; + } + + public DerivationSession getSession() { + return this.session; + } +} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java index 10ba31f..3b908c0 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationTabFolder.java @@ -20,23 +20,24 @@ public class InteractiveDerivationTabFolder extends CTabFolder { final public DerivationUnit iu = null; - public HashSet methods; // ���o����(�ߒ�) + public HashSet methodExecs; // ���o����(�ߒ�) - public InteractiveDerivationTabFolder(Composite parent, int style, HashSet methods) { + public InteractiveDerivationTabFolder(Composite parent, int style, HashSet methodExecs) { super(parent, style); // iu = new InferenceUnit(trace); - setMethods(methods); - createTab(); + this.methodExecs = methodExecs; + createTab(methodExecs); // TODO Auto-generated constructor stub } - private void createTab() { - ArrayList sessions = new ArrayList<>(); + private void createTab(HashSet methodExecs) { + ArrayList sessionItems = new ArrayList<>(); int i = 1; - for (MethodExecution me : getMethods()) { - CTabItem session = new InteractiveDerivationSession(this, SWT.NONE, me); - session.setText("Session " + i); - sessions.add((InteractiveDerivationSession)session); + for (MethodExecution me : methodExecs) { + CTabItem sessionItem = new InteractiveDerivationSessionTab(this, SWT.NONE, me); + sessionItem.setText("Session " + i); + sessionItem.setToolTipText(me.getSignature()); + sessionItems.add((InteractiveDerivationSessionTab)sessionItem); i++; } @@ -64,10 +65,10 @@ } public HashSet getMethods() { - return methods; + return methodExecs; } public void setMethods(HashSet methods) { - this.methods = methods; + this.methodExecs = methods; } } diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java index 7cdcdcd..0737b7a 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/InteractiveDerivationView.java @@ -48,8 +48,8 @@ setParent(parent); } - public void createTabFolder(DerivationUnit unit) { - InteractiveDerivationTabFolder tabFolder = new InteractiveDerivationTabFolder(this.getParent(), SWT.NONE | SWT.BOTTOM, unit.getMethodExecutions()); + public void createTabFolder(HashSet methodExecs) { + InteractiveDerivationTabFolder tabFolder = new InteractiveDerivationTabFolder(this.getParent(), SWT.NONE | SWT.BOTTOM, methodExecs); tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false)); tabFolder.setSimple(false); if (focusFolder == null) { diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/SelectionComposite.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/SelectionComposite.java deleted file mode 100644 index 1e89bf0..0000000 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/SelectionComposite.java +++ /dev/null @@ -1,124 +0,0 @@ -package interactivefeaturelocator.views; - -import interactivefeaturelocator.model.DerivationSession; -import interactivefeaturelocator.model.MethodInfo; -import interactivefeaturelocator.model.MethodProperty; -import interactivefeaturelocator.model.CallTreeGraphNode; - -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.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.Label; -import org.ntlab.trace.MethodExecution; - -public class SelectionComposite extends Composite { - private MethodExecution me; - private boolean dataflow; - private Composite dataflowComposite; - private Combo combo; - private Label discription; - private Button decideButton; - - public SelectionComposite(Composite parent, int style, MethodExecution me, boolean dataflow) { - super(parent, style); - // TODO Auto-generated constructor stub - this.me = me; - this.dataflow = dataflow; - - setLayout(new FormLayout()); - - combo = new Combo(this, SWT.READ_ONLY); - FormData comboData = new FormData(); - comboData.top = new FormAttachment(0, 10); - comboData.right = new FormAttachment(100, -10); - combo.setLayoutData(comboData); - updateCombo(me); - combo.setVisible(!dataflow); - - decideButton = new Button(this, SWT.NONE); - FormData decideButtonData = new FormData(); - decideButtonData.right = new FormAttachment(100, -10); - decideButtonData.bottom = new FormAttachment(100, -10); - decideButton.addSelectionListener(new SelectionAdapter() { - public void widgetSelected(SelectionEvent e) { -// session.decideMethodProperty(property) -// int index = combo.getSelectionIndex(); -// DerivationSession session = this; -// session.decideMethodProperty(((ArrayList)combo.getData()).get(index)); - MessageDialog.openInformation(parent.getShell(), "����", - me.getSignature() + "��" + combo.getText() + "�Ɍ���B"); - } - }); - decideButton.setText("����"); - decideButton.setLayoutData(decideButtonData); - - discription = new Label(this, SWT.NONE); - updateDiscription(me); - FormData textData = new FormData(); - textData.top = new FormAttachment(0, 0); - textData.left = new FormAttachment(0, 0); - if (dataflow) { - textData.right = new FormAttachment(100, -10); - } else { - textData.right = new FormAttachment(combo, -10); - } - discription.setLayoutData(textData); - - dataflowComposite = new DataflowComposite(this, SWT.BORDER, me); - FormData dataflowCompData = new FormData(); - dataflowCompData.top = new FormAttachment(discription, 10); - dataflowCompData.bottom = new FormAttachment(decideButton, -10); - dataflowCompData.right = new FormAttachment(100, -10); - dataflowCompData.left = new FormAttachment(0, 10); - dataflowComposite.setLayoutData(dataflowCompData); - dataflowComposite.setVisible(dataflow); - - - } - - public void update(MethodExecution me) { - updateCombo(me); - updateDiscription(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: - combo.add("�V�K�쐬"); - combo.setText("�V�K�쐬"); - break; - case modified: - combo.add("�C������"); - combo.setText("�C������"); - break; - case unmodified: - combo.add("�C���Ȃ�"); - combo.setText("�C���Ȃ�"); - break; - - default: - break; - } - } - } - - public void updateDiscription(MethodExecution me) { - String text = ""; - text += "Current Method : " + me.getSignature() + "\n"; - discription.setText(text); - } - - -} diff --git a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java index b36bdd4..3997b91 100644 --- a/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java +++ b/org.ntlab.interactiveFeatureLocator/src/interactivefeaturelocator/views/TraceView.java @@ -48,7 +48,7 @@ private TreeViewer viewer; // private HashMap threads = new HashMap<>(); private TreeNode focusNode = null; - private InteractiveDerivationView selectMethodView; + private InteractiveDerivationView interactiveDerivationView; private ArrayList traces = new ArrayList<>(); private DerivationManager derivationManager; @@ -60,7 +60,7 @@ public void createPartControl(Composite parent) { // TODO Auto-generated method stub theInstance = this; - selectMethodView = InteractiveDerivationView.theInstance; + interactiveDerivationView = InteractiveDerivationView.theInstance; viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); viewer.setContentProvider(new TreeNodeContentProvider()); @@ -76,7 +76,7 @@ if (selection.getFirstElement() != null) { setFocusNode((TreeNode)selection.getFirstElement()); if (getFocusNode() != null) { - selectMethodView.changeFolder(0); + interactiveDerivationView.changeFolder(0); } } } @@ -86,14 +86,14 @@ // Viewer�̍X�V public void updateViewer() { traces.clear(); - if (selectMethodView == null) { - selectMethodView = InteractiveDerivationView.theInstance; + if (interactiveDerivationView == null) { + interactiveDerivationView = InteractiveDerivationView.theInstance; } - for (int i = 0; i < derivationManager.getInferenceUnitCount(); i++) { - DerivationUnit unit = derivationManager.getInferenceUnit(i); + for (int i = 0; i < derivationManager.getDerivationUnitCount(); i++) { + DerivationUnit unit = derivationManager.getDerivationUnit(i); Trace plusTrace = unit.getPlusTrace(); traces.add(plusTrace); - selectMethodView.createTabFolder(unit); + interactiveDerivationView.createTabFolder(unit.getMethodExecutions()); System.out.println(plusTrace.getFileName()); } viewer.setInput(makeData(traces));