Examples of ClassLocator


Examples of net.sf.rej.files.ClassLocator

        try {
            ClassFile cf = null;
            if (obj instanceof String) {
                // TODO: let user type his own class name?
            } else if (obj instanceof ClassLocator) {
                ClassLocator cl = (ClassLocator) obj;
                cf = SystemFacade.getInstance().getClassFile(cl);
            }

            // cf will be null if referenced class is not in project classpath
            if (cf != null) {
View Full Code Here

Examples of net.sf.rej.files.ClassLocator

    public void updatePackage() {
        if (this.model.getSize() == 0) {
            this.packageLabel.setText("");
        }
        // TODO: The following line creates exceptions.. probably because of bad design
        ClassLocator cl = (ClassLocator)ClassChooseDialog.this.list.getSelectedValue();
        if(cl != null) {
            this.packageLabel.setText(cl.getPackage());
        } else {
            this.packageLabel.setText("");
        }
    }
View Full Code Here

Examples of net.sf.rej.files.ClassLocator

  }
 
  private void openStackFrame(IStackFrame sf) {
    ClassIndex ci = SystemFacade.getInstance().getClassIndex();
    ClassLocator cl = ci.getLocator(sf.location().declaringType().name());
    if (cl != null) {
      try {
        ClassFile cf = SystemFacade.getInstance().getClassFile(cl);
        IMethod bpMethod = sf.location().method();
        for (net.sf.rej.java.Method method : cf.getMethods()) {
          if (method.getName().equals(bpMethod.name()) && method.getDescriptor().getRawDesc().equals(bpMethod.signature())) {
            Integer pc = null;
            if (sf.location().codeIndex() != -1) {
              pc = (int)sf.location().codeIndex();
            }
           
            Event event = new Event(EventType.CLASS_OPEN);
            event.setClassFile(cf);
            event.setFile(cl.getFile());
            this.dispatcher.notifyObservers(event);
            setExecutionRow(method.getName(), method.getDescriptor(), pc);
            break;
          }
        }
View Full Code Here

Examples of net.sf.rej.files.ClassLocator

      selectClassButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent e) {
          ClassIndex classIndex = SystemFacade.getInstance().getClassIndex();
          ClassChooseDialog ccd = new ClassChooseDialog(MainWindow.getInstance(), classIndex);
          ccd.invoke();
          ClassLocator locator = ccd.getSelected();
          if (locator != null) {
            DebugTab.this.mainClassField.setText(locator.getFullName());
          }
        }
      });
    }
    return selectClassButton;
View Full Code Here

Examples of org.carrot2.util.resource.ClassLocator

public class ComponentSuitesTest extends CarrotTestCase
{
    @Test
    public void testNullValues_Carrot973() throws Exception
    {
        ResourceLookup resourceLookup = new ResourceLookup(new ClassLocator(getClass()));

        IResource resource = resourceLookup.getFirst("suite-nullvalues.xml");
        assertThat(resource).isNotNull();
        ProcessingComponentSuite suite =
            ProcessingComponentSuite.deserialize(resource, resourceLookup);
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

            if(file.exists()){
              url = file.toURI().toURL();
            }
          }
          if(url==null){//try to load from class loader
            url = new ClassLocator().getResource(_src);
          }
          if(url==null){//try to load from file
            File f = new File(_src);
            if(f.exists()){
              url = f.toURI().toURL();
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

      log.info("Loading system default");
    else if (config == null)
      return; //nothing to do

    try {
      final ClassLocator locator = new ClassLocator();
      final List xmls = locator.getDependentXMLResources(
        "metainfo/zk/config.xml", "config-name", "depends");
      for (Iterator it = xmls.iterator(); it.hasNext();) {
        final ClassLocator.Resource res = (ClassLocator.Resource)it.next();
        if (log.debugable()) log.debug("Loading "+res.url);
        try {
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

  synchronized static final void load() {
    if (_loaded)
      return;

    try {
      final ClassLocator loc = new ClassLocator();
      for (Enumeration en = loc.getResources("metainfo/xel/config.xml");
      en.hasMoreElements();) {
        final URL url = (URL)en.nextElement();
        if (log.debugable()) log.debug("Loading "+url);
        try {
          final Document doc = new SAXBuilder(false, false, true).build(url);
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

      log.error("Unable to load metainfo/zk/config.xml", ex);
    }

    //load metainfo/zk/zk.xml
    try {
      final ClassLocator loc = new ClassLocator();
      for (Enumeration en = loc.getResources("metainfo/zk/zk.xml");
      en.hasMoreElements();) {
        final URL cfgUrl = (URL)en.nextElement();
        try {
          parser.parse(cfgUrl, config, loc);
        } catch (Throwable ex) {
View Full Code Here

Examples of org.zkoss.util.resource.ClassLocator

        }
      }
    }
  }
  private static void load0() throws java.io.IOException {
    final ClassLocator locator = new ClassLocator();

    //1. parse config.xml
    final ConfigParser parser = new ConfigParser();
    parser.parseConfigXml(null); //only system default configs

    //2. process lang.xml (no particular dependency)
    for (Enumeration en = locator.getResources("metainfo/zk/lang.xml");
    en.hasMoreElements();) {
      final URL url = (URL)en.nextElement();
      if (log.debugable()) log.debug("Loading "+url);
      try {
        final Document doc = new SAXBuilder(true, false, true).build(url);
        if (ConfigParser.checkVersion(url, doc, true))
          parseLang(doc, locator, url, false);
      } catch (Exception ex) {
        log.error("Failed to load "+url, ex);
        throw UiException.Aide.wrap(ex, "Failed to load "+url);
          //abort since it is hardly to work then
      }
    }

    //3. process lang-addon.xml (with dependency)
    final List xmls = locator.getDependentXMLResources(
      "metainfo/zk/lang-addon.xml", "addon-name", "depends");
    for (Iterator it = xmls.iterator(); it.hasNext();) {
      final ClassLocator.Resource res = (ClassLocator.Resource)it.next();
      try {
        if (ConfigParser.checkVersion(res.url, res.document, true))
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.