// our main requirejs function requirejs(['path/to/indexview'], function (IndexView) { var AppRouter = Backbone.Router.extend({ initialize: function () { // bind our IndexView to the router this.IndexView = new IndexView(); } }); // start the app var app = new AppRouter(); });
/** * Gets a DefaultMutableTreeNode representing the * information in this view instance. * * The default implementation parses the data in the URL, but a subclass may * override this method and provide a different implemenation. For example, * it may create the tree programatically. */ public DefaultMutableTreeNode getDataAsTree() { HelpSet hs = getHelpSet(); debug("helpSet in "+this+hs.toString()); Hashtable params = getParameters(); URL url; if (params == null || (params != null && !params.containsKey("data"))) { DefaultMutableTreeNode node = new DefaultMutableTreeNode(); return node; } try { url = new URL(hs.getHelpSetURL(), (String) params.get("data")); } catch (Exception ex) { throw new Error("Trouble getting URL to Index data; "+ex); } debug("url,hs: "+url.toString()+";"+hs.toString()); return parse(url, hs, hs.getLocale(), new DefaultIndexFactory()); }
private void initialize() { if (view == null) { return; } topNode = view.getDataAsTree(); treeEnum = topNode.preorderEnumeration(); String mergeType = view.getMergeType(); HelpSet hs = view.getHelpSet(); Locale locale = hs.getLocale(); // Make sure the children are all handled correctly MergeHelpUtilities.mergeNodeChildren(mergeType, topNode); // add all the subhelpsets addSubHelpSets(hs); }
/** * Constructs Merge for master and slave NavigatorViews * * @param master The master NavigatorView * @param slave The slave NavigatorView */ protected Merge(NavigatorView master, NavigatorView slave){ try { Class clss = Class.forName("javax.help.TOCView"); if (clss.isInstance(slave)) { this.slaveTopNode = ((TOCView)slave).getDataAsTree(); } clss = Class.forName("javax.help.IndexView"); if (clss.isInstance(slave)) { this.slaveTopNode = ((IndexView)slave).getDataAsTree(); } } catch(ClassNotFoundException exp) { System.err.println(exp); } locale = master.getHelpSet().getLocale(); if(locale == null) locale = Locale.getDefault(); }
/** * Reloads the presentation data using new help model. Changes the navigator if new model contains * view with the same name as former view **/ private void reloadData(HelpModel model) { debug("reloadData in using new model"); IndexView indexView = null; HelpSet newHelpSet = model.getHelpSet(); IndexView oldView = (IndexView) index.getNavigatorView(); String oldName = oldView.getName(); NavigatorView[] navViews = newHelpSet.getNavigatorViews(); for(int i = 0 ; i < navViews.length; i++){ if((navViews[i].getName()).equals(oldName)){ NavigatorView tempView = navViews[i]; if(tempView instanceof IndexView){ indexView = (IndexView) tempView; break; } } } if (worker != null) { // Something is still going on. Stop it and start over worker.interrupt(); } worker = new NavSwingWorker(indexView); worker.start(Thread.MIN_PRIORITY); }
String mergeType = view.getMergeType(); Locale locale = view.getHelpSet().getLocale(); DefaultMutableTreeNode node = view.getDataAsTree(); addSubHelpSets(view.getHelpSet()); return Boolean.TRUE;
var view = new IndexView(); //print view class console.log(view.className);
index: function() { _this.loadView(new IndexView()); } //,
Router.prototype.index = Router.view = new IndexView();
currentView = new IndexView();
/** * Creates an Index navigator with explicit arguments. Note that this should not throw * an InvalidNavigatorViewException since we are implicitly passing the type. * * @param hs HelpSet * @param name The name identifying this HelpSet. * @param label The label to use (for this locale). * @param data The "data" part of the parameters, a URL location of the TOC data. */ public JHelpIndexNavigator(HelpSet hs, String name, String label, URL data) throws InvalidNavigatorViewException { super(new IndexView(hs, name, label, createParams(data))); }