jlibs.nblr.editor.RuleChooser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jlibs-nblr Show documentation
Show all versions of jlibs-nblr Show documentation
Non-Blocking Language Recognition
/**
* Copyright 2015 Santhosh Kumar Tekuri
*
* The JLibs authors license this file to you under the Apache License,
* version 2.0 (the "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
package jlibs.nblr.editor;
import jlibs.core.graph.Navigator;
import jlibs.core.graph.Sequence;
import jlibs.core.graph.Visitor;
import jlibs.core.graph.sequences.EmptySequence;
import jlibs.core.graph.sequences.IterableSequence;
import jlibs.core.lang.ImpossibleException;
import jlibs.nblr.Syntax;
import jlibs.nblr.rules.Node;
import jlibs.nblr.rules.Rule;
import jlibs.nblr.rules.RuleTarget;
import jlibs.swing.tree.NavigatorTreeModel;
import java.awt.*;
import java.util.ArrayList;
import java.util.Iterator;
/**
* @author Santhosh Kumar T
*/
public class RuleChooser extends TreeSelectionDialog{
private Syntax syntax;
public RuleChooser(Window owner, Syntax syntax){
super(owner, "Rule Chooser");
this.syntax = syntax;
createContents();
}
@Override
@SuppressWarnings({"unchecked"})
protected NavigatorTreeModel treeModel(){
return new NavigatorTreeModel(syntax, new RuleNavigator());
}
@Override
protected Visitor
© 2015 - 2025 Weber Informatics LLC | Privacy Policy