// create JMenuITem to add new Document...
final JMenuItem newDocumentMI = new JMenuItem("New Document");
newDocumentMI.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent ae) {
final DocumentPanel newDocument = VisualRifEditor.this.that.documentContainer
.createNewDocument();
VisualRifEditor.this.that.treePane.addNewDocument(newDocument);
VisualRifEditor.this.that.setRightComponent(newDocument);
VisualRifEditor.this.that.getDocumentContainer().getActiveDocument().getDocumentEditorPane().generateRif();
VisualRifEditor.this.that.getDocumentContainer().getActiveDocument().getDocumentEditorPane().evaluate();
VisualRifEditor.this.that.getDocumentContainer().getActiveDocument().getDocumentEditorPane().generateRif();
}
});
final JMenuItem newFileMI = new JMenuItem("New File");
newFileMI.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent ae) {
VisualRifEditor.this.getDocumentContainer().setActiveDocument(null);
VisualRifEditor.this.getDocumentContainer().getDocuments().clear();
VisualRifEditor.this.getRuleContainer().getRulePanelList().clear();
VisualRifEditor.this.getRuleContainer().setActiveRule(null);
VisualRifEditor.this.getRuleContainer().getRules().clear();
VisualRifEditor.this.setRightComponent(new JLabel());
VisualRifEditor.this.getTreePane().clearTopComponent();
final DocumentPanel newDocument = VisualRifEditor.this.that.documentContainer
.createNewDocument();
VisualRifEditor.this.that.treePane.addNewDocument(newDocument);
VisualRifEditor.this.that.setRightComponent(newDocument);
VisualRifEditor.this.that.getDocumentContainer().getActiveDocument().getDocumentEditorPane().generateRif();
VisualRifEditor.this.that.getDocumentContainer().getActiveDocument().getDocumentEditorPane().evaluate();