rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
ERXEnterpriseObject.DidUpdateProcessor.perform(ec, ec.updatedObjects()); ERXEnterpriseObject.DidDeleteProcessor.perform(ec, ec.deletedObjects()); ERXEnterpriseObject.DidInsertProcessor.perform(ec, ec.insertedObjects());
NSArray insertedObjects = (NSArray)n.userInfo().objectForKey("inserted"); NSArray updatedObjects = (NSArray)n.userInfo().objectForKey("updated"); NSArray deletedObjects = (NSArray)n.userInfo().objectForKey("deleted"); ERXEnterpriseObject.DidUpdateProcessor.perform(ec, updatedObjects); ERXEnterpriseObject.DidDeleteProc...
public void editingContextDidSaveChanges(NSNotification n) { EOEditingContext ec = (EOEditingContext) n.object(); final boolean isNestedEditingContext = ! (ec.parentObjectStore() instanceof EOObjectStoreCoordinator); ERXEnterpriseObject.DidUpdateProcessor.perform(ec, ec.updatedO...
if (ec.insertedObjects().count() > 0 || ec.updatedObjects().count() > 0) {
if (insertedObjects.count() > 0 || updatedObjects.count() > 0) {
public void editingContextDidSaveChanges(NSNotification n) { EOEditingContext ec = (EOEditingContext) n.object(); final boolean isNestedEditingContext = ! (ec.parentObjectStore() instanceof EOObjectStoreCoordinator); ERXEnterpriseObject.DidUpdateProcessor.perform(ec, ec.updatedO...
flushableObjects.addObjectsFromArray(ec.insertedObjects()); flushableObjects.addObjectsFromArray(ec.updatedObjects());
flushableObjects.addObjectsFromArray(insertedObjects); flushableObjects.addObjectsFromArray(updatedObjects);
public void editingContextDidSaveChanges(NSNotification n) { EOEditingContext ec = (EOEditingContext) n.object(); final boolean isNestedEditingContext = ! (ec.parentObjectStore() instanceof EOObjectStoreCoordinator); ERXEnterpriseObject.DidUpdateProcessor.perform(ec, ec.updatedO...
if(_disableTypeCasting) {
if(disableTypeCasting()) {
public String sqlStringForValue(Object v, String kp) { if(_disableTypeCasting) { return super.sqlStringForValue(v,kp); } EOAttribute attribute; int lastDotIdx = kp.lastIndexOf("."); if (lastDotIdx == -1) { attribute = entity().attributeNamed(kp); } els...
return super.sqlStringForValue(v,kp) + "::" + s;
String c = ""; if (attribute.className().equals("String") || attribute.className().equals("java.lang.String")) { c = "'"; } return new StringBuffer(c).append(super.sqlStringForValue(v,kp)).append("'::").append(s).toString();
public String sqlStringForValue(Object v, String kp) { if(_disableTypeCasting) { return super.sqlStringForValue(v,kp); } EOAttribute attribute; int lastDotIdx = kp.lastIndexOf("."); if (lastDotIdx == -1) { attribute = entity().attributeNamed(kp); } els...
&& (current.getCrc() == -1 || current.getCompressedSize() == -1 || current.getSize() == -1))
&& (entry.getCrc() == -1 || entry.getCompressedSize() == -1 || entry.getSize() == -1))
private int write_entry (ZipEntry entry, boolean is_local) throws IOException { long offset = bytes_written; int bytes = put4 (is_local ? 0x04034b50 : 0x02014b50); if (! is_local) bytes += put_version (); bytes += put_version (); boolean crc_after = false; if (is_local && (current.getCrc() ...
jsp.setPreferredSize(new Dimension(400, 100));
jsp.setPreferredSize(new Dimension(550, 200));
public AgentInfoPanel(Experiment experiment, String agentName) { super(); log = CSMART.createLogger(this.getClass().getName()); // Warning: This next line may save the whole experiment ComponentData societyComponentData = experiment.getSocietyComponentData(); if (societyComponentData == null) { ...
if(formName != null)
if(formName != null) {
public void appendAttributesToResponse(WOResponse response, WOContext context) { if(context != null && context instanceof ERXMutableUserInfoHolderInterface && _formName != null) { String formName = (String)_formName.valueInComponent(context.component()); if(formName != null) ...
}
response._appendTagAttributeAndValue("name", formName, false); } }
public void appendAttributesToResponse(WOResponse response, WOContext context) { if(context != null && context instanceof ERXMutableUserInfoHolderInterface && _formName != null) { String formName = (String)_formName.valueInComponent(context.component()); if(formName != null) ...
public void setCurrentHappiness(double hap);
void setCurrentHappiness(double hap);
public void setCurrentHappiness(double hap);
public void setRating(float rate);
void setRating(float rate);
public void setRating(float rate);
public void setTimeCompleted(long time);
void setTimeCompleted(long time);
public void setTimeCompleted(long time);
csmart = this;
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); organizer = new Organizer(this); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); ...
if (cc instanceof Experiment) { experiment = (Experiment)cc; Experiment experimentCopy = organizer.copyExperiment(experiment, false); if (experimentCopy == null) return; SocietyComponent sc = experimentCopy.getSocietyComponent(); if (sc != null) experimentCopy.removeComponent(sc); RecipeComponent[] recipes = experime...
DefaultMutableTreeNode selectedNode = organizer.getSelectedNode(); if (selectedNode.getUserObject() != null && selectedNode.getUserObject().equals(cc)) { DefaultMutableTreeNode parentNode = (DefaultMutableTreeNode)selectedNode.getParent(); if (parentNode.getUserObject() != null && parentNode.getUserObject() instanceof ...
protected void runBuilder(ModifiableComponent cc, boolean alwaysNew) { // note that cc is guaranteed non-null when this is called ModifiableComponent originalComponent = null; Experiment experiment = null; if (cc instanceof Experiment) { experiment = (Experiment)cc; // c...
public List getParameters();
List getParameters();
public List getParameters();
else runAnalyzer();
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); organizer = new Organizer(this); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); ...
else runAnalyzer();
public void actionPerformed(ActionEvent e) { DefaultMutableTreeNode node = organizer.getSelectedNode(); Object userObject = node.getUserObject(); if (userObject instanceof Experiment) runAnalyzer((Experiment)userObject); }
&& CollectionUtils.arrayEquals(array, ((ClassesKey)o).array);
&& CollectionUtils.arrayEquals(array, ((ClassesKey)o).array, GET_CLASS_TRANSFORMER);
public boolean equals(Object o) { return o != null && (o instanceof ClassesKey) && CollectionUtils.arrayEquals(array, ((ClassesKey)o).array); }
while (file != null && !file.equals(root)) {
while (file != null && !file.getAbsolutePath().equals(root.getAbsolutePath())) {
public static List getPathFiles(File root, File file) { List ret = new ArrayList(); while (file != null && !file.equals(root)) { ret.add(file); file = file.getParentFile(); } Collections.reverse(ret); return ret; }
} if (root != null) { ret.add(root);
public static List getPathFiles(File root, File file) { List ret = new ArrayList(); while (file != null && !file.equals(root)) { ret.add(file); file = file.getParentFile(); } Collections.reverse(ret); return ret; }
String port = arguments.getProperty(AGENT_PORT);
String port = arguments.getProperty(AGENT_HTTP_PORT);
private static void setHostToMonitor() { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARUL"); ArrayList potentialHosts = new ArrayList(); ArrayList potentialNodes = new ArrayList(); HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.leng...
log.error("Exception parsing " + AGENT_PORT + " : ", e);
log.error("Exception parsing " + AGENT_HTTP_PORT + " : ", e);
private static void setHostToMonitor() { Logger log = CSMART.createLogger("org.cougaar.tools.csmart.ui.monitor.viewer.CSMARUL"); ArrayList potentialHosts = new ArrayList(); ArrayList potentialNodes = new ArrayList(); HostComponent[] hosts = experiment.getHostComponents(); for (int i = 0; i < hosts.leng...
_failureProperty = failureProperty; }
log("The 'failurepropery' attribute is deprecated. " + "Please use the 'failureproperty' attribute instead", Project.MSG_WARN); setFailureProperty(failureProperty); }
public void setFailurePropery(String failureProperty) { _failureProperty = failureProperty; }
MyKey2 mykey2 = (MyKey2)KeyFactory.create(MyKey2.class);
KeyFactory.Generator gen = new KeyFactory.Generator(); gen.setInterface(MyKey2.class); gen.setHashConstant(17); gen.setHashMultiplier(37); MyKey2 mykey2 = (MyKey2)gen.create();
public void testNested() throws Exception { MyKey2 mykey2 = (MyKey2)KeyFactory.create(MyKey2.class); Object instance = mykey2.newInstance(new int[][]{ { 1, 2 }, { 3, 4 } }); assertTrue(instance.hashCode() == -1836783069); }
assertTrue(instance.hashCode() == -1836783069);
assertTrue(instance.hashCode() == 31914243);
public void testNested() throws Exception { MyKey2 mykey2 = (MyKey2)KeyFactory.create(MyKey2.class); Object instance = mykey2.newInstance(new int[][]{ { 1, 2 }, { 3, 4 } }); assertTrue(instance.hashCode() == -1836783069); }
ERXLocalizer.setCurrentLocalizer(localizer());
public void awake() { super.awake(); ERXExtensions.setSession(this); NSNotificationCenter.defaultCenter().postNotification(SessionWillAwakeNotification, this); WORequest request=context()!=null ? context().request() : null; // ENHANCEME: Should pull all of this browser detection o...
ERXLocalizer.setCurrentLocalizer(localizer);
public void setLanguage(String language) { localizer = ERXLocalizer.localizerForLanguage(language); }
ERXLocalizer.setCurrentLocalizer(null);
public void sleep() { NSNotificationCenter.defaultCenter().postNotification(SessionWillSleepNotification, this); super.sleep(); ERXExtensions.setSession(null); }
getter = o.getClass().getMethod("get" + capitalize(prop),
try { getter = o.getClass().getMethod("get" + capitalize(prop),
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a....
Object val = getter.invoke(o, null);
try { Object val = getter.invoke(o, null);
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a....
return new Object[] {val, getter.getReturnType()};
return new Object[] {val, getter.getReturnType()}; } catch(InvocationTargetException ite) { throw new RuntimeException("Method not called: Property or method '" + prop + "' has thrown an exception.", ite); } catch(IllegalAccessException iae) { throw (InternalError) new InternalError("Non-public method was invoked.")....
private Object[] getProperty(Object o, String prop) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException { // Use the event object when the property name to extract is null. if (prop == null) return new Object[] {o, o.getClass()}; // Isolate the first property name from a....
Object v[] = getProperty(event, property); Object val = v[0]; Class propertyType = (Class) v[1];
Object v[] = getProperty(event, property); Object[] args = new Object[] { v[0] }; Class[] argTypes = new Class[] { initClass((Class) v[1]) }; while(argTypes[0] != null) { try { actionMethod = targetClass.getMethod("set" + capitalize(action), argTypes);
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listen...
Method actionMethod; try { actionMethod = target.getClass().getMethod("set" + capitalize(action), new Class[] {propertyType});
return actionMethod.invoke(target, args);
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listen...
try { actionMethod = target.getClass().getMethod(action, new Class[] {propertyType}); } catch (NoSuchMethodException e1) { if (property == null) { actionMethod = target.getClass().getMethod(action, null); return actionMethod.invoke(target, null); } else throw e1; }
} argTypes[0] = nextClass(argTypes[0]); } argTypes = new Class[] { initClass((Class) v[1]) }; while(argTypes[0] != null) { try { actionMethod = targetClass.getMethod(action, argTypes); return actionMethod.invoke(target, args); } catch (NoSuchMethodException e) { } argTypes[0] = nextClass(argTypes[0]); } thro...
public Object invoke(Object proxy, Method method, Object[] arguments) throws Exception { // Do we actually need the proxy? if (method == null) throw new RuntimeException("Invoking null method"); // Listener methods that weren't specified are ignored. If listenerMethod // is null, then all listen...
Collection results = null; String URLSpec = clusterURL + PSP_PACKAGE + "/" + PSP_id; String agent = URLSpec; if (filter != null) URLSpec = URLSpec + "?operatorPredicate=" + URLEncoder.encode(filter); try { URL url = new URL(URLSpec); URLConnection connection = url.openConnection(); connection.setDoInput(true); connect...
return getCollectionFromCluster(clusterURL, PSP_id, filter, -1);
public static Collection getCollectionFromCluster(String clusterURL, String PSP_id, String filter) { Collection results = null; String URLSpec = clusterURL + PSP_PACKAGE + "/" + PSP_id; String agent = URLSpec; if (filter != null) URLSpec = URLSpec + "?operatorPredicate=" + URLEncode...
Collection results = null; for (int i = 0; i < clusterURLs.size(); i++) { Collection tmp = getCollectionFromCluster((String)clusterURLs.elementAt(i), PSP_id, filter); if (results == null) { results = tmp; } else if (tmp != null) { try { results.addAll(tmp); } catch (Exception e) { System.out.println(e); } } } return re...
return getCollectionFromClusters(clusterURLs, PSP_id, filter, -1);
public static Collection getCollectionFromClusters(Vector clusterURLs, String PSP_id, String filter) { Collection results = null; for (int i = 0; i < clusterURLs.size(); i++) { Collection tmp = getCollectionFromCluster((String)clusterURLs.elementAt(i), PSP_id, filter); if (re...
if (index < aList.count()) { Object item = aList.objectAtIndex(index); setValueForBinding(item, "item"); setValueForBinding(new Integer(currentRow), "row"); setValueForBinding(new Integer(currentCol), "col"); setValueForBinding(new Integer(index), "index"); }
Object item = index < aList.count() ? aList.objectAtIndex(index) : null; setValueForBinding(item, "item"); setValueForBinding(new Integer(currentRow), "row"); setValueForBinding(new Integer(currentCol), "col"); setValueForBinding(new Integer(index), "index");
public void pushItem() { NSArray aList = list(); int index = currentCol+maxColumns()*currentRow; if (index < aList.count()) { Object item = aList.objectAtIndex(index); setValueForBinding(item, "item"); setValueForBinding(new Integer(currentRow), "row"); ...
getProject().addBuildListener(new BuildListener() { private int stackDepth = 0; public void buildFinished(BuildEvent event) { } public void buildStarted(BuildEvent event) { } public void targetStarted(BuildEvent event) { } public void targetFinished(BuildEvent event) { } public void taskStarted(BuildEvent event) { stac...
protected void ensureMessageInitialised() { if (!Message.isInitialised()) { Message.init(new AntMessageImpl(this)); getProject().addBuildListener(new BuildListener() { private int stackDepth = 0; public void buildFinished(BuildEvent event) { } ...
"ScrollBar.shadow", new ColorUIResource(getControlShadow()), "ScrollBar.thumb", new ColorUIResource(getPrimaryControlShadow()), "ScrollBar.thumbDarkShadow", new ColorUIResource(getPrimaryControlDarkShadow()), "ScrollBar.thumbHighlight", new ColorUIResource(getPrimaryControl()),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", new ColorUIResource(getControl()), "Button.border", MetalBorders.getButtonBorder(), "Button.font", getControlTextFont(), "Button.margi...
if (options.objectForKey("evalScripts") == null) { options.setObjectForKey("true", "evalScripts"); }
public NSDictionary createAjaxOptions(WOComponent component) { NSMutableArray ajaxOptionsArray = new NSMutableArray(); ajaxOptionsArray.addObject(new AjaxOption("frequency", AjaxOption.NUMBER)); ajaxOptionsArray.addObject(new AjaxOption("decay", AjaxOption.NUMBER)); ajaxOptionsArray.addObject(new AjaxOption("onLoa...
boolean shouldHandleRequest = wocontext._wasFormSubmitted() && nameInContext.equals(worequest.formValueForKey(AjaxSubmitButton.KEY_AJAX_SUBMIT_BUTTON_NAME));
boolean shouldHandleRequest = !wocontext._wasActionInvoked() && wocontext._wasFormSubmitted() && nameInContext.equals(worequest.formValueForKey(AjaxSubmitButton.KEY_AJAX_SUBMIT_BUTTON_NAME));
public WOActionResults invokeAction(WORequest worequest, WOContext wocontext) { WOActionResults result = null; WOComponent wocomponent = wocontext.component(); String nameInContext = nameInContext(wocontext, wocomponent, this); boolean shouldHandleRequest = wocontext._wasFormSubmitted() && nameInContext.equals(wor...
log.error("Please report seeing Bug 1304: Null RelationshipBase at child spot # " + i + " out of " + container.getChildCount() + " for Asset " + assetData.getUnitName() + " and agent " + agentName + " in assembly " + assemblyID, new Throwable());
log.error("Please report seeing Bug 1304: Null RelationshipBase at child spot # " + i + " out of " + container.getChildCount() + " for Agent " + agentName + " in assembly " + assemblyID, new Throwable());
public ComponentData addComponentData(ComponentData data) { AgentAssetData assetData = new AgentAssetData((AgentComponentData)data); // assetData.setType(((Integer)propAssetType.getValue()).intValue()); assetData.setAssetClass((String)propAssetClass.getValue()); assetData.setUniqueID((String)propUnique...
log.error("Please report seeing Bug 1304: Null Relationship type for relationship at child spot #" + i + " out of " + container.getChildCount() + " for Asset " + assetData.getUnitName() + " and agent " + agentName + " in assembly " + assemblyID, new Throwable());
log.error("Please report seeing Bug 1304: Null Relationship type for relationship at child spot #" + i + " out of " + container.getChildCount() + " for Agent " + agentName + " in assembly " + assemblyID + " where relationship role=" + rel.getProperty(RelationshipBase.PROP_ROLE) + ", and ItemID=" + rel.getProperty(Relat...
public ComponentData addComponentData(ComponentData data) { AgentAssetData assetData = new AgentAssetData((AgentComponentData)data); // assetData.setType(((Integer)propAssetType.getValue()).intValue()); assetData.setAssetClass((String)propAssetClass.getValue()); assetData.setUniqueID((String)propUnique...
} else { throw e;
public void saveChanges() { _EOAssertSafeMultiThreadedAccess("saveChanges()"); boolean wasAutoLocked = autoLock("saveChanges"); savingChanges = true; try { super.saveChanges(); } catch(com.webobjects.eoaccess.EOGeneralAdaptorException e) { Object delegate = d...
for (; ;x.clone().clone())
for (; ;x.foo().foo())
public void aMethod() throws Throwable { for (; ;x.clone().clone()) ; }
+ languages + ":" + ex);
+ languages + ":" + ex, ex);
public void load() { cache.removeAllObjects(); createdKeys.removeAllObjects(); if (log.isDebugEnabled()) log.debug("Loading templates for language: " + language + " for files: " + fileNamesToWatch() + " with search path: " + frameworkSearchPath()); ...
return new FileResource(this, file.path(), file);
return new FileResource(this, file.getPath(), file);
Resource getResource(String name) { try { File file = new File(dir, name).getCanonicalFile(); if (file.exists() && !file.isDirectory()) return new FileResource(this, file.path(), file); } catch (IOException e) { // Fall through... } return null; }
if(_sourceFile.exists() && _lastModified < _sourceFile.lastModified()) { return true;
if(_sourceFile.exists()) { if(classFile() != null && classFile().lastModified() < _sourceFile.lastModified()) { return true; } if(_lastModified < _sourceFile.lastModified()) { return true; }
public boolean needsRefresh() { if(_sourceFile.exists() && _lastModified < _sourceFile.lastModified()) { return true; } return false; }
gl.glFlush();
public void display(GLAutoDrawable drawable) { GL gl = drawable.getGL(); if (mustUpdateBlurOffsets) { updateBlurVertOffset(gl); mustUpdateBlurOffsets = false; } // Take a single step in the cellular automaton // Disable culling gl.glDisable(GL.GL_CULL_FACE); if...
if (h > table.length)
if (h >= table.length)
public Object put (Object key, Object value) { // Rehash is the load factor is too high. if (size * 3 / 2 > table.length) { Object[] old = table; table = new Object[old.length * 2]; Arrays.fill (table, emptyslot); size = 0; for (int i = 0; i < old.length; ++i) { if (old[i] != tombstone && old[i] != ...
initProperties();
super.initProperties();
public void initProperties() { initProperties(); String componentID = name; String componentCategory = "agent"; propName = addProperty(PROP_AGENT_NAME, name, new ConfigurableComponentPropertyAdapter() { public void PropertyValueChanged(PropertyEvent e) { } }); propComponentID = ...
that.propName.equals(that.propName);
this.propName.equals(that.propName);
public boolean equals(Object o) { if (!(o instanceof PropertyKey)) return false; PropertyKey that = (PropertyKey) o; return this.pgName.equals(that.pgName) && that.propName.equals(that.propName); }
substitutions.put(":clone_set_id:", getComponentCloneSetId(data));
private void addComponentDataSubstitutions(ComponentData data) { substitutions.put(":component_name:", sqlQuote(data.getName())); substitutions.put(":component_lib_id:", getComponentLibId(data)); substitutions.put(":component_alib_id:", sqlQuote(getComponentAlibId(data))); substitutions....
if (key1.equals(key)) result = info;
if (key1.equals(key)) { result = info; }
private PropertyInfo getPropertyInfo(String pgName, String propName) throws SQLException { PropertyKey key = new PropertyKey(pgName, propName); PropertyInfo result = (PropertyInfo) propertyInfos.get(key); if (result == null) { Statement stmt = dbConnection.createStatement(); ...
} else if (rs.getBoolean(1)) { } else if (conflictHandler != null) { String query = dbp.getQuery("updateAlibComponent", substitutions); String[] msg = { "You are attempting to redefine alib component: " + id, "using query:", query, "Do you want to overwrite the definition?"
} else { String[] subvars = { ":component_name:", ":component_lib_id:", ":component_category:", ":clone_set_id:"
private void insureAlib() throws SQLException { String id = (String) substitutions.get(":component_alib_id:"); if (alibComponents.contains(id)) return; // Already present // may need to be added insureLib(); ResultSet rs = executeQuery(stmt, dbp.getQuery("checkAlibComponent", subs...
if (isOverwrite(msg)) { executeUpdate(query);
StringBuffer diff = compareQueryResults(rs, subvars); if (diff == null) { } else if (conflictHandler != null) { Object[] msg = { "You are attempting to redefine alib component: " + id, diff, "Do you want to overwrite the definition?" }; if (isOverwrite(msg)) { String query = dbp.getQuery("updateAlibComponent", substit...
private void insureAlib() throws SQLException { String id = (String) substitutions.get(":component_alib_id:"); if (alibComponents.contains(id)) return; // Already present // may need to be added insureLib(); ResultSet rs = executeQuery(stmt, dbp.getQuery("checkAlibComponent", subs...
} else if (rs.getBoolean(1)) { } else if (conflictHandler != null) { String id = (String) substitutions.get(":component_lib_id:"); String query = dbp.getQuery("updateLibComponent", substitutions); String[] msg = { "You are attempting to redefine lib component: " + id, "using query:", query, "Do you want to overwrite t...
} else { String[] subvars = { ":component_category:", ":component_class:", ":insertion_point:"
private void insureLib() throws SQLException { ResultSet rs = executeQuery(stmt, dbp.getQuery("checkLibComponent", substitutions)); if (!rs.next()) { executeUpdate(dbp.getQuery("insertLibComponent", substitutions)); } else if (rs.getBoolean(1)) { // Value is ok } el...
if (isOverwrite(msg)) { executeUpdate(query);
StringBuffer diff = compareQueryResults(rs, subvars); if (diff == null) { } else if (conflictHandler != null) { String id = (String) substitutions.get(":component_lib_id:"); String query = dbp.getQuery("updateLibComponent", substitutions); Object[] msg = { "You are attempting to redefine lib component: " + id, diff, "...
private void insureLib() throws SQLException { ResultSet rs = executeQuery(stmt, dbp.getQuery("checkLibComponent", substitutions)); if (!rs.next()) { executeUpdate(dbp.getQuery("insertLibComponent", substitutions)); } else if (rs.getBoolean(1)) { // Value is ok } el...
PGPropData prop = props[i];
PGPropData prop = props[j];
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":agent_org_class:", sqlQuote(assetData.getAssetClass())); substitutions.put(":agent_lib_name:", sql...
substitutions.put(":pg_attribute_lib_id:", propInfo.getAttributeLibId());
substitutions.put(":pg_attribute_lib_id:", sqlQuote(propInfo.getAttributeLibId()));
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":agent_org_class:", sqlQuote(assetData.getAssetClass())); substitutions.put(":agent_lib_name:", sql...
pstmt.setTimestamp(1, new Timestamp(r.getStartTime())); ResultSet rs = pstmt.executeQuery();
pstmt.setTimestamp(1, new Timestamp(startTime)); ResultSet rs = executeQuery(pstmt, query);
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":agent_org_class:", sqlQuote(assetData.getAssetClass())); substitutions.put(":agent_lib_name:", sql...
pstmt2.executeUpdate(); pstmt2.close();
try { executeUpdate(pstmt2, query); } catch (SQLException e) { System.err.println("SQLException query: " + query); throw e; } finally { pstmt2.close(); }
private void populateAgent(ComponentData data, boolean isAdded) throws SQLException { AgentAssetData assetData = data.getAgentAssetData(); if (assetData == null) return; substitutions.put(":agent_org_class:", sqlQuote(assetData.getAssetClass())); substitutions.put(":agent_lib_name:", sql...
public boolean populateCSMI(ComponentData data, float insertionOrder)
public boolean populateCSMI(ComponentData data)
public boolean populateCSMI(ComponentData data, float insertionOrder) throws SQLException { return populate(data, insertionOrder, csmiAssemblyId); }
return populate(data, insertionOrder, csmiAssemblyId);
return populate(data, 1f, csmiAssemblyId);
public boolean populateCSMI(ComponentData data, float insertionOrder) throws SQLException { return populate(data, insertionOrder, csmiAssemblyId); }
public boolean populateHNA(ComponentData data, float insertionOrder)
public boolean populateHNA(ComponentData data)
public boolean populateHNA(ComponentData data, float insertionOrder) throws SQLException { return populate(data, insertionOrder, hnaAssemblyId); }
return populate(data, insertionOrder, hnaAssemblyId);
return populate(data, 1f, hnaAssemblyId);
public boolean populateHNA(ComponentData data, float insertionOrder) throws SQLException { return populate(data, insertionOrder, hnaAssemblyId); }
log.info("Stored URL: " + redirector.url());
if(log.isDebugEnabled()) { log.debug("Stored URL: " + redirector.url()); }
protected static void storeRedirector(ERXComponentActionRedirector redirector) { synchronized (responses) { NSMutableDictionary sessionRef = (NSMutableDictionary)responses.objectForKey(redirector.sessionID()); if(sessionRef == null) { sessionRef = new NSMutableDictionary(...
return ERXUtilities.booleanValueForBindingOnComponentWithDefault("escapeHTML", this, true);
return ERXValueUtilities.booleanValueWithDefault(valueForBinding("escapeHTML"), true);
public boolean escapeHTML() { return ERXUtilities.booleanValueForBindingOnComponentWithDefault("escapeHTML", this, true); }
_dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(_organisation, _module, _revision), true, true, true);
_dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(_organisation, _module, _revision), true, false, true);
public void endElement(String uri, String localName, String qName) throws SAXException { if ((_organisation != null && _module != null && _revision != null) && _md.getModuleRevisionId() == null) { ModuleRevisionId mrid = ModuleRevisionId.newInstance(_organisation, _module, _revision); ...
_dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(_organisation, _module, _revision), true, true, true);
_dd = new DefaultDependencyDescriptor(_md, ModuleRevisionId.newInstance(_organisation, _module, _revision), true, false, true);
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException { _contextStack.push(qName); if ("optional".equals(qName)) { _optional = true; } else if ("exclusions".equals(qName)) { if (_dd == null) ...
final Map map = new HashMap(); map.put(DI1.class.getName(), new D1()); map.put(DI2.class.getName(), new D2()); Dispatcher callback = new Dispatcher() { public Object loadObject(String className) { return map.get(className);
final Object[] impls = new Object[]{ new Foo() { public String foo() { return "foo1"; } }, new Bar() { public String bar() { return "bar1"; }
public void testSimple() throws Exception { final Map map = new HashMap(); map.put(DI1.class.getName(), new D1()); map.put(DI2.class.getName(), new D2()); Dispatcher callback = new Dispatcher() { public Object loadObject(String className) { return map.get(classN...
Object obj = Enhancer.create(Object.class, new Class[]{ DI1.class, DI2.class }, callback); assertTrue(((DI1)obj).herby().equals("D1")); assertTrue(((DI2)obj).derby().equals("D2"));
Callback[] callbacks = new Callback[]{ new Dispatcher() { public Object loadObject() { return impls[0]; } }, new Dispatcher() { public Object loadObject() { return impls[1]; } } }; Enhancer e = new Enhancer(); e.setInterfaces(new Class[]{ Foo.class, Bar.class }); e.setCallbacks(callbacks); e.setCallbackFilter(new Call...
public void testSimple() throws Exception { final Map map = new HashMap(); map.put(DI1.class.getName(), new D1()); map.put(DI2.class.getName(), new D2()); Dispatcher callback = new Dispatcher() { public Object loadObject(String className) { return map.get(classN...
com.webobjects.appserver._private.WOURLEncoder.WO_URL_ENCODING = "UTF8";
public void installPatches() { if(contextClassName().equals("WOContext")) setContextClassName("er.extensions.ERXWOContext"); ERXCompilerProxy.defaultProxy().setClassForName(ERXWOForm.class, "WOForm"); ERXCompilerProxy.defaultProxy().setClassForName(ERXAnyField.class, "WOAnyField"); ...
organizer.selectExperimentFromDatabase();
CSMART.displayURL(HELP_DOC);
public void actionPerformed(ActionEvent e) { organizer.selectExperimentFromDatabase(); }
organizer.createExperimentFromFile();
CSMART.displayURL(ABOUT_DOC);
public void actionPerformed(ActionEvent e) { organizer.createExperimentFromFile(); }
organizer.createExperimentFromUI();
CSMART.displayURL(ABOUT_DOC);
public void actionPerformed(ActionEvent e) { organizer.createExperimentFromUI(); }
organizer.selectRecipeFromDatabase();
newWorkspace();
public void actionPerformed(ActionEvent e) { organizer.selectRecipeFromDatabase(); }
organizer.newRecipe();
setResultDir();
public void actionPerformed(ActionEvent e) { organizer.newRecipe(); }
newMenuItem.addActionListener(this);
newMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { newWorkspace(); } });
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
newResultsMenuItem.addActionListener(this);
newResultsMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { setResultDir(); } });
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
newExperimentMenu = new JMenu(ActionUtil.NEW_EXPERIMENT_ACTION); for (int i = 0; i < newExperimentActions.length; i++) newExperimentMenu.add(newExperimentActions[i]);
JMenu newExperimentMenu = new JMenu(ActionUtil.NEW_EXPERIMENT_ACTION); for (int i = 0; i < organizer.newExperimentActions.length; i++) newExperimentMenu.add(organizer.newExperimentActions[i]);
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
newRecipeMenu = new JMenu(ActionUtil.NEW_RECIPE_ACTION); for (int i = 0; i < newRecipeActions.length; i++) newRecipeMenu.add(newRecipeActions[i]);
JMenu newRecipeMenu = new JMenu(ActionUtil.NEW_RECIPE_ACTION); for (int i = 0; i < organizer.newRecipeActions.length; i++) newRecipeMenu.add(organizer.newRecipeActions[i]);
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
newFolderMenuItem = new JMenuItem(ActionUtil.NEW_FOLDER_ACTION); newFolderMenuItem.addActionListener(new ActionListener() {
fileMenu.add(new JMenuItem(organizer.newFolderAction)); fileMenu.addSeparator(); fileMenu.add(new JMenuItem(organizer.configureAction)); fileMenu.add(new JMenuItem(organizer.buildExperimentAction)); fileMenu.add(new JMenuItem(organizer.runExperimentAction)); fileMenu.add(new JMenuItem(organizer.duplicateAction)); fileM...
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
organizer.newFolder();
exit();
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
fileMenu.add(newFolderMenuItem); fileMenu.addSeparator(); configureMenuItem = new JMenuItem(ActionUtil.CONFIGURE_ACTION); configureMenuItem.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { organizer.startBuilder(); } }); fileMenu.add(configureMenuItem); buildMenuItem = new JMenuItem...
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
for (int i = 0; i < helpMenuItems.length; i++) { JMenuItem mItem = new JMenuItem(helpMenuItems[i]); mItem.addActionListener(this); helpMenu.add(mItem); }
for (int i = 0; i < helpActions.length; i++) helpMenu.add(new JMenuItem(helpActions[i]));
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
organizer = new Organizer(this); organizer.addTreeSelectionListener(this); organizer.addTreeModelListener(this);
organizer.addTreeSelectionListener(new TreeSelectionListener() { public void valueChanged(TreeSelectionEvent e) { enableCSMARTTools(); } });
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
JButton button = makeButton(views[i], iconFilenames[i]);
JButton button = makeButton(views[i], iconFilenames[i], actions[i]);
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
button.addActionListener(this);
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
NamedFrame.getNamedFrame().addObserver(this);
NamedFrame.getNamedFrame().addObserver(myFrameObserver);
public CSMART() { setTitle("CSMART"); createLog(); // Write initial CSMART info to the log file if (log.isShoutEnabled()) { log.shout(writeDebug()); } resultDir = initResultDir(); JMenuBar menuBar = new JMenuBar(); getRootPane().setJMenuBar(menuBar); // set-up file menu which includes ...
organizer.deleteRecipeFromDatabase(); }
String s = ((AbstractButton)e.getSource()).getActionCommand(); JFrame f = NamedFrame.getNamedFrame().getFrame(s); if (f != null) { f.toFront(); f.setState(Frame.NORMAL); } }
public void actionPerformed(ActionEvent e) { organizer.deleteRecipeFromDatabase(); }
organizer.newFolder();
exit();
public void actionPerformed(ActionEvent e) { organizer.newFolder(); }
organizer.startExperimentBuilder();
JFrame societyMonitorFrame = NamedFrame.getNamedFrame().getToolFrame(SOCIETY_MONITOR); if (societyMonitorFrame == null) runMonitor(); else societyMonitorFrame.toFront();
public void actionPerformed(ActionEvent e) { organizer.startExperimentBuilder(); }
organizer.startConsole();
DefaultMutableTreeNode node = organizer.getSelectedNode(); Object userObject = node.getUserObject(); if (userObject instanceof Experiment) runAnalyzer((Experiment)userObject);
public void actionPerformed(ActionEvent e) { organizer.startConsole(); }
private void enableCSMARTTools() { enableConfigurationTool(ActionUtil.isActionAllowed(ActionUtil.CONFIGURE_ACTION, organizer, false)); enableExperimentTool(ActionUtil.isActionAllowed(ActionUtil.BUILD_ACTION, organizer, false)); enableConsoleTool(ActionUtil.isActionAllowed(ActionUtil.RUN_ACTION, organizer, false));
protected void enableCSMARTTools() { ActionUtil.setActionAllowed(configureButton.getAction(), organizer); ActionUtil.setActionAllowed(buildButton.getAction(), organizer); ActionUtil.setActionAllowed(runButton.getAction(), organizer);
private void enableCSMARTTools() { enableConfigurationTool(ActionUtil.isActionAllowed(ActionUtil.CONFIGURE_ACTION, organizer, false)); enableExperimentTool(ActionUtil.isActionAllowed(ActionUtil.BUILD_ACTION, organizer, false)); enableConsoleTool(ActionUtil.isActionAllowed(ActionUtil.RUN_ACTION, organizer, fa...
private JButton makeButton(String label, String iconFilename) {
private JButton makeButton(String label, String iconFilename, Action action) {
private JButton makeButton(String label, String iconFilename) { // replace spaces in label with <br> so that labels fit on buttons int index = label.indexOf(' '); while (index != -1) { label = label.substring(0, index) + "<br>" + label.substring(index+1); index = label.indexOf(' '); } ...
return new JButton(label, icon);
JButton button = new JButton(action); button.setText(label); button.setIcon(icon); return button;
private JButton makeButton(String label, String iconFilename) { // replace spaces in label with <br> so that labels fit on buttons int index = label.indexOf(' '); while (index != -1) { label = label.substring(0, index) + "<br>" + label.substring(index+1); index = label.indexOf(' '); } ...
if (experiment.getSocietyComponentCount() == 0) { enableConsoleTool(false); return; } if (!experiment.isRunnable()) { if (log.isWarnEnabled()) log.warn("CSMART: WARNING: experiment is not runnable"); enableConsoleTool(false); return; }
protected void runConsole(Experiment experiment) { // TODO: we get here if the user edits an experiment containing // societies and removes all the societies, and then invokes the console if (experiment.getSocietyComponentCount() == 0) { // don't run console and disable it's button enableConsoleToo...
if (experiment != null) runExperimentBuilderWorker(experiment, alwaysNew);
organizer.removeChildren(experiment); JFrame tool = (JFrame)new ExperimentBuilder(this, experiment); addTool(EXPERIMENT_BUILDER, experiment.getExperimentName(), tool);
protected void runExperimentBuilder(Experiment experiment, boolean alwaysNew) { // if this experiment is being edited, then don't edit again if (isExperimentInEditor(experiment)) return; if (!experiment.isEditable()) { // otherwise editability can be overwritten ...
((SocietyBase)societyCopy).setAssemblyId(getAssemblyId()); ((SocietyBase)societyCopy).saveToDatabase();
((SocietyBase)societyCopy).oldAssemblyId = getAssemblyId();
public ModifiableComponent copy(String name) { if (log.isDebugEnabled()) { log.debug("Copying society " + this.getSocietyName() + " with assembly " + getAssemblyId() + " into new name " + name); } ModifiableComponent societyCopy; if (filenames != null) societyCopy = new SocietyFileComponent(nam...