rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
public void nd_aid(RubyId id) { u3 = id; }
public RubyId nd_aid() { return (RubyId)u3; }
public void nd_aid(RubyId id) { u3 = id; }
assertEquals(1, favorites.size());
assertEquals(2, favorites.size());
public void testFavs() throws Exception { FavoriteService fs = (FavoriteService) getBean("favoriteService"); Map favorites = fs.getFavorites(); assertNotNull(favorites); assertEquals(1, favorites.size()); assertEquals("Grey Goose", favorites.get("Dan")); }
Object object = favorites.get("IndecisiveDan"); System.out.println(object.getClass()); assertTrue(object instanceof List); List l = (List) object; assertEquals(2, l.size());
public void testFavs() throws Exception { FavoriteService fs = (FavoriteService) getBean("favoriteService"); Map favorites = fs.getFavorites(); assertNotNull(favorites); assertEquals(1, favorites.size()); assertEquals("Grey Goose", favorites.get("Dan")); }
context.registerTool("testTool", new TestTool());
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context conte...
new XmlMetadataGenerator(this, metaInfDir, destFile), new DocumentationGenerator(this, destFile), new XsdGenerator(this, destFile)
new XmlMetadataGenerator(metaInfDir, destFile), new DocumentationGenerator(destFile), new XsdGenerator(destFile)
public void execute() throws BuildException { if (namespace == null) { throw new BuildException("'namespace' must be specified"); } if (srcDir == null) { throw new BuildException("'srcDir' must be specified"); } if (destFile == null) { throw new Bu...
plugin.setLog(this);
public void execute() throws BuildException { if (namespace == null) { throw new BuildException("'namespace' must be specified"); } if (srcDir == null) { throw new BuildException("'srcDir' must be specified"); } if (destFile == null) { throw new Bu...
public XmlMetadataGenerator(LogFacade log, String metaInfDir, File schema) {
public XmlMetadataGenerator(String metaInfDir, File schema) {
public XmlMetadataGenerator(LogFacade log, String metaInfDir, File schema) { this.metaInfDir = metaInfDir; this.log = log; this.schema = schema; }
this.log = log;
public XmlMetadataGenerator(LogFacade log, String metaInfDir, File schema) { this.metaInfDir = metaInfDir; this.log = log; this.schema = schema; }
public DocumentationGenerator(LogFacade log, File destFile) {
public DocumentationGenerator(File destFile) {
public DocumentationGenerator(LogFacade log, File destFile) { this.destFile = destFile; this.log = log; }
this.log = log;
public DocumentationGenerator(LogFacade log, File destFile) { this.destFile = destFile; this.log = log; }
public XsdGenerator(LogFacade log, File destFile) {
public XsdGenerator(File destFile) {
public XsdGenerator(LogFacade log, File destFile) { this.destFile = destFile; this.log = log; }
this.log = log;
public XsdGenerator(LogFacade log, File destFile) { this.destFile = destFile; this.log = log; }
JUnitXMLHelper.validate(new File(PATH_TO_TEST_OUTPUT, htmlFiles[i]));
JUnitXMLHelper.readXmlFile(new File(PATH_TO_TEST_OUTPUT, htmlFiles[i]), true);
public void testHTMLReportValidity() throws Exception { // Serialize the current coverage data to disk ProjectData.saveGlobalProjectData(); String dataFileName = CoverageDataFileHandler.getDefaultDataFile().getAbsolutePath(); // Then we need to generate the HTML report String[] args = new String[] { "--format", "...
Coverage coverage = CoverageUnmarshaller.parse(coverageData);
CoverageReport coverage = new CoverageReport(coverageData);
public static void main(String[] args) throws Exception { long startTime = System.currentTimeMillis(); LongOpt[] longOpts = new LongOpt[4]; longOpts[0] = new LongOpt("format", LongOpt.REQUIRED_ARGUMENT, null, 'f'); longOpts[1] = new LongOpt("instrumentation", LongOpt.REQUIRED_ARGUMENT, null, 'i'); longOpts[...
connectMenu.remove(item);
public void initialize() { if (Spark.isMac()) { roomListener = new DockRoomListener(); SparkManager.getChatManager().addChatRoomListener(roomListener); // Remove the About Menu Item from the help menu MainWindow mainWindow = SparkManager.getMainWindow(); ...
application.setEnabledPreferencesMenu(true); application.addPreferencesMenuItem();
public void initialize() { if (Spark.isMac()) { roomListener = new DockRoomListener(); SparkManager.getChatManager().addChatRoomListener(roomListener); // Remove the About Menu Item from the help menu MainWindow mainWindow = SparkManager.getMainWindow(); ...
if (f1.exists() != f2.exists() && f1.isFile() != f2.isFile() && f1.isDirectory() != f2.isDirectory())
if (f1.exists() != f2.exists() || f1.isFile() != f2.isFile() || f1.isDirectory() != f2.isDirectory())
public static boolean contentsEqual(File f1, File f2, boolean ignoreWhitespace) throws IOException { if (f1 == f2) return true; if (f1 == null && f2 == null) return true; if (f1 == null || f2 == null) return false; if (f1.exists() != f2.exists() && f1.isFile() != f2.isFile() && f1.isDirectory() != f2.is...
if (_context == null) _context = c.cloneContext();
public MacroTemplate(Context c, Template t){ _template = t; _origContext = c; org.webmacro.util.Pool pool = c.getPool(); _context = (pool==null) ? c.cloneContext() : (Context)c.getPool().get(); }
registerEditor("java.io.File", "org.apache.xbean.spring.context.impl.FileEditor");
public static void registerCustomEditors() { registerEditor("java.net.URI", "org.apache.xbean.spring.context.impl.URIEditor"); registerEditor("javax.management.ObjectName", "org.apache.xbean.spring.context.impl.ObjectNameEditor"); }
throw new ContextException("Foreach: Cannot evaluate limit");
throw new ContextException("#foreach: Cannot evaluate limit");
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (li...
throw new ContextException("Foreach: Cannot evaluate loop start");
throw new ContextException("#foreach: Cannot evaluate loop start");
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (li...
String errorText = "Foreach: Unable to set list index";
String errorText = "#foreach: Unable to set list index";
public void write(FastWriter out, Context context) throws ContextException, IOException { Object l, limit, from; long loopLimit=-1, loopStart=1, loopIndex=0; l = list; while (l instanceof Macro) l = ((Macro) l).evaluate(context); if (limitExpr != null) { limit = limitExpr; while (li...
public Object getArg(int argId, BuildContext bc)
public Object getArg(int argId)
public Object getArg(int argId, BuildContext bc) throws BuildException { if (buildArgs == null) return null; else return buildArgs.getArg(argId, bc); }
else return buildArgs.getArg(argId, bc);
else return buildArgs.getArg(argId);
public Object getArg(int argId, BuildContext bc) throws BuildException { if (buildArgs == null) return null; else return buildArgs.getArg(argId, bc); }
throw new BuildException("Template " + o + " not found: ", ne);
throw new BuildException("#parse: Template " + o + " not found: ", ne);
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object o = builder.getArg(PARSE_TEMPLATE, bc); if (o instanceof Macro) { template = (Macro) o; return this; } else try { return bc.getBroker().get("template", o.toString()...
String warning = "Error reading template: " + fname;
String warning = "#parse: Error reading template: " + fname;
public void write(FastWriter out, Context context) throws ContextException, IOException { String fname = template.evaluate(context).toString(); try { Template tmpl = (Template) context.getBroker().get("template", fname); tmpl.write(out,context); } catch (IOException e) { String warning = "...
String warning = "Template not found: " + fname;
String warning = "#parse: Template not found: " + fname;
public void write(FastWriter out, Context context) throws ContextException, IOException { String fname = template.evaluate(context).toString(); try { Template tmpl = (Template) context.getBroker().get("template", fname); tmpl.write(out,context); } catch (IOException e) { String warning = "...
try { return b.get("url", name).toString(); } catch (ResourceException re) { try {
try { return b.get("url", name).toString(); } catch (Exception e) { URL url = null;
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us ...
return b.get("url", name).toString();
url = b.getResource(name); if (url == null) throw makePropertyException("Resource not found by URL provider or Broker"); URLConnection conn = url.openConnection(); StringBuffer sb = new StringBuffer (); InputStream in = conn.getInputStream(); String enc = conn.getContentEncoding(); if (enc == null) enc = b.getSetting...
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us ...
catch (NullPointerException npe) { throw npe;
catch (IOException ioe) { throw makePropertyException("Error streaming file from: " + url, ioe);
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us ...
catch (Exception e) { throw makePropertyException("Found by Broker, but could not be retrieved", e); } } catch (NullPointerException npe) { throw makePropertyException("Not found by url provider or broker"); } catch (Exception e) { throw makePropertyException("Unexpected exception while getting from Broker", e); } } ca...
}
protected String getFile(Broker b, String name) throws PropertyException { try { return b.get("url", name).toString(); } catch (ResourceException re) { try { try { // The UrlProvider knows, how to do this, // so let him do the work for us ...
LOGGER.debug("addClassData: " + classData.getName()); String parentClassName = getClassNameIgnoreInner(classData.getName()); LOGGER.debug("\tparentClassName = " + parentClassName); String keyName = new ClassData(parentClassName).getBaseName(); LOGGER.debug("\tkeyName = " + keyName); ClassData parent = getClassData(cla...
String sourceFileName = classData.getSourceFileName(); SourceFileData sourceFileData = (SourceFileData)children.get(sourceFileName); if (sourceFileData == null) { sourceFileData = new SourceFileData(sourceFileName); this.children.put(sourceFileName, sourceFileData); } sourceFileData.addClassData(classData);
public void addClassData(ClassData classData) { // this method aggregates data if classData is an inner class // with the data from the top level class that it is contained in LOGGER.debug("addClassData: " + classData.getName()); String parentClassName = getClassNameIgnoreInner(classData.getName()); ...
serviceNotificationErrorCalled = false;
notificationCalled = false;
private void rest() { serviceNotificationErrorCalled = false; }
assertFalse(serviceNotificationErrorCalled); serviceNotificationErrorCalled = true;
assertFalse(notificationCalled); notificationCalled = true;
public void serviceNotificationError(ServiceMonitor serviceMonitor, ServiceEvent serviceEvent, Throwable throwable) { assertFalse(serviceNotificationErrorCalled); serviceNotificationErrorCalled = true; assertSame(SERVICE_MONITOR, serviceMonitor); assertSame(SERVICE_EV...
kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1);
kernelMonitorBroadcaster.addKernelMonitor(kernelMonitors[1]); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitors[1]); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitors[1]);
public void testDoubleAdd() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT,...
assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled());
assertNotificationCorrect();
public void testDoubleAdd() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT,...
kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4);
public void testFireEvent() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBr...
assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled());
assertNotificationCorrect();
public void testFireEvent() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBr...
kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4);
kernelMonitorBroadcaster.serviceNotificationError(SERVICE_MONITOR, SERVICE_EVENT, THROWABLE); assertNotificationCorrect(); for (int i = 0; i < kernelMonitors.length; i++) { MockKernelMonitor kernelMonitor = kernelMonitors[i]; kernelMonitor.rest(); } kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitors[1]);
public void testRemove() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroad...
assertTrue(kernelMonitor1.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor2.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor3.wasServiceNotificationErrorCalled()); assertTrue(kernelMonitor4.wasServiceNotificationErrorCalled()); kernelMonitor1.rest(); kernelMonitor2.rest(); kernelMonitor3.re...
for (int i = 0; i < kernelMonitors.length; i++) { MockKernelMonitor kernelMonitor = kernelMonitors[i]; if (i == 1) { assertFalse(kernelMonitor.wasNotificationCalled()); } else { assertTrue(kernelMonitor.wasNotificationCalled()); } }
public void testRemove() { kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor1); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor2); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor3); kernelMonitorBroadcaster.addKernelMonitor(kernelMonitor4); kernelMonitorBroad...
kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor1);
kernelMonitorBroadcaster.removeKernelMonitor(new MockKernelMonitor("unassociated monitor"));
public void testRemoveUnassociated() { kernelMonitorBroadcaster.removeKernelMonitor(kernelMonitor1); }
kernelMonitors.add(kernelMonitor);
kernelMonitors.addIfAbsent(kernelMonitor);
public void addKernelMonitor(KernelMonitor kernelMonitor) { kernelMonitors.add(kernelMonitor); }
if (forkedJVMDebugPort != null && forkedJVMDebugPort.intValue() > 0) { getJava().createJvmarg().setValue("-Xdebug"); getJava().createJvmarg().setValue("-Xrunjdwp:transport=dt_socket,address=" + forkedJVMDebugPort + ",server=y,suspend=y"); }
public void execute() throws BuildException { CommandLineBuilder builder = null; try { builder = new CommandLineBuilder(); if (dataFile != null) builder.addArg("--datafile", dataFile); if (toDir != null) builder.addArg("--destination", toDir.getAbsolutePath()); // ignoreRegex.setRegex() is never called...
System.out.println(article); rootResource.putMethod(session.getURI(filePath),article);
if(session.getExistence(filePath)){ rootResource.putMethod(filePath,article); } else { rootResource.putMethod(session.getURI(filePath),article); }
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
public static String getArticleYearMonthPath() {
public static String getArticleYearMonthPath(String basePath) {
public static String getArticleYearMonthPath() { IWTimestamp now = new IWTimestamp(); String folderString = ArticleUtil.getArticleRootPath()+"/"+now.getYear()+"/"+now.getDateString("MM"); return folderString; }
String folderString = ArticleUtil.getArticleRootPath()+"/"+now.getYear()+"/"+now.getDateString("MM");
String folderString = basePath+"/"+now.getYear()+"/"+now.getDateString("MM");
public static String getArticleYearMonthPath() { IWTimestamp now = new IWTimestamp(); String folderString = ArticleUtil.getArticleRootPath()+"/"+now.getYear()+"/"+now.getDateString("MM"); return folderString; }
tab.getTitleLabel().setForeground(Color.red);
final JLabel titleLabel = tab.getTitleLabel();
public void makeTabRed(final ChatRoom room) { final int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); Font font = tab.getTitleLabel().getFont(); tab.getTitleLabel().setForeground(Color.red); Font newFont = font.deriveFont...
tab.getTitleLabel().setFont(newFont);
titleLabel.setFont(newFont); titleLabel.setForeground(Color.red);
public void makeTabRed(final ChatRoom room) { final int index = indexOfComponent(room); if (index != -1) { SparkTab tab = getTabAt(index); Font font = tab.getTitleLabel().getFont(); tab.getTitleLabel().setForeground(Color.red); Font newFont = font.deriveFont...
Iterator statusItemIterator = dndList.iterator();
Iterator statusItemIterator = statusList.iterator();
public StatusItem getItemFromPresence(Presence presence) { // Handle offline presence if (presence == null) { return null; } Iterator statusItemIterator = dndList.iterator(); while (statusItemIterator.hasNext()) { StatusItem item = (StatusItem)statusItemItera...
statusItemIterator = dndList.iterator();
statusItemIterator = statusList.iterator();
public StatusItem getItemFromPresence(Presence presence) { // Handle offline presence if (presence == null) { return null; } Iterator statusItemIterator = dndList.iterator(); while (statusItemIterator.hasNext()) { StatusItem item = (StatusItem)statusItemItera...
public NotFoundException(String reason) { super(reason);
public NotFoundException(String reason, Exception e) { super(reason,e);
public NotFoundException(String reason) { super(reason); }
IWApplicationContext iwac = iwuc.getApplicationContext();
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class);
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
slideService.createAllFoldersInPath(articleFolderPath);
boolean hadToCreate = session.createAllFoldersInPath(articleFolderPath);
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
rootResource.proppatchMethod(articleFolderPath,new PropertyName("IW:",CONTENT_TYPE),"LocalizedFile",true);
if(hadToCreate){ String fixedFolderURL = session.getURI(articleFolderPath); rootResource.proppatchMethod(fixedFolderURL,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); } else{ rootResource.proppatchMethod(articleFolderPath,PROPERTY_CONTENT_TYPE,"LocalizedFile",true); }
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
if(session.getExistence(filePath)){ if(!rootResource.putMethod(filePath,article)) { rootResource.putMethod(session.getURI(filePath),article); } } else { if(!rootResource.putMethod(session.getURI(filePath),article)) { rootResource.putMethod(filePath,article); }
if(rootResource.putMethod(filePath,article)){ rootResource.proppatchMethod(filePath,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true);
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
rootResource.proppatchMethod(filePath,new PropertyName("IW:",CONTENT_TYPE),ARTICLE_FILENAME_SCOPE,true);
else{ String fixedURL = session.getURI(filePath); rootResource.putMethod(fixedURL,article); rootResource.proppatchMethod(fixedURL,PROPERTY_CONTENT_TYPE,ARTICLE_FILENAME_SCOPE,true); }
public void store() throws IDOStoreException{ boolean storeOk = true; clearErrorKeys(); if (getHeadline().trim().equals("")) { addErrorKey(KEY_ERROR_HEADLINE_EMPTY); storeOk = false; } if (getBody().trim().equals("")) { addErrorKey(KEY_ERROR_BODY_EMPTY); storeOk = false; } // if (getRequestedStatus() !...
add(buttonPanel, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
add(buttonPanel, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
public ChatToolBar() { buttonPanel = new JPanel(); buttonPanel.setLayout(new FlowLayout(FlowLayout.LEFT)); rightPanel = new JPanel(); rightPanel.setOpaque(false); rightPanel.setLayout(new BorderLayout()); // Set Layout setLayout(new Gr...
chatRoom = (ChatRoomImpl)container.getChatRoom(from);
chatRoom = (ChatRoomImpl)container.getChatRoom(jid);
private void showAlert(Message message) { final String body = message.getBody(); String subject = message.getSubject(); StringBuffer buf = new StringBuffer(); if (subject != null) { buf.append(Res.getString("subject") + ": ").append(subject); buf.append("\n\n"); ...
public String getInput(String title, String description, Icon icon, Component parent) { textArea = new JTextArea(); textArea.setLineWrap(true);
public String getInput(String title, String description, Icon icon, int width, int height) { this.width = width; this.height = height;
public String getInput(String title, String description, Icon icon, Component parent) { textArea = new JTextArea(); textArea.setLineWrap(true); TitlePanel titlePanel = new TitlePanel(title, description, icon, true); // Construct main panel w/ layout. final JPanel mainPanel = new J...
TitlePanel titlePanel = new TitlePanel(title, description, icon, true); final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); mainPanel.add(titlePanel, BorderLayout.NORTH); final Object[] options = {"Ok", "Cancel"}; optionPane = new JOptionPane(new JScrollPane(textArea), JOptionPane.PLAIN_...
return getInput(title, description, icon, SparkManager.getMainWindow());
public String getInput(String title, String description, Icon icon, Component parent) { textArea = new JTextArea(); textArea.setLineWrap(true); TitlePanel titlePanel = new TitlePanel(title, description, icon, true); // Construct main panel w/ layout. final JPanel mainPanel = new J...
public RolloverButton(Icon icon) { super(icon);
public RolloverButton() {
public RolloverButton(Icon icon) { super(icon); decorate(); }
messageEventRequestListener = new ChatMessageEventRequestListener(); SparkManager.getMessageEventManager().addMessageEventRequestListener(messageEventRequestListener);
public ChatRoomImpl(final String participantJID, String participantNickname, String title) { this.participantJID = participantJID; this.participantNickname = participantNickname; AndFilter presenceFilter = new AndFilter(new PacketTypeFilter(Presence.class), new FromContainsFilter(this.participa...
MessageEvent messageEvent = (MessageEvent) message.getExtension("x", "jabber:x:event"); if(messageEvent != null) { checkEvents(message.getFrom(), message.getPacketID(), messageEvent); }
public void insertMessage(Message message) { // Debug info super.insertMessage(message); getTranscriptWindow().insertOthersMessage(participantNickname, message); // Set the participant jid to their full JID. participantJID = message.getFrom(); }
logger.info("Data file does not contain instrumentation "
LOGGER.info("Data file does not contain instrumentation "
private void generateSourceFile(SourceFileData sourceFileData) throws IOException { if (!sourceFileData.containsInstrumentationInfo()) { logger.info("Data file does not contain instrumentation " + "information for the file " + sourceFileData.getName() + ". Ensure this class was instrumented, and this " ...
logger.info("Could not generate HTML file for source file "
LOGGER.info("Could not generate HTML file for source file "
private void generateSourceFiles() { Iterator iter = projectData.getSourceFiles().iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter.next(); try { generateSourceFile(sourceFileData); } catch (IOException e) { logger.info("Could not generate HTML file for sour...
double ccn = 0;
File[] files = finder.findDirectory(packageData.getSourceFileName()); if (files.length == 0) { LOGGER.warn("No directories found for package: " + packageData.getSourceFileName()); } double ccnSum = 0; for (int i = 0; i < files.length; i++) { ccnSum += Util.getCCN(files[i], false); } double ccn = ccnSum / (double) fil...
private String generateTableRowForPackage(PackageData packageData) { StringBuffer ret = new StringBuffer(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; double lineCoverage = -1; double branchCoverage = -1; double ccn = 0;...
compute(); List mine = Collections.EMPTY_LIST; synchronized(this) { mine = new ArrayList(cached); } for (Iterator it = mine.iterator(); it.hasNext(); ) { String path = (String) it.next(); if (path.replace('/', '\\').endsWith(filePart.replace('/', '\\'))) { return new File(path); } } return null; }
compute(); List mine = Collections.EMPTY_LIST; synchronized(this) { mine = new ArrayList(cached); } String tempFilePart = getCorrectedPath(filePart); for (Iterator it = mine.iterator(); it.hasNext(); ) { String path = (String) it.next(); if (path.endsWith(tempFilePart)) { return new File(path); } } return null; }
public File findFile(String filePart) { compute(); List mine = Collections.EMPTY_LIST; synchronized(this) { mine = new ArrayList(cached); } for (Iterator it = mine.iterator(); it.hasNext(); ) { String path = (String) it.next(); if (path.replace('/', '\\').endsWith(filePart.replace('/', '\\'))) { return n...
if (file == null) { return 0; }
public static double getCCN(File file, boolean recursive) { int ccnAccumulator = 0; Vector files = getListOfFiles(file, recursive); if (files.isEmpty()) { logger.warn("Cannot find files to compute CCN, file=" + file.getAbsolutePath() + ", recursive=" + recursive); return 0; } Javancss javancss = new Java...
final protected void registerTool(String name, ContextTool tool)
final public void registerTool(String name, ContextTool tool)
final protected void registerTool(String name, ContextTool tool) throws InvalidContextException { if (_toolbox == null) { _toolbox = new HashMap(); } _toolbox.put(name,tool); }
final protected void registerTools(String tools) {
final public void registerTools(String tools) {
final protected void registerTools(String tools) { Enumeration tenum = new StringTokenizer(tools); while (tenum.hasMoreElements()) { String toolName = (String) tenum.nextElement(); try { Class toolType = Class.forName(toolName); String varName = findToolName(toolName);...
return setLocal(names, value);
return setLocal(names, value) || setTool(names, value);
final public boolean setProperty(final Object[] names, final Object value) throws PropertyException, InvalidContextException { if (names.length == 0) { return false; } else if (_bean == null) { return setLocal(names, value); } else { return PropertyOperator.setProperty(...
return getOperator(instance.getClass()).getProperty(
if (instance == null) { return null; } else { return getOperator(instance.getClass()).getProperty(
static final public Object getProperty( final Context context, final Object instance, final Object[] names, int start) throws PropertyException, SecurityException, InvalidContextException { try { return getOperator(instance.getClass()).getProperty( context,instance...
}
static final public Object getProperty( final Context context, final Object instance, final Object[] names, int start) throws PropertyException, SecurityException, InvalidContextException { try { return getOperator(instance.getClass()).getProperty( context,instance...
if (instance == null) { return false; }
static final public boolean setProperty( final Context context, Object instance, final Object[] names, int start, final Object value) throws PropertyException, SecurityException, InvalidContextException { try { return getOperator(instance.getClass()).setProperty(context,instance...
return new Block(name, finalStrings, finalMacros, ln, cn);
return new Block(name, finalStrings, finalMacros, finalLines, finalCols);
final public Object build(BuildContext bc) throws BuildException { ArrayList strings = new ArrayList((elements.size())); ArrayList macros = new ArrayList((elements.size())); int[] ln = new int[elements.size()]; int[] cn = new int[elements.size()]; Stack iterStack = new Stack(); StringBu...
if (_prof != null) _prof.destroy();
if (_prof != null) { stopTiming(); _prof.destroy(); }
public void clear() { Iterator i = _tools.entrySet().iterator(); while (i.hasNext()) { Map.Entry m = (Map.Entry) i.next(); ContextTool tool = (ContextTool) _toolbox.get(m.getKey()); tool.destroy(m.getValue()); } _tools.clear(); _globals.clear(); _bean = null; ...
cacheEnabled=((Boolean)values[2]).booleanValue();
public void restoreState(FacesContext ctx, Object state) { Object values[] = (Object[]) state; super.restoreState(ctx, values[0]); headlineAsLink=((Boolean)values[1]).booleanValue(); }
Object values[] = new Object[2];
Object values[] = new Object[3];
public Object saveState(FacesContext ctx) { Object values[] = new Object[2]; values[0] = super.saveState(ctx); values[1] = Boolean.valueOf(headlineAsLink); return values; }
values[2] = Boolean.valueOf(cacheEnabled);
public Object saveState(FacesContext ctx) { Object values[] = new Object[2]; values[0] = super.saveState(ctx); values[1] = Boolean.valueOf(headlineAsLink); return values; }
throws ServletException, IOException {
throws IOException {
final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); ...
public void write(String s) throws IOException
public void write(int b) throws IOException
public void write(String s) throws IOException { this.write(s,0,s.length()); }
this.write(s,0,s.length());
if ((_cpos + 1) > CSIZE) cflush(); _cbuf[_cpos] = (char) b; _cpos++;
public void write(String s) throws IOException { this.write(s,0,s.length()); }
System.out.println("WebContext.getResponse() called!");
public final HttpServletResponse getResponse() { return _response; }
HtmlSelectOneMenu searchCategoryMenu = WFUtil.getSelectOneMenu(SEARCH_CATEGORY_ID, ref + "categories", ref + "searchCategoryId"); searchCategoryMenu.setConverter(new IntegerConverter()); p.getChildren().add(searchCategoryMenu);
private UIComponent getSearchPanel() { String ref = LIST_ARTICLES_BEAN_ID + "."; String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(SEARCH_PUBLISHED_FROM_ID); em.addErrorMessage(SEARCH_PUBLISHED_TO_ID); mai...
HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "localeId"); localeMenu.setOnchange("document.forms[0].submit();"); c.add(localeMenu);
private UIComponent getViewArticlePanel() { String ref = ARTICLE_ITEM_BEAN_ID + "."; String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer c = new WFContainer(); c.setStyleAttribute("padding", "10px"); c.setId(VIEW_ARTICLE_PANEL_ID); c.add(WFUtil.getTextVB(ref + "case.publishedFromDate")); c.add(new WFPlainOut...
WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); ContentItemCase caze = new ContentItemCaseBean(); caze.setPublishedFromDate(new Date()); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setCase", caze); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "en"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", "Electronic Reykjavik ...
ArticleItemBean articleItem = new ArticleItemBean(); try { articleItem.load(new File("/Test/article/"+id+".xml")); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "en"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline())+" (id = " + ...
public void processAction(ActionEvent event) { if (event.getComponent().getId().equals(LIST_BUTTON_ID)) { WFUtil.invoke(LIST_ARTICLES_BEAN_ID, "list"); return; } else if (event.getComponent().getId().equals(VIEW_ARTICLE_BACK_BUTTON_ID)) { WFComponentSelector cs = (WFComponentSelector) event.getComponent().find...
WFComponentSelector cs = (WFComponentSelector) event.getComponent().getParent().getParent().getParent().findComponent(DISPLAY_SELECTOR_ID); cs.setSelectedId(LIST_PANEL_ID, false); cs.setSelectedId(VIEW_ARTICLE_PANEL_ID, true);
WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", notNull(articleItem.getHeadline())+" (id = " + id + ")"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setTeaser", notNull(articleItem.getTeaser())); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", notNull(articleItem.getBody())); WFComponentSelector cs = (WFComponentSelec...
public void processAction(ActionEvent event) { if (event.getComponent().getId().equals(LIST_BUTTON_ID)) { WFUtil.invoke(LIST_ARTICLES_BEAN_ID, "list"); return; } else if (event.getComponent().getId().equals(VIEW_ARTICLE_BACK_BUTTON_ID)) { WFComponentSelector cs = (WFComponentSelector) event.getComponent().find...
MenuManager menuBar = new MenuManager(); MenuManager treeContextMenu = new MenuManager();
public DisplayedDocument(Shell shell, Dispatcher dispatcher) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); // SashForm SashForm sashForm = new SashForm(shell, ...
tree.setContextMenu(treeContextMenu); shell.setMenuBar(menuBar.createMenuBar((Decorations) shell));
public DisplayedDocument(Shell shell, Dispatcher dispatcher) { // Shell this.shell = shell; shell.setText("Koala Notes"); shell.setLayout(new FillLayout(SWT.VERTICAL)); // Document document = new Document(); Note root = new Note("root", document, ""); // SashForm SashForm sashForm = new SashForm(shell, ...
Listener contextChangedListener = new Listener(d, MainController.CONTEXT_CHANGED);
public NoteTree(Composite parent, Dispatcher d) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. tree.addListener(SWT.MouseDoubleClick, new ...
tree.addListener(SWT.DefaultSelection, contextChangedListener);
public NoteTree(Composite parent, Dispatcher d) { // Tree and context menu. tree = new Tree(parent, SWT.MULTI); // Text editor for renaming tree nodes. treeEditor = new TreeEditor(tree); treeEditor.grabHorizontal = true; treeEditor.minimumWidth = 50; // Events. tree.addListener(SWT.MouseDoubleClick, new ...
allSubmenusAndActions = new ActionGroupHelper(); addNoteSubmenuAndActions = new ActionGroupHelper(); moveNoteSubmenuAndActions = new ActionGroupHelper(); ungroupedActions = new ActionGroupHelper(); allSubmenusAndActions.add(addNoteSubmenuAndActions); allSubmenusAndActions.add(moveNoteSubmenuAndActions); allSubmenusAn...
public NoteActionGroup(Dispatcher d, NoteTree tree) { this.tree = tree; addNoteAfter = new Action(d, NoteMenuController.ADD_NOTE_AFTER, "&After"); addNoteUnder = new Action(d, NoteMenuController.ADD_NOTE_UNDER, "&Under"); moveNoteLeft = new Action(d, NoteMenuController.MOVE_NOTE_LEFT, "&Left"); moveNoteRight = ne...
public TreeController(DisplayedDocument displayedDocument) { super(displayedDocument);
public TreeController(NoteTree tree, Dispatcher dispatcher) { this.tree = tree; this.dispatcher = dispatcher;
public TreeController(DisplayedDocument displayedDocument) { super(displayedDocument); }
source = source.substring(lastIndex);
source = source.substring(0, lastIndex);
public static long getUrlLastModified(URL u) { String protocol = u.getProtocol(); if (protocol.equals("file")) { // We're going to use the File mechanism instead File f = new File(u.getFile()); return f.lastModified(); } else if (protocol.equals("jar")) { // We'll ...
copyResourceFromJar("percentagesorttype.js", jsOutputDir);
copyResourceFromJar("customsorttypes.js", jsOutputDir);
public static void copy(File destinationDir) throws IOException { File cssOutputDir = new File(destinationDir, "css"); File imagesOutputDir = new File(destinationDir, "images"); File jsOutputDir = new File(destinationDir, "js"); destinationDir.mkdirs(); cssOutputDir.mkdir(); imagesOutputDir.mkdir(); jsOutputDir...
if (files.isEmpty()) { logger.warn("Cannot find files to compute CCN, file=" + file.getAbsolutePath() + ", recursive=" + recursive); return 0; }
public static double getCCN(File file, boolean recursive) { int ccnAccumulator = 0; Vector files = getListOfFiles(file, recursive); Javancss javancss = new Javancss(files); List functionMetrics = javancss.getFunctionMetrics(); if (functionMetrics.size() <= 0) return 0; Iterator iter = functionMetrics.iterator(...
File[] files = file.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".java"); }
File[] files = file.listFiles(new FileFilter() { public boolean accept(File pathname) { return pathname.isDirectory() || pathname.getAbsolutePath().endsWith(".java"); }
private static Vector getListOfFiles(File file, boolean recursive) { Vector ret = new Vector(); if (file.isFile()) { ret.add(file.getAbsolutePath()); } else if (file.isDirectory()) { File[] files = file.listFiles(new FileFilter() { public boolean accept(File pathname) { r...
public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".java"); }
public boolean accept(File pathname) { return pathname.isDirectory() || pathname.getAbsolutePath().endsWith(".java"); }
public boolean accept(File pathname) { return pathname.getAbsolutePath().endsWith(".java"); }
throw new UnsatisfiedConditionsException("Unsatisfied start conditions", serviceName, conditions);
throw new UnsatisfiedConditionsException("Unsatisfied stop conditions", serviceName, conditions);
public boolean waitForUnsatisfiedConditions(ServiceName serviceName, Set conditions) throws UnsatisfiedConditionsException { throw new UnsatisfiedConditionsException("Unsatisfied start conditions", serviceName, conditions); }