/** * Get the file for a hash rid. */ protected File getHashRidFile(IResourceIdentifier rid) { assert ResourceIdentifier.isHashGid(rid); // http://tools.ietf.org/html/rfc3548#section-4 for local storage of hashed resources String name = rid.getGlobalIdentifier().getResourceId().substring(2).replace('+', '-').replace('/', '_') + ".jar"; IContextService localService = SServiceProvider.getLocalService(component, IContextService.class); // use contextService to get private data dir on android IFuture<File> future = localService.getFile(SUtil.JADEXDIR + "resources/"+name); File file = future.get(); return file; }
/** * Get the tooltip. */ public String getTooltipText() { String ret = null; Object o = getUserObject(); if(o instanceof IResourceIdentifier) { if(ResourceIdentifier.isHashGid((IResourceIdentifier)o)) { ret = ((IResourceIdentifier)o).getGlobalIdentifier().getResourceId(); } } return ret; }
if(rid.getGlobalIdentifier()!=null && rid.getGlobalIdentifier().getResourceId()!=null && !isHashGid(rid))
if(((IResourceIdentifier)o).getGlobalIdentifier()!=null && !ResourceIdentifier.isHashGid((IResourceIdentifier)o))
public void customResultAvailable(Collection<Tuple2<String, String>> result) { Properties props = new Properties(); Iterator<Tuple2<String, String>> it = result.iterator(); for(int i=0; i<tests.size(); i++) { Tuple2<String, String> local = it.next(); Properties entry = new Properties(); entry.addProperty(new Property("model", local.getFirstEntity())); entry.addProperty(new Property("ridurl", local.getSecondEntity())); // todo: save also repo info of gid IResourceIdentifier rid = tests.get(i).getSecondEntity(); String id = rid!=null && rid.getGlobalIdentifier()!=null && rid.getGlobalIdentifier().getResourceId()!=null && !ResourceIdentifier.isHashGid(rid) ? rid.getGlobalIdentifier().getResourceId(): null; entry.addProperty(new Property("globalrid", id)); props.addSubproperties("entry", entry); } props.addProperty(new Property("timeout", tfto.getText())); props.addProperty(new Property("concurrency", ""+concurrency)); props.addProperty(new Property("allowduplicates", ""+allowduplicates.isSelected())); ret.setResult(props); } });
if(grid!=null && !ResourceIdentifier.isHashGid((IResourceIdentifier)o))
public void customResultAvailable(Tuple2<String, String> result) { Properties props = new Properties(); if(result!=null) { props.addProperty(new Property("model", result.getFirstEntity())); props.addProperty(new Property("ridurl", result.getSecondEntity())); // todo: save also repo info of gid String id = lastrid!=null && lastrid.getGlobalIdentifier()!=null && lastrid.getGlobalIdentifier().getResourceId()!=null && !ResourceIdentifier.isHashGid(lastrid) ? lastrid.getGlobalIdentifier().getResourceId(): null; props.addProperty(new Property("globalrid", id)); } String c = (String)config.getSelectedItem(); if(c!=null) props.addProperty(new Property("config", c)); props.addProperty(new Property("startsuspended", ""+suspend.isSelected())); props.addProperty(new Property("autogenerate", ""+genname.isSelected())); props.addProperty(new Property("number", ""+numcomponents.getValue())); props.addProperty(new Property("name", componentname.getText())); // Cannot get components during shutdown as awt blocks tree lock. for(int i=0; argelems!=null && i<argelems.size() /*&& !Starter.isShutdown()*/; i++) { JTextField valt = (JTextField)arguments.getComponent(i*4+3); props.addProperty(new Property("argument", valt.getText())); } ret.setResult(props); } });
&& !isHashGid(rid)) // Don't save hash ids as contents might change.