modal JDialog

In order to instantiate a standard javax.swing.JDialog for my IntelliJ plugin, I need a java.awt.Frame for the parent component. Say I have som handler code...

public void actionPerformed(AnActionEvent e) {
Project project = (Project)e.getDataContext().getData(DataConstants.PROJECT);
Frame frame = ????
DialongCodeGen dialog = new DialongCodeGen(project, frame);
(...)

Thanks!

/Morten

2 comments

Does this help http://www.intellij.net/forums/thread.jspa?threadID=260840&tstart=15 ?
In short, extends DialogWrapper, call init() in constructor, use show to pop it.

public class ActualTimeForm extends DialogWrapper {
public ActualTimeForm(Project project){
init();
.....
}
}
public void actionPerformed(AnActionEvent e){
ActualTimeForm actualTimeForm = new ActualTimeForm(getProject(e));
actualTimeForm.show();
if (actualTimeForm.isOK()) {
};
}

-sergiy

0

Please sign in to leave a comment.