public static ActionListener interpretAtomMenuItemActionListener() {
return new ActionListener() {
IMarker selectedMarker;
@Override
public void actionPerformed(final ActionEvent e) {
final AlloyAtom alloyAtom = (AlloyAtom) Visualization.rightClickedAnnotation;
showWizard();
if (selectedMarker == null) {
return;
}
final String sigTypeName = alloyAtom.getType().getName();
final String stringIndex = alloyAtom.toString().substring(sigTypeName.length());
int index = 0;
if (!stringIndex.isEmpty()) {
index = Integer.parseInt(stringIndex);
}
AlloyUtilities.bindAtomToMarker(sigTypeName, index, selectedMarker);
Visualization.showViz();
}
private void showWizard() {
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
final InterpretationWizard wizard = new InterpretationWizard();
final WizardDialog dialog = new WizardDialog(
Activator.getDefault().getWorkbench().getWorkbenchWindows()[0].getShell(), wizard);
dialog.open();
selectedMarker = wizard.getSelectedMarker();
}
});
}
};
}
VisualizationActionListenerFactory.java 文件源码
java
阅读 27
收藏 0
点赞 0
评论 0
项目:Tarski
作者:
评论列表
文章目录