bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
WC(final Broker broker) { _broker = broker; try { String tools = (String) _broker.getValue("config","TemplateTools"); Enumeration tenum = new StringTokenizer(tools); while (tenum.hasMoreElements()) { String toolName = (String) tenum.nextElement(); try { Class toolType = Class.forName(toolName); String varName = getToolName(toolName); Object tool = toolType.newInstance(); put(varName,toolType); } catch (ClassNotFoundException ce) { _log.exception(ce); _log.error("Tool class " + toolName + " not found: " + ce); } catch (IllegalAccessException ia) { _log.exception(ia); _log.error("Tool class and methods must be public for " + toolName + ": " + ia); } catch (InstantiationException ie) { _log.exception(ie); _log.error("Tool class " + toolName + " must have a public zero " + "argument or default constructor: " + ie); } } } catch (NotFoundException e) { _log.exception(e); _log.error("Could not locate TemplateTools in config: " + e); } catch (InvalidTypeException e) { _log.exception(e); _log.error("Could not access config: " + e); } }
WC(final Broker broker) { _broker = broker; try { String tools = (String) _broker.getValue("config","TemplateTools"); Enumeration tenum = new StringTokenizer(tools); while (tenum.hasMoreElements()) { String toolName = (String) tenum.nextElement(); try { Class toolType = Class.forName(toolName); String varName = getToolName(toolName); Object tool = toolType.newInstance(); put(varName,tool); } catch (ClassNotFoundException ce) { _log.exception(ce); _log.error("Tool class " + toolName + " not found: " + ce); } catch (IllegalAccessException ia) { _log.exception(ia); _log.error("Tool class and methods must be public for " + toolName + ": " + ia); } catch (InstantiationException ie) { _log.exception(ie); _log.error("Tool class " + toolName + " must have a public zero " + "argument or default constructor: " + ie); } } } catch (NotFoundException e) { _log.exception(e); _log.error("Could not locate TemplateTools in config: " + e); } catch (InvalidTypeException e) { _log.exception(e); _log.error("Could not access config: " + e); } }
1,122,838
final public ContextTool getTool(String name) throws InvalidContextException { try { return (ContextTool) getMacro(name); } catch (ClassCastException ce) { throw new InvalidContextException("Not a tool, " + name + " is a " + name.getClass()); } }
final public ContextTool getTool(String name) throws InvalidContextException { try { return (ContextTool) getMacro(name); } catch (ClassCastException ce) { throw new InvalidContextException("Not a tool, " + name + " is a " + c + ": " + v); } }
1,122,839
final public WebContext clone( final HttpServletRequest req, final HttpServletResponse resp) { try { // want: new local vars, both existing tools tables, no bean, // plus store req and resp somewhere, plus existing broker WebContext wc = (WebContext) clone(null); wc._request = req; wc._response = resp; return wc; } catch (Exception e) { _log.error("Clone not supported on WebContext!"); return null; } }
final public WebContext clone( final HttpServletRequest req, final HttpServletResponse resp) { try { // want: new local vars, both existing tools tables, no bean, // plus store req and resp somewhere, plus existing broker WebContext wc = (WebContext) clone(); wc._request = req; wc._response = resp; return wc; } catch (Exception e) { _log.error("Clone not supported on WebContext!"); return null; } }
1,122,840
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions); if (!instrument) return mv; return mv == null ? null : new MethodInstrumenter(classData, mv, this.myName, name, desc, ignoreRegex); }
public MethodVisitor visitMethod(final int access, final String name, final String desc, final String signature, final String[] exceptions) { MethodVisitor mv = cv.visitMethod(access, name, desc, signature, exceptions); if (!instrument) return mv; return mv == null ? null : new MethodInstrumenter(classData, mv, this.myName, name, desc, ignoreRegexs); }
1,122,841
public MethodInstrumenter(ClassData classData, final MethodVisitor mv, final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp) { super(mv); this.classData = classData; this.ownerClass = owner; this.myName = myName; this.myDescriptor = myDescriptor; this.ignoreRegex = ignoreRegexp; }
public MethodInstrumenter(ClassData classData, final MethodVisitor mv, final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp) { super(mv); this.classData = classData; this.ownerClass = owner; this.myName = myName; this.myDescriptor = myDescriptor; this.ignoreRegex = ignoreRegexp; }
1,122,842
public MethodInstrumenter(ClassData classData, final MethodVisitor mv, final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp) { super(mv); this.classData = classData; this.ownerClass = owner; this.myName = myName; this.myDescriptor = myDescriptor; this.ignoreRegex = ignoreRegexp; }
public MethodInstrumenter(ClassData classData, final MethodVisitor mv, final String owner, final String myName, final String myDescriptor, final Pattern ignoreRegexp) { super(mv); this.classData = classData; this.ownerClass = owner; this.myName = myName; this.myDescriptor = myDescriptor; this.ignoreRegexs = ignoreRegexs; }
1,122,843
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
1,122,844
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
1,122,845
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } int availableRows = testHeadlines.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = start.intValue() + nrOfRows; if (maxRow > availableRows) { maxRow = availableRows; } for (int i = start.intValue(); i < maxRow; i++) { ArticleListBean a = new ArticleListBean(String.valueOf(i), testHeadlines[i], testPublished[i], testAuthors[i], testStatus[i]); if (i == 5) { // set test style red a.setTestStyle("color:red"); } _dataModel.set(a, i); } _dataModel.setRowCount(availableRows); }
1,122,846
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); searchArticlesNode.setVisibleInMenus(false); }
public void addArticleViews(IWBundle bundle){ ContentViewManager cViewManager = ContentViewManager.getInstance(bundle.getApplication()); ViewNode contentNode = cViewManager.getContentNode(); DefaultViewNode articleNode = new DefaultViewNode("article",contentNode); articleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); articleNode.setKeyboardShortcut(new KeyboardShortcut("a")); articleNode.setName("#{localizedStrings['com.idega.block.article']['article']}"); DefaultViewNode createNewArticleNode = new DefaultViewNode("create",articleNode); String jspUri = bundle.getJSPURI("createarticle.jsp"); createNewArticleNode.setJspUri(jspUri); createNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['create_article']}"); DefaultViewNode editNewArticleNode = new DefaultViewNode("edit",articleNode);// editNewArticleNode.setJspUri(bundle.getJSPURI("createarticle.jsp")); editNewArticleNode.setJspUri(bundle.getJSPURI("editarticle.jsp")); editNewArticleNode.setVisibleInMenus(false); editNewArticleNode.setName("#{localizedStrings['com.idega.block.article']['edit']}"); DefaultViewNode listArticlesNode = new DefaultViewNode("list",articleNode); listArticlesNode.setJspUri(bundle.getJSPURI("listarticles.jsp")); listArticlesNode.setName("#{localizedStrings['com.idega.block.article']['list_articles']}"); DefaultViewNode previewArticlesNode = new DefaultViewNode("preview",articleNode); previewArticlesNode.setJspUri(bundle.getJSPURI("previewarticle.jsp")); previewArticlesNode.setVisibleInMenus(false); previewArticlesNode.setName("#{localizedStrings['com.idega.block.article']['preview']}"); DefaultViewNode searchArticlesNode = new DefaultViewNode("search",articleNode); searchArticlesNode.setJspUri(bundle.getJSPURI("searcharticle.jsp")); searchArticlesNode.setName("#{localizedStrings['com.idega.block.article']['search_articles']}"); }
1,122,847
public SortedSet getClasses() { SortedSet classes = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter.next(); classes.addAll(sourceFileData.getChildren()); } return classes; }
public SortedSet getClasses() { SortedSet classes = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter.next(); classes.addAll(sourceFileData.getClasses()); } return classes; }
1,122,848
private static String useGoogleTranslator(String text, TranslationType type) { String response = null; String urlString = "http://translate.google.com/translate_t?text=" + text + "&langpair=" + type.getID(); // disable scripting to avoid requiring js.jar HttpUnitOptions.setScriptingEnabled(false); // create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); // Obtain the google translation page WebRequest webRequest = new GetMethodWebRequest(urlString); // required to prevent a 403 forbidden error from google webRequest.setHeaderField("User-agent", "Mozilla/4.0"); try { WebResponse webResponse = wc.getResponse(webRequest); Element body = (Element)webResponse.getDOM().getDocumentElement().getElementsByTagName("body").item(0); NodeList elems = body.getElementsByTagName("textarea"); response = elems.item(0).getChildNodes().item(0).getNodeValue(); } catch (MalformedURLException e) { Log.error("Could not for url: " + e); } catch (IOException e) { Log.error("Could not get response: " + e); } catch (SAXException e) { Log.error("Could not parse response content: " + e); } return response; }
private static String useGoogleTranslator(String text, TranslationType type) { String response = null; String urlString = "http://translate.google.com/translate_t?text=" + text + "&langpair=" + type.getID(); // disable scripting to avoid requiring js.jar HttpUnitOptions.setScriptingEnabled(false); // create the conversation object which will maintain state for us WebConversation wc = new WebConversation(); // Obtain the google translation page WebRequest webRequest = new GetMethodWebRequest(urlString); // required to prevent a 403 forbidden error from google webRequest.setHeaderField("User-agent", "Mozilla/4.0"); try { WebResponse webResponse = wc.getResponse(webRequest); Element body = (Element)webResponse.getDOM().getDocumentElement().getElementsByTagName("body").item(0); NodeList elems = body.getElementsByTagName("textarea"); response = elems.item(0).getChildNodes().item(0).getNodeValue(); } catch (MalformedURLException e) { Log.error("Could not for url: " + e); } catch (IOException e) { Log.error("Could not get response: " + e); } catch (SAXException e) { Log.error("Could not parse response content: " + e); } return response; }
1,122,850
private String getCorrectedPath(String path) { return path.replace('/', '\\'); }
private String getCorrectedPath(String path) { return path.replace('\\', '/'); }
1,122,851
private void addTransport(final Transport transport) { final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); final JPanel commandPanel = statusBar.getCommandPanel(); final boolean isRegistered = TransportManager.isRegistered(SparkManager.getConnection(), transport); final RolloverButton button = new RolloverButton(); if (!isRegistered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } button.setToolTipText(transport.getInstructions()); commandPanel.add(button); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { if (!isRegistered) { TransportManager.registerWithService(SparkManager.getConnection(), transport.getServiceName()); // Send Presence Presence presence = statusBar.getPresence(); statusBar.changeAvailability(presence); } else { int confirm = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to disable this active transport?", "Disable Transport", JOptionPane.YES_NO_OPTION); if (confirm == JOptionPane.YES_OPTION) { try { TransportManager.unregister(SparkManager.getConnection(), transport.getServiceName()); } catch (XMPPException e1) { e1.printStackTrace(); } } } } }); uiMap.put(transport, button); statusBar.invalidate(); statusBar.validate(); statusBar.repaint(); }
private void addTransport(final Transport transport) { final StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); final JPanel commandPanel = statusBar.getCommandPanel(); final boolean isRegistered = TransportManager.isRegistered(SparkManager.getConnection(), transport); final RolloverButton button = new RolloverButton(); boolean reg = TransportManager.isRegistered(SparkManager.getConnection(), transport); if (!reg) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } button.setToolTipText(transport.getInstructions()); commandPanel.add(button); button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { boolean reg = TransportManager.isRegistered(SparkManager.getConnection(), transport); if (!reg) { TransportManager.registerWithService(SparkManager.getConnection(), transport.getServiceName()); // Send Presence Presence presence = statusBar.getPresence(); statusBar.changeAvailability(presence); } else { int confirm = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to disable this active transport?", "Disable Transport", JOptionPane.YES_NO_OPTION); if (confirm == JOptionPane.YES_OPTION) { try { TransportManager.unregister(SparkManager.getConnection(), transport.getServiceName()); } catch (XMPPException e1) { e1.printStackTrace(); } } } } }); uiMap.put(transport, button); statusBar.invalidate(); statusBar.validate(); statusBar.repaint(); }
1,122,852
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); }
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); }
1,122,853
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }, new PacketTypeFilter(Presence.class)); }
public void initialize() { try { populateTransports(SparkManager.getConnection()); } catch (Exception e) { return; } for (final Transport transport : TransportManager.getTransports()) { addTransport(transport); } SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; Transport transport = TransportManager.getTransport(packet.getFrom()); if (transport != null) { boolean registered = presence != null && presence.getMode() != null; RolloverButton button = uiMap.get(transport); if (!registered) { button.setIcon(transport.getInactiveIcon()); } else { button.setIcon(transport.getIcon()); } } } }
1,122,854
public static void registerWithService(final XMPPConnection con, final String serviceName) { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); final TransportRegistrationPanel regPanel = new TransportRegistrationPanel(serviceName); mainPanel.add(regPanel, BorderLayout.CENTER); final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final RolloverButton registerButton = new RolloverButton("Register", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); buttonPanel.add(registerButton); buttonPanel.add(cancelButton); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // Create Dialog Transport transport = TransportManager.getTransport(serviceName); final JDialog dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), true); dialog.add(mainPanel); dialog.pack(); dialog.setLocationRelativeTo(SparkManager.getMainWindow()); dialog.setSize(400, 200); registerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.setVisible(true); }
public static void registerWithService(final XMPPConnection con, final String serviceName) { final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new BorderLayout()); final TransportRegistrationPanel regPanel = new TransportRegistrationPanel(serviceName); mainPanel.add(regPanel, BorderLayout.CENTER); final JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.RIGHT)); final RolloverButton registerButton = new RolloverButton("Register", null); final RolloverButton cancelButton = new RolloverButton("Cancel", null); buttonPanel.add(registerButton); buttonPanel.add(cancelButton); mainPanel.add(buttonPanel, BorderLayout.SOUTH); // Create Dialog Transport transport = TransportManager.getTransport(serviceName); final JDialog dialog = new JDialog(SparkManager.getMainWindow(), transport.getTitle(), true); dialog.add(mainPanel); dialog.pack(); dialog.setSize(400, 200); registerButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { String username = regPanel.getScreenName(); String password = regPanel.getPassword(); if (!ModelUtil.hasLength(username) || !ModelUtil.hasLength(password)) { JOptionPane.showMessageDialog(mainPanel, "Username and/or Password need to be supplied.", "Registration Error", JOptionPane.ERROR_MESSAGE); return; } try { registerUser(con, serviceName, username, password); // Send updated presence. } catch (XMPPException e1) { JOptionPane.showMessageDialog(mainPanel, "Unable to register with Transport.", "Registration Error", JOptionPane.ERROR_MESSAGE); } dialog.dispose(); } }); cancelButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { dialog.dispose(); } }); dialog.setVisible(true); }
1,122,857
private void createFilesetForDirectory(File dir) { getFileSet(dir); }
private void createFilesetForDirectory(File dir) { FileSet fileSet = getFileSet(dir); fileSet.createInclude().setName("**/*.class"); }
1,122,858
private void processInstrumentationClasspath() { if (includeClassesRegexs.size() == 0) { throw new BuildException("'includeClasses' is required when 'fromClasspath' is used"); } String[] sources = instrumentationClasspath.list(); for (int i = 0; i < sources.length; i++) { File fileOrDir = new File(sources[i]); if (fileOrDir.exists()) { if (fileOrDir.isDirectory()) { createFilesetForDirectory(fileOrDir); } else { addFileToFilesets(fileOrDir); } } } }
private void processInstrumentationClasspath() { if (includeClassesRegexs.size() == 0) { throw new BuildException("'includeClasses' is required when 'instrumentationClasspath' is used"); } String[] sources = instrumentationClasspath.list(); for (int i = 0; i < sources.length; i++) { File fileOrDir = new File(sources[i]); if (fileOrDir.exists()) { if (fileOrDir.isDirectory()) { createFilesetForDirectory(fileOrDir); } else { addFileToFilesets(fileOrDir); } } } }
1,122,859
private void notifyShutdownHooks() { while (!shutdownHooks.isEmpty()) { Runnable hook; synchronized (shutdownHooks) { hook = (Runnable) shutdownHooks.removeFirst(); } try { hook.run(); } catch (Throwable e) { log.warn("Error from kernel shutdown hook", e); } } }
private void notifyShutdownHooks() { while (!shutdownHooks.isEmpty()) { Runnable hook; synchronized (shutdownHooks) { hook = (Runnable) shutdownHooks.removeLast(); } try { hook.run(); } catch (Throwable e) { log.warn("Error from kernel shutdown hook", e); } } }
1,122,860
public Object build(BuildContext bc) throws BuildException { if (directive == null) throw new BuildException("Error instantiating Directive object for #" + desc.name); return directive.build(this, bc); }
public Object build(BuildContext bc) throws BuildException { Directive d; try { d = (Directive) desc.dirClass.newInstance(); } catch (Exception e) { throw new BuildException("Error instantiating Directive object for #" + desc.name); return directive.build(this, bc); }
1,122,861
public Object build(BuildContext bc) throws BuildException { if (directive == null) throw new BuildException("Error instantiating Directive object for #" + desc.name); return directive.build(this, bc); }
public Object build(BuildContext bc) throws BuildException { if (directive == null) throw new BuildException("Error instantiating Directive object for #" + desc.name); }; return d.build(this, bc); }
1,122,862
protected String renderGT() { System.err.println ("render: >"); return "&gt;"; }
protected String renderGT() { return "&gt;"; }
1,122,863
protected String renderLT() { System.err.println ("render: <"); return "&lt;"; }
protected String renderLT() { return "&lt;"; }
1,122,864
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); Class beanType = rootBeanDefinition.getBeanClass(); for (Iterator iterator = lifecycleMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); Class lifecycleInterface = (Class) entry.getKey(); LifecycleMethods value = (LifecycleMethods) entry.getValue(); if (lifecycleInterface.isAssignableFrom(beanType)) { if (rootBeanDefinition.getInitMethodName() == null) { rootBeanDefinition.setInitMethodName(value.initMethodName); } if (rootBeanDefinition.getDestroyMethodName() == null) { rootBeanDefinition.setDestroyMethodName(value.destroyMethodName); } if (rootBeanDefinition.getInitMethodName() != null && rootBeanDefinition.getDestroyMethodName() != null) { return; } } } }
public void visitBeanDefinition(BeanDefinition beanDefinition) throws BeansException { super.visitBeanDefinition(beanDefinition); if (!(beanDefinition instanceof RootBeanDefinition)) { return; } RootBeanDefinition rootBeanDefinition = ((RootBeanDefinition) beanDefinition); Class beanType = rootBeanDefinition.getBeanClass(); for (Iterator iterator = lifecycleMap.entrySet().iterator(); iterator.hasNext();) { Map.Entry entry = (Map.Entry) iterator.next(); Class lifecycleInterface = (Class) entry.getKey(); LifecycleMethods value = (LifecycleMethods) entry.getValue(); if (lifecycleInterface.isAssignableFrom(beanType)) { if (rootBeanDefinition.getInitMethodName() == null) { rootBeanDefinition.setInitMethodName(value.initMethodName); } if (rootBeanDefinition.getDestroyMethodName() == null) { rootBeanDefinition.setDestroyMethodName(value.destroyMethodName); } if (rootBeanDefinition.getInitMethodName() != null && rootBeanDefinition.getDestroyMethodName() != null) { return; } } } }
1,122,865
void visitBeanFactory(ConfigurableListableBeanFactory beanRegistry) throws BeansException;
void visitBeanFactory(ConfigurableListableBeanFactory beanRegistry, Object data) throws BeansException;
1,122,866
public static Date getDate() { synchronized(_clock) { if ((TIME - dateTime) > 1000) { date = new Date(TIME); } return date; } }
public static Date getDate() { synchronized(_clock) { if ((TIME - dateTime) > 1000) { date = new Date(TIME); } return date; } }
1,122,867
public HTMLReport(ProjectData projectData, File outputDir, FileFinder finder) throws Exception { this.destinationDir = outputDir; this.finder = finder; this.projectData = projectData; CopyFiles.copy(outputDir); generatePackageList(); generateSourceFileLists(); generateOverviews(); generateSourceFiles(); }
public HTMLReport(ProjectData projectData, File outputDir, FileFinder finder, ComplexityCalculator complexity) throws Exception { this.destinationDir = outputDir; this.finder = finder; this.projectData = projectData; CopyFiles.copy(outputDir); generatePackageList(); generateSourceFileLists(); generateOverviews(); generateSourceFiles(); }
1,122,868
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 " + "data file contains the instrumentation information."); } String filename = sourceFileData.getNormalizedName() + ".html"; File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); String classPackageName = sourceFileData.getPackageName(); if ((classPackageName != null) && classPackageName.length() > 0) { out.print(sourceFileData.getPackageName() + "."); } out.print(sourceFileData.getBaseName()); out.println("</h5>"); // Output the coverage summary for this class out.println("<p>"); out.println("<table class=\"report\">"); out.println(generateTableHeader("Classes in this File", false)); // TODO: Change this to actually show multiple classes. out.println(generateTableRowForSourceFile(sourceFileData)); out.println("</table>"); out.println("</p>"); // Output this class's source code with syntax and coverage highlighting out.println("<p>"); out .println("<table cellspacing=\"0\" cellpadding=\"0\" class=\"src\">"); BufferedReader br = null; try { File sourceFile = finder.findFile(sourceFileData.getName()); br = new BufferedReader(new FileReader(sourceFile)); String lineStr; JavaToHtml javaToHtml = new JavaToHtml(); int lineNumber = 1; while ((lineStr = br.readLine()) != null) { out.println("<tr>"); if (sourceFileData.isValidSourceLineNumber(lineNumber)) { long numberOfHits = sourceFileData .getHitCount(lineNumber); out.println(" <td class=\"numLineCover\">&nbsp;" + lineNumber + "</td>"); if (numberOfHits > 0) { out .println(" <td class=\"nbHitsCovered\">&nbsp;" + numberOfHits + "</td>"); out .println(" <td class=\"src\"><pre class=\"src\">&nbsp;" + javaToHtml.process(lineStr) + "</pre></td>"); } else { out .println(" <td class=\"nbHitsUncovered\">&nbsp;" + numberOfHits + "</td>"); out .println(" <td class=\"src\"><pre class=\"src\"><span class=\"srcUncovered\">&nbsp;" + javaToHtml.process(lineStr) + "</span></pre></td>"); } } else { out.println(" <td class=\"numLine\">&nbsp;" + lineNumber + "</td>"); out.println(" <td class=\"nbHits\">&nbsp;</td>"); out .println(" <td class=\"src\"><pre class=\"src\">&nbsp;" + javaToHtml.process(lineStr) + "</pre></td>"); } out.println("</tr>"); lineNumber++; } } finally { if (br != null) { br.close(); } } out.println("</table>"); out.println("</p>"); out.println("<div class=\"footer\">"); out .println("Reports generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
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 " + "data file contains the instrumentation information."); } String filename = sourceFileData.getNormalizedName() + ".html"; File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); String classPackageName = sourceFileData.getPackageName(); if ((classPackageName != null) && classPackageName.length() > 0) { out.print(sourceFileData.getPackageName() + "."); } out.print(sourceFileData.getBaseName()); out.println("</h5>"); // Output the coverage summary for this class out.println("<p>"); out.println("<table class=\"report\">"); out.println(generateTableHeader("Classes in this File", false)); // TODO: Change this to actually show multiple classes. out.println(generateTableRowForSourceFile(sourceFileData)); out.println("</table>"); out.println("</p>"); // Output this class's source code with syntax and coverage highlighting out.println("<p>"); out .println("<table cellspacing=\"0\" cellpadding=\"0\" class=\"src\">"); BufferedReader br = null; try { File sourceFile = finder.getFileForSource(sourceFileData.getName()); br = new BufferedReader(new FileReader(sourceFile)); String lineStr; JavaToHtml javaToHtml = new JavaToHtml(); int lineNumber = 1; while ((lineStr = br.readLine()) != null) { out.println("<tr>"); if (sourceFileData.isValidSourceLineNumber(lineNumber)) { long numberOfHits = sourceFileData .getHitCount(lineNumber); out.println(" <td class=\"numLineCover\">&nbsp;" + lineNumber + "</td>"); if (numberOfHits > 0) { out .println(" <td class=\"nbHitsCovered\">&nbsp;" + numberOfHits + "</td>"); out .println(" <td class=\"src\"><pre class=\"src\">&nbsp;" + javaToHtml.process(lineStr) + "</pre></td>"); } else { out .println(" <td class=\"nbHitsUncovered\">&nbsp;" + numberOfHits + "</td>"); out .println(" <td class=\"src\"><pre class=\"src\"><span class=\"srcUncovered\">&nbsp;" + javaToHtml.process(lineStr) + "</span></pre></td>"); } } else { out.println(" <td class=\"numLine\">&nbsp;" + lineNumber + "</td>"); out.println(" <td class=\"nbHits\">&nbsp;</td>"); out .println(" <td class=\"src\"><pre class=\"src\">&nbsp;" + javaToHtml.process(lineStr) + "</pre></td>"); } out.println("</tr>"); lineNumber++; } } finally { if (br != null) { br.close(); } } out.println("</table>"); out.println("</p>"); out.println("<div class=\"footer\">"); out .println("Reports generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
1,122,870
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 = packageData.getCCN(finder); if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getNumberOfChildren() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
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 = complexity.getCCNForPackage(packageData); if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getNumberOfChildren() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
1,122,871
private String generateTableRowForSourceFile(SourceFileData sourceFileData) { StringBuffer ret = new StringBuffer(); double lineCoverage = -1; double branchCoverage = -1; File file = finder.findFile(sourceFileData.getName()); if (file == null) { System.out.println("FILE IS NULL: " + sourceFileData.getName()); } double ccn = Util.getCCN(file, false); if (sourceFileData.getNumberOfValidLines() > 0) lineCoverage = sourceFileData.getLineCoverageRate(); if (sourceFileData.getNumberOfValidBranches() > 0) branchCoverage = sourceFileData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a></td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
private String generateTableRowForSourceFile(SourceFileData sourceFileData) { StringBuffer ret = new StringBuffer(); double lineCoverage = -1; double branchCoverage = -1; File file = finder.findFile(sourceFileData.getName()); if (file == null) { System.out.println("FILE IS NULL: " + sourceFileData.getName()); } double ccn = Util.getCCN(file, false); if (sourceFileData.getNumberOfValidLines() > 0) lineCoverage = sourceFileData.getLineCoverageRate(); if (sourceFileData.getNumberOfValidBranches() > 0) branchCoverage = sourceFileData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a></td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
1,122,872
private String generateTableRowForTotal() { StringBuffer ret = new StringBuffer(); double lineCoverage = -1; double branchCoverage = -1; double ccnSum = 0; int count = 0; for (Iterator it = finder.getBaseDirectories().iterator(); it.hasNext(); ) { File basedir = (File) it.next(); ccnSum += Util.getCCN(basedir.getAbsoluteFile(), true); count++; } double ccn = ccnSum / (double) count; if (projectData.getNumberOfValidLines() > 0) lineCoverage = projectData.getLineCoverageRate(); if (projectData.getNumberOfValidBranches() > 0) branchCoverage = projectData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><b>All Packages</b></td>"); ret.append("<td class=\"value\">" + projectData.getNumberOfSourceFiles() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
private String generateTableRowForTotal() { StringBuffer ret = new StringBuffer(); double lineCoverage = -1; double branchCoverage = -1; double ccnSum = 0; int count = 0; for (Iterator it = finder.getBaseDirectories().iterator(); it.hasNext(); ) { File basedir = (File) it.next(); ccnSum += Util.getCCN(basedir.getAbsoluteFile(), true); count++; } double ccn = ccnSum / (double) count; if (projectData.getNumberOfValidLines() > 0) lineCoverage = projectData.getLineCoverageRate(); if (projectData.getNumberOfValidBranches() > 0) branchCoverage = projectData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><b>All Packages</b></td>"); ret.append("<td class=\"value\">" + projectData.getNumberOfSourceFiles() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
1,122,873
private void moveToOfflineGroup(String bareJID) { final Iterator groupIterator = new ArrayList(groupList).iterator(); while (groupIterator.hasNext()) { final ContactGroup group = (ContactGroup)groupIterator.next(); final ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.showUserGoingOfflineOnline(); item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON)); group.fireContactGroupUpdated(); int numberOfMillisecondsInTheFuture = 3000; Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { item.setPresence(null); // Check for ContactItemHandler. group.removeContactItem(item); checkGroup(group); if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } }, timeToRun); } } }
private void moveToOfflineGroup(final String bareJID) { final Iterator groupIterator = new ArrayList(groupList).iterator(); while (groupIterator.hasNext()) { final ContactGroup group = (ContactGroup)groupIterator.next(); final ContactItem item = group.getContactItemByJID(bareJID); if (item != null) { item.showUserGoingOfflineOnline(); item.setIcon(SparkRes.getImageIcon(SparkRes.CLEAR_BALL_ICON)); group.fireContactGroupUpdated(); int numberOfMillisecondsInTheFuture = 3000; Date timeToRun = new Date(System.currentTimeMillis() + numberOfMillisecondsInTheFuture); Timer timer = new Timer(); timer.schedule(new TimerTask() { public void run() { item.setPresence(null); // Check for ContactItemHandler. group.removeContactItem(item); checkGroup(group); if (offlineGroup.getContactItemByJID(item.getFullJID()) == null) { offlineGroup.addContactItem(item); offlineGroup.fireContactGroupUpdated(); } } }, timeToRun); } } }
1,122,874
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, final JFrame parent) { if (parents.get(parent) == null) { parents.put(parent, parent.getGlassPane()); } final Component glassPane = (Component)parents.get(parent); parent.setGlassPane(glassPane); final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
1,122,877
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
1,122,878
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
1,122,879
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
1,122,880
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 50, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
1,122,881
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
1,122,882
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { } } }); contactField.setText(contact); }
1,122,883
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { window.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); window.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { window.dispose(); } } }); contactField.setText(contact); }
public void searchContacts(String contact, JFrame parent) { final Map contactMap = new HashMap(); final Set contacts = new HashSet(); final ContactList contactList = SparkManager.getWorkspace().getContactList(); Iterator groups = contactList.getContactGroups().iterator(); while (groups.hasNext()) { ContactGroup group = (ContactGroup)groups.next(); Iterator contactItems = group.getContactItems().iterator(); while (contactItems.hasNext()) { ContactItem item = (ContactItem)contactItems.next(); if (contactMap.get(item.getNickname()) == null) { contacts.add(item); contactMap.put(item.getNickname(), item); } } } if (window != null) { parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); } window = new JWindow(parent); final JContactItemField contactField = new JContactItemField(new ArrayList(contacts)); JPanel layoutPanel = new JPanel(); layoutPanel.setLayout(new GridBagLayout()); window.setLayout(new BorderLayout()); JLabel enterLabel = new JLabel(Res.getString("label.contact.to.find")); enterLabel.setFont(new Font("dialog", Font.BOLD, 10)); layoutPanel.add(enterLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 5), 0, 0)); layoutPanel.add(contactField, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 200, 0)); layoutPanel.setBorder(BorderFactory.createBevelBorder(0)); window.add(layoutPanel); window.pack(); window.setLocationRelativeTo(parent); window.setVisible(true); window.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); } } }); contactField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ENTER) { if (ModelUtil.hasLength(contactField.getText())) { ContactItem item = (ContactItem)contactMap.get(contactField.getText()); if (item != null) { SparkManager.getChatManager().activateChat(item.getFullJID(), item.getNickname()); parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); } } } else if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { parent.setGlassPane(glassPane); parent.getGlassPane().setVisible(false); contactField.dispose(); } } }); contactField.setText(contact); }
1,122,884
public ArticleListViewer() { super(); setBeanIdentifier(ARTICLE_LIST_BEAN); setResourcePath(DEFAULT_RESOURCE_PATH); }
public ArticleListViewer() { super(); setBeanIdentifier(ARTICLE_LIST_BEAN); setBaseFolderPath(DEFAULT_RESOURCE_PATH); }
1,122,886
private Object[] extractConstructorArgs(Map propertyValues, Class[] constructorArgTypes) { Object[] parameters = new Object[constructorArgNames.length]; for (int i = 0; i < constructorArgNames.length; i++) { String name = constructorArgNames[i]; Class type = constructorArgTypes[i]; Object value; if (propertyValues.containsKey(name)) { value = propertyValues.remove(name); if (!isInstance(type, value) && !isConvertable(type, value)) { throw new ConstructionException("Invalid and non-convertable constructor parameter type: " + "name=" + name + ", " + "index=" + i + ", " + "expected=" + Classes.getClassName(type, true) + ", " + "actual=" + Classes.getClassName(value, true)); } value = convert(type, value); } else { value = getDefaultValue(type); } parameters[i] = value; } return parameters; }
private Object[] extractConstructorArgs(Map propertyValues, Class[] constructorArgTypes) { Object[] parameters = new Object[constructorArgNames.length]; for (int i = 0; i < constructorArgNames.length; i++) { Property name = new Property(constructorArgNames[i]); Class type = constructorArgTypes[i]; Object value; if (propertyValues.containsKey(name)) { value = propertyValues.remove(name); if (!isInstance(type, value) && !isConvertable(type, value)) { throw new ConstructionException("Invalid and non-convertable constructor parameter type: " + "name=" + name + ", " + "index=" + i + ", " + "expected=" + Classes.getClassName(type, true) + ", " + "actual=" + Classes.getClassName(value, true)); } value = convert(type, value); } else { value = getDefaultValue(type); } parameters[i] = value; } return parameters; }
1,122,887
public Object getProperty(String name) { if (name == null) throw new NullPointerException("name is null"); Object value = properties.get(name); return value; }
public Object getProperty(String name) { if (name == null) throw new NullPointerException("name is null"); Object value = properties.get(name); return value; }
1,122,888
public String[] getToolbarActions(){ return ACTION_ARRAY; }
public String[] getToolbarActions(){ return super.getToolbarActions(); }
1,122,889
public void visitMethodInsn(int opcode, String owner, String name, String desc) { super.visitMethodInsn(opcode, owner, name, desc); if ((ignoreRegex != null) && (pm.matches(owner, ignoreRegex))) classData.removeLine(currentLine); }
public void visitMethodInsn(int opcode, String owner, String name, String desc) { super.visitMethodInsn(opcode, owner, name, desc); if ((ignoreRegex != null) && (pm.matches(owner, ignoreRegex))) classData.removeLine(currentLine); }
1,122,890
public void addNoteTab(DisplayedNote displayedNote) { new NoteTab(tabFolder, l, displayedNote); }
public void addNoteTab(DisplayedNote displayedNote) { new NoteTab(tabFolder, l, displayedNote); }
1,122,891
public NoteTab(final CTabFolder parent, Listener l, DisplayedNote displayedNote) { this.displayedNote = displayedNote; tabItem = new CTabItem(parent, SWT.NONE); tabItem.setText(displayedNote.getName()); tabItem.setData(this); text = new Text(parent, SWT.NONE); text.setText(displayedNote.getNote().getText()); tabItem.setControl(text); displayedNote.setTab(this); select(); l.mapEvent(tabItem, SWT.Dispose, MainController.CLOSE_TAB); }
public NoteTab(final CTabFolder parent, Listener l, DisplayedNote displayedNote) { this.displayedNote = displayedNote; tabItem = new CTabItem(parent, SWT.NONE); tabItem.setText(displayedNote.getName()); tabItem.setData(this); tabItem.addDisposeListener(this); text = new Text(parent, SWT.MULTI | SWT.WRAP); text.setText(displayedNote.getNote().getText()); tabItem.setControl(text); displayedNote.setTab(this); select(); l.mapEvent(tabItem, SWT.Dispose, MainController.CLOSE_TAB); }
1,122,892
public NoteTab(final CTabFolder parent, Listener l, DisplayedNote displayedNote) { this.displayedNote = displayedNote; tabItem = new CTabItem(parent, SWT.NONE); tabItem.setText(displayedNote.getName()); tabItem.setData(this); text = new Text(parent, SWT.NONE); text.setText(displayedNote.getNote().getText()); tabItem.setControl(text); displayedNote.setTab(this); select(); l.mapEvent(tabItem, SWT.Dispose, MainController.CLOSE_TAB); }
public NoteTab(final CTabFolder parent, Listener l, DisplayedNote displayedNote) { this.displayedNote = displayedNote; tabItem = new CTabItem(parent, SWT.NONE); tabItem.setText(displayedNote.getName()); tabItem.setData(this); text = new Text(parent, SWT.NONE); text.setText(displayedNote.getNote().getText()); tabItem.setControl(text); displayedNote.setTab(this); select(); }
1,122,893
public void processAction(ActionEvent event) { UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", "headline"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", "author"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", "comment"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", "description"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setSource", "source"); if (link.getId().equals(ArticleListBean.ARTICLE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_PUBLISHED); } else { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_UNDER_REVIEW); } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); ab.updateEditButtons(); }
public void processAction(ActionEvent event) { UIComponent link = event.getComponent(); String id = WFUtil.getParameter(link, "id"); WFTabBar tb = (WFTabBar) link.getParent().getParent().getParent().findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLocaleId", "sv"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setHeadline", "headline"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setBody", id); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setAuthor", "author"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setComment", "comment"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setDescription", "description"); WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setSource", "source"); if (link.getId().equals(ArticleListBean.ARTICLE_ID)) { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_PUBLISHED); } else { WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setStatus", ContentItemCase.STATUS_UNDER_REVIEW); } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setMainCategoryId", new Integer(3)); ab.updateEditButtons(); }
1,122,894
public void setEditMode() { WFTabBar tb = (WFTabBar) findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); }
public void setEditMode() { WFTabBar tb = (WFTabBar) findComponent(MAIN_TASKBAR_ID); tb.setSelectedButtonId(TASK_ID_EDIT); ArticleBlock ab = (ArticleBlock) tb.findComponent(ArticleBlock.ARTICLE_BLOCK_ID); ab.setEditMode(); }
1,122,895
public static final int random(int start, int end) { return start + (int) (end *java.lang.Math.random()/(Integer.MAX_VALUE+1.0)); }
public static final int random(int start, int end) { return start + (int)((end - start + 1) * java.lang.Math.random()); }
1,122,896
public Object init(Context context) throws PropertyException { try { WebContext wc = (WebContext) context; CGI_Impersonator cgi = new CGI_Impersonator(wc.getRequest()); return cgi; } catch (ClassCastException ce) { throw new PropertyException( "CGITool only works with WebContext", ce); } }
public Object init(Context context) throws PropertyException { try { WebContext wc = (WebContext) context; CGI_Impersonator cgi = new CGI_Impersonator(wc); return cgi; } catch (ClassCastException ce) { throw new PropertyException( "CGITool only works with WebContext", ce); } }
1,122,897
CGI_Impersonator(final HttpServletRequest r) { requst_ = r; }
CGI_Impersonator(final HttpServletRequest r) { requst_ = r; }
1,122,898
private UIComponent getDetailPanel() { WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(1); //Add the detailed info p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.getHeaderTextVB(ref + "headline")); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.getTextVB(ref + "teaser")); p.getChildren().add(WFUtil.getText(" ")); WFPlainOutputText bodyText = new WFPlainOutputText(); WFUtil.setValueBinding(bodyText, "value", ref + "body"); p.getChildren().add(bodyText); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(new WFPlainOutputText("<hr/>")); UIComponent g = WFUtil.group(localizer.getHeaderTextVB("author"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "author")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("created"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "creationDate")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); HtmlOutputText t = WFUtil.getTextVB(ref + "categoryNames"); t.setConverter(new WFCommaSeparatedListConverter()); g = WFUtil.group(localizer.getHeaderTextVB("categories"), WFUtil.getHeaderText(": ")); g.getChildren().add(t); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getHeaderText(": "));// g.getChildren().add(WFUtil.getTextVB(ref + "versionId")); g.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("comment"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "comment")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("source"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "source")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); WebDAVFileDetails details = new WebDAVFileDetails(); WFUtil.setValueBinding(details,"currentResourcePath",ref+"resourcePath"); p.getChildren().add(details); return p; }
private UIComponent getDetailPanel() { WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(1); //Add the detailed info p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.getHeaderTextVB(ref + "headline")); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.getTextVB(ref + "teaser")); p.getChildren().add(WFUtil.getText(" ")); WFPlainOutputText bodyText = new WFPlainOutputText(); WFUtil.setValueBinding(bodyText, "value", ref + "body"); p.getChildren().add(bodyText); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(new WFPlainOutputText("<hr/>")); UIComponent g = WFUtil.group(localizer.getHeaderTextVB("author"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "author")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("created"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "creationDate")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); HtmlOutputText t = WFUtil.getTextVB(ref + "categoryNames"); t.setConverter(new WFCommaSeparatedListConverter()); g = WFUtil.group(localizer.getHeaderTextVB("categories"), WFUtil.getHeaderText(": ")); g.getChildren().add(t); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("current_version"), WFUtil.getHeaderText(": "));// g.getChildren().add(WFUtil.getTextVB(ref + "versionId")); g.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("comment"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "comment")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); g = WFUtil.group(localizer.getHeaderTextVB("source"), WFUtil.getHeaderText(": ")); g.getChildren().add(WFUtil.getTextVB(ref + "source")); p.getChildren().add(g); p.getChildren().add(WFUtil.getText(" ")); WebDAVFileDetails details = new WebDAVFileDetails(); WFUtil.setValueBinding(details,"currentResourcePath",ref+"resourcePath"); p.getChildren().add(details); return p; }
1,122,901
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("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[2] = new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'); longOpts[3] = new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'); Getopt g = new Getopt(Main.class.getName(), args, ":f:d:o:s:", longOpts); int c; while ((c = g.getopt()) != -1) { switch (c) { case 'f': format = new String(g.getOptarg()); if (!format.equalsIgnoreCase("html") && !format.equalsIgnoreCase("xml")) { throw new Exception("Error: format \"" + format + "\" must be either html or xml"); } break; case 'd': dataFile = new File(g.getOptarg()); if (!dataFile.exists()) { throw new Exception("Error: data file " + dataFile.getAbsolutePath() + " does not exist"); } if (dataFile.isDirectory()) { throw new Exception("Error: data file " + dataFile.getAbsolutePath() + " cannot be a directory"); } break; case 'o': outputDir = new File(g.getOptarg()); if (outputDir.exists() && outputDir.isFile()) { throw new Exception("Error: destination directory " + outputDir + " already exists and is a file"); } outputDir.mkdirs(); break; case 's': sourceDir = new File(g.getOptarg()); if (!sourceDir.exists()) { throw new Exception("Error: source directory " + sourceDir + " does not exist"); } if (sourceDir.isFile()) { throw new Exception("Error: source directory " + sourceDir + " should be a directory, not a file"); } break; } } if (logger.isDebugEnabled()) { logger.debug("format is " + format); logger.debug("dataFile is " + dataFile.getAbsolutePath()); logger.debug("outputDir is " + outputDir.getAbsolutePath()); logger.debug("sourceDir is " + sourceDir.getAbsolutePath()); } if (dataFile == null) dataFile = new File(CoverageDataFileHandler.FILE_NAME); ProjectData projectData = CoverageDataFileHandler .loadCoverageData(dataFile); if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, outputDir, sourceDir); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, outputDir, sourceDir); } long stopTime = System.currentTimeMillis(); System.out .println("Reporting time: " + (stopTime - startTime) + "ms"); }
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("datafile", LongOpt.REQUIRED_ARGUMENT, null, 'd'); longOpts[2] = new LongOpt("output", LongOpt.REQUIRED_ARGUMENT, null, 'o'); longOpts[3] = new LongOpt("source", LongOpt.REQUIRED_ARGUMENT, null, 's'); Getopt g = new Getopt(Main.class.getName(), args, ":f:d:o:s:", longOpts); int c; while ((c = g.getopt()) != -1) { switch (c) { case 'f': format = g.getOptarg(); if (!format.equalsIgnoreCase("html") && !format.equalsIgnoreCase("xml")) { throw new Exception("Error: format \"" + format + "\" must be either html or xml"); } break; case 'd': dataFile = new File(g.getOptarg()); if (!dataFile.exists()) { throw new Exception("Error: data file " + dataFile.getAbsolutePath() + " does not exist"); } if (dataFile.isDirectory()) { throw new Exception("Error: data file " + dataFile.getAbsolutePath() + " cannot be a directory"); } break; case 'o': outputDir = new File(g.getOptarg()); if (outputDir.exists() && outputDir.isFile()) { throw new Exception("Error: destination directory " + outputDir + " already exists and is a file"); } outputDir.mkdirs(); break; case 's': sourceDir = new File(g.getOptarg()); if (!sourceDir.exists()) { throw new Exception("Error: source directory " + sourceDir + " does not exist"); } if (sourceDir.isFile()) { throw new Exception("Error: source directory " + sourceDir + " should be a directory, not a file"); } break; } } if (logger.isDebugEnabled()) { logger.debug("format is " + format); logger.debug("dataFile is " + dataFile.getAbsolutePath()); logger.debug("outputDir is " + outputDir.getAbsolutePath()); logger.debug("sourceDir is " + sourceDir.getAbsolutePath()); } if (dataFile == null) dataFile = new File(CoverageDataFileHandler.FILE_NAME); ProjectData projectData = CoverageDataFileHandler .loadCoverageData(dataFile); if (format.equalsIgnoreCase("html")) { new HTMLReport(projectData, outputDir, sourceDir); } else if (format.equalsIgnoreCase("xml")) { new XMLReport(projectData, outputDir, sourceDir); } long stopTime = System.currentTimeMillis(); System.out .println("Reporting time: " + (stopTime - startTime) + "ms"); }
1,122,902
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
1,122,903
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(articleOut); } }
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); ByteArrayInputStream bais = new ByteArrayInputStream(body.getBytes()); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); String articleOut = baos.toString();// System.out.println("ArticleOut = "+articleOut); setBody(body); } }
1,122,904
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
1,122,905
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) return (Block) builder.getArg(IF_BLOCK, bc); elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount; if (cMacro) ++nConditions; conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
1,122,906
public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } // cool we are registered serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to notify everyone we just started if (!serviceFactory.isRestartable()) { serviceMonitor.serviceRunning(createServiceEvent()); } }
public void initialize() throws IllegalServiceStateException, UnsatisfiedConditionsException, Exception { // if we are not restartable, we need to start immediately, otherwise we are not going to register this service if (!serviceFactory.isRestartable()) { try { start(false, StartStrategies.UNREGISTER); } catch (UnregisterServiceException e) { Throwable cause = e.getCause(); if (cause instanceof Exception) { throw (Exception) cause; } else if (cause instanceof Error) { throw (Error) cause; } else { throw new AssertionError(cause); } } // a non restartable service uses a special stop conditions object that picks up stop conditions as they // are added. When the stop() method is called on a non-restartable service all of the stop conditions // registered with the service factory are initialized (if not already initialized), and the isSatisfied // method is called. This should cause the stop logic of a stop condition to fire. lock("initialize"); try { stopConditions = new NonRestartableStopConditions(kernel, serviceName, classLoader, serviceFactory.getStartConditions(), lock, serviceFactory); } finally { unlock(); } } // cool we are registered serviceMonitor.serviceRegistered(createServiceEvent()); // if we are not restartable, we need to notify everyone we just started if (!serviceFactory.isRestartable()) { serviceMonitor.serviceRunning(createServiceEvent()); } }
1,122,908
public void destroy() throws KernelErrorsError { // we gather all errors that occur during shutdown and throw them as on huge exception List errors = new ArrayList(); List managerFutures; synchronized (serviceManagers) { managerFutures = new ArrayList(); serviceManagers.clear(); } List managers = new ArrayList(managerFutures.size()); for (Iterator iterator = managerFutures.iterator(); iterator.hasNext();) { Future future = (Future) iterator.next(); try { managers.add(future.get()); } catch (InterruptedException e) { // ignore -- this should not happen errors.add(new AssertionError(e)); } catch (ExecutionException e) { // good -- one less manager to deal with } } // Be nice and try to stop asynchronously errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // Be really nice and try to stop asynchronously again errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // We have been nice enough now nuke them errors.addAll(stopAll(managers, StopStrategies.FORCE)); // All managers are gaurenteed to be destroyed now for (Iterator iterator = managers.iterator(); iterator.hasNext();) { ServiceManager serviceManager = (ServiceManager) iterator.next(); try { serviceManager.destroy(StopStrategies.FORCE); } catch (UnsatisfiedConditionsException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (IllegalServiceStateException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (RuntimeException e) { errors.add(new AssertionError(e)); } catch (Error e) { errors.add(new AssertionError(e)); } } if (!errors.isEmpty()) { throw new KernelErrorsError(errors); } }
public void destroy() throws KernelErrorsError { // we gather all errors that occur during shutdown and throw them as on huge exception List errors = new ArrayList(); List managerFutures; synchronized (serviceManagers) { managerFutures = new ArrayList(serviceManagers.values()); serviceManagers.clear(); } List managers = new ArrayList(managerFutures.size()); for (Iterator iterator = managerFutures.iterator(); iterator.hasNext();) { Future future = (Future) iterator.next(); try { managers.add(future.get()); } catch (InterruptedException e) { // ignore -- this should not happen errors.add(new AssertionError(e)); } catch (ExecutionException e) { // good -- one less manager to deal with } } // Be nice and try to stop asynchronously errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // Be really nice and try to stop asynchronously again errors.addAll(stopAll(managers, StopStrategies.ASYNCHRONOUS)); // We have been nice enough now nuke them errors.addAll(stopAll(managers, StopStrategies.FORCE)); // All managers are gaurenteed to be destroyed now for (Iterator iterator = managers.iterator(); iterator.hasNext();) { ServiceManager serviceManager = (ServiceManager) iterator.next(); try { serviceManager.destroy(StopStrategies.FORCE); } catch (UnsatisfiedConditionsException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (IllegalServiceStateException e) { // this should not happen, because we force stopped errors.add(new AssertionError(e)); } catch (RuntimeException e) { errors.add(new AssertionError(e)); } catch (Error e) { errors.add(new AssertionError(e)); } } if (!errors.isEmpty()) { throw new KernelErrorsError(errors); } }
1,122,909
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
1,122,910
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
public void initialize() { contactList = SparkManager.getWorkspace().getContactList(); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("Ctrl F6"), "viewNotes"); contactList.getActionMap().put("viewNotes", new AbstractAction("viewNotes") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. retrieveNotes(); } }); contactList.getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control F5"), "viewTasks"); contactList.getActionMap().put("viewTasks", new AbstractAction("viewTasks") { public void actionPerformed(ActionEvent evt) { // Retrieve notes and dispaly in editor. showTaskList(); } }); }
1,122,911
public void actionPerformed(ActionEvent actionEvent) { Collection contacts = contactList.getSelectedUsers(); startConference(contacts); }
public void actionPerformed(ActionEvent actionEvent) { Collection contacts = contactList.getActiveGroup().getContactItems(); startConference(contacts); }
1,122,912
OrCondition(Condition l, Condition r) { _l = l; _r = r; System.out.println("Condition: " + l + " || + " + r); }
OrCondition(Condition l, Condition r) { _l = l; _r = r; System.out.println("Condition: " + l + " || + " + r); }
1,122,914
public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); FileWriter writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch(IOException ioe) { LOGGER.error("Error while writing file.", ioe); } } } }
public static void flood(String directory, String fileName, String fileExt, int numOfFiles, int linesPerFile) { File dir = new File(directory); if (dir.exists() && dir.isDirectory()) { for (int i = 1; i <= numOfFiles; i++) { try { File file = new File(directory + "/" + fileName + i + "." + fileExt); LOGGER.info("Writing file: " + file.getAbsolutePath()); FileWriter writer = new FileWriter(file); for (int l = 1; l <= linesPerFile; l++) { writer.write("This is a test file. blah.... blah.... blah....\n"); } } catch(IOException ioe) { LOGGER.error("Error while writing file.", ioe); } } } }
1,122,915
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; }
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; }
1,122,916
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); System.err.println ("pageName: " + newPage.getTitle()); // make sure to save the page wiki.savePage (newPage); return newPage; }
protected WikiPage createNewPage (WikiSystem wiki, WebContext wc, WikiUser user) throws Exception { // get the page elements from the request String editor = user.getIdentifier(); String text = wc.getForm ("TEXT"); boolean moderated = wc.getForm ("MODERATED") != null && wc.getForm("MODERATED").equals ("true"); String keywords = wc.getForm ("RELATED_TITLES"); String pageName = wc.getForm ("save"); // create the page System.err.println ("pageName: " + pageName); WikiPage newPage = wiki.createPage (pageName, editor, text); newPage.setRelatedTitles (keywordsToStringArray(keywords)); newPage.setIsModerated(moderated); // make sure to save the page wiki.savePage (newPage); return newPage; }
1,122,917
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; }
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { ClassLoader cl = parserContext.getReaderContext().getReader().getBeanClassLoader(); if (cl != null) { in = cl.getResourceAsStream(uri); } if (in == null) { log.debug("Could not find resource: " + uri); } } return in; }
1,122,918
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } return in; }
protected InputStream loadResource(String uri) { if (System.getProperty("xbean.dir") != null) { File f = new File(System.getProperty("xbean.dir") + uri); try { return new FileInputStream(f); } catch (FileNotFoundException e) { // Ignore } } // lets try the thread context class loader first InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { in = getClass().getClassLoader().getResourceAsStream(uri); if (in == null) { log.debug("Could not find resource: " + uri); } } } return in; }
1,122,919
protected String renderListItem() { return "* "; }
protected String renderListItem() { return _number > 0 ? "" + (++_number) : "* "; }
1,122,920
public final String GetImage() { if (tokenBeginBuf == curBuf) return new String(curBuf.buffer, tokenBeginPos, curBuf.curPos - tokenBeginPos + 1); else return new String(otherBuf.buffer, tokenBeginPos, otherBuf.dataLen - tokenBeginPos) + new String(curBuf.buffer, 0, curBuf.curPos + 1); }
public final String GetImage() { if (tokenBeginBuf == curBuf) return new String(curBuf.buffer, tokenBeginPos, curBuf.curPos - tokenBeginPos + 1); else return new String(otherBuf.buffer, tokenBeginPos, otherBuf.dataLen - tokenBeginPos) + new String(curBuf.buffer, 0, curBuf.curPos); }
1,122,921
final public void eatLeadingWsNl() { int i, j, l; i = size() - 1; if ( i < 0 || i+1 == literalMark ) return; Object o = elementAt(i); if (! (o instanceof String)) return; String s = (String) o; j = 0; l = s.length(); while (j < l && Character.isSpaceChar(s.charAt(j))) j++; if (j < l) { if (s.charAt(j) == '\r') j++; else if (s.charAt(j) == '\n') { j++; if (j < l && s.charAt(j) == '\r') j++; } } if (j >= l) remove(i); else if (j > 0) setElementAt(s.substring(j), i); markLiteral(); }
final public void eatLeadingWsNl() { int i, j, l; i = size() - 1; if ( i < 0 || i+1 == literalMark ) return; Object o = elementAt(i); if (! (o instanceof String)) return; String s = (String) o; j = 0; l = s.length(); while (j < l && isSpaceChar(s.charAt(j))) j++; if (j < l) { if (s.charAt(j) == '\r') j++; else if (s.charAt(j) == '\n') { j++; if (j < l && s.charAt(j) == '\r') j++; } } if (j >= l) remove(i); else if (j > 0) setElementAt(s.substring(j), i); markLiteral(); }
1,122,922
final public void eatOneWs() { int i, j; i = size() - 1; if ( i < 0 || i+1 == literalMark ) return; Object o = elementAt(i); if (! (o instanceof String)) return; String s = (String) o; j = eatOneWs(s, s.length() - 1); if (j < 0) remove(i); else if (j < s.length() - 1) setElementAt(s.substring(0, j+1), i); markLiteral(); }
final public void eatOneWs() { int i, j; i = size() - 1; if ( i < 0 || i+1 == literalMark ) return; Object o = elementAt(i); if (! (o instanceof String)) return; String s = (String) o; j = eatOneWs(s, s.length() - 1); if (j < 0) remove(i); else if (j < s.length() - 1) setElementAt(s.substring(0, j+1), i); markLiteral(); }
1,122,923
private final static int eatWs(String s, int pos) { while (pos >= 0 && Character.isSpaceChar(s.charAt(pos))) pos--; return pos; }
private final static int eatWs(String s, int pos) { while (pos >= 0 && isSpaceChar(s.charAt(pos))) pos--; return pos; }
1,122,924
public SearchArticleBean() { _searchPublishedFrom = new Date(); _searchText = "searchtext"; }
public SearchArticleBean() { _searchPublishedFrom = new Date(); _searchText = "searchtext"; }
1,122,925
public int getNumberOfColumns() { return 4; }
public int getNumberOfColumns() { return 6; }
1,122,926
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; String localeString = ""; //((locale!=null)?locale.getLanguage():""); SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%"+localeString+".article"); SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedFrom()); whereExpression = s.and(namePatternExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategoryId().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+getSearchCategoryId()+"%"); whereExpression = s.and(whereExpression,categoryExpression); } if(getSearchAuthor()!=null){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+getSearchAuthor()+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; String localeString = ""; //((locale!=null)?locale.getLanguage():""); SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%"+localeString+".article"); SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedFrom()); whereExpression = s.and(namePatternExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategoryId().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+getSearchCategoryId()+"%"); whereExpression = s.and(whereExpression,categoryExpression); } if(getSearchAuthor()!=null){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+getSearchAuthor()+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
1,122,927
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; String localeString = ""; //((locale!=null)?locale.getLanguage():""); SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%"+localeString+".article"); SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedFrom()); whereExpression = s.and(namePatternExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategoryId().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+getSearchCategoryId()+"%"); whereExpression = s.and(whereExpression,categoryExpression); } if(getSearchAuthor()!=null){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+getSearchAuthor()+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; String localeString = ""; //((locale!=null)?locale.getLanguage():""); SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%"+localeString+".article"); SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedFrom()); whereExpression = s.and(namePatternExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategoryId().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+getSearchCategoryId()+"%"); whereExpression = s.and(whereExpression,categoryExpression); } if(getSearchAuthor()!=null){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+getSearchAuthor()+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
1,122,928
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; String localeString = ""; //((locale!=null)?locale.getLanguage():""); SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%"+localeString+".article"); SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedFrom()); whereExpression = s.and(namePatternExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategoryId().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+getSearchCategoryId()+"%"); whereExpression = s.and(whereExpression,categoryExpression); } if(getSearchAuthor()!=null){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+getSearchAuthor()+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
public SearchRequest getSearchRequest(String scope, Locale locale) throws SearchException { SearchRequest s = new SearchRequest(); s.addSelection(IWSlideConstants.PROPERTY_CREATION_DATE); s.addSelection(IWSlideConstants.PROPERTY_CATEGORY); s.addScope(new SearchScope(scope)); SearchExpression whereExpression = null; String localeString = ""; //((locale!=null)?locale.getLanguage():""); SearchExpression namePatternExpression = s.compare(CompareOperator.LIKE, IWSlideConstants.PROPERTY_DISPLAY_NAME,"%"+localeString+".article"); SearchExpression creationDateFromExpression = null; if(getSearchPublishedFrom() != null){ creationDateFromExpression = s.compare(CompareOperator.GTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedFrom()); whereExpression = s.and(namePatternExpression,creationDateFromExpression); } SearchExpression creationDateToExpression = null; if(getSearchPublishedTo() != null){ creationDateToExpression = s.compare(CompareOperator.LTE, IWSlideConstants.PROPERTY_CREATION_DATE,getSearchPublishedTo()); whereExpression = s.and(whereExpression,creationDateToExpression); } // List categoryExpressions = new ArrayList(); if(!getSearchCategoryId().equals("-1")){ SearchExpression categoryExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+getSearchCategoryId()+"%"); whereExpression = s.and(whereExpression,categoryExpression); } if(getSearchAuthor()!=null){ SearchExpression authorExpression = s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CREATOR_DISPLAY_NAME,"%"+getSearchAuthor()+"%"); whereExpression = s.and(whereExpression,authorExpression); } // }// whereExpression = s.and(whereExpression,categoryExpression);// for (Iterator iter = categoryList.iterator(); iter.hasNext();) {// String categoryName = (String) iter.next();// categoryExpressions.add(s.compare(CompareOperator.LIKE,IWSlideConstants.PROPERTY_CATEGORY,"%"+categoryName+"%"));// }// Iterator expr = categoryExpressions.iterator();// if(expr.hasNext()){// SearchExpression categoryExpression = (SearchExpression)expr.next();// while(expr.hasNext()){// categoryExpression = s.or(categoryExpression,(SearchExpression)expr.next());// }// whereExpression = s.and(whereExpression,categoryExpression);// }// } SearchExpression containsExpression = null; if(getSearchText() != null && !"".equals(getSearchText())){ containsExpression = s.contains(getSearchText()); if(whereExpression!=null){ whereExpression = s.and(whereExpression,containsExpression); }else{ whereExpression = containsExpression; } } s.setWhereExpression(whereExpression); System.out.println("------------------------"); System.out.println(s.asString()); System.out.println("------------------------"); return s; }
1,122,929
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } ArticleItemBean[] articleItemBean; try { articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder(ContentUtil.ARTICLE_PATH).toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { String id = articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+".xml"; ArticleListBean bean = new ArticleListBean(id, articleItemBean[i].getHeadline(), "", articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } ArticleItemBean[] articleItemBean; try { articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder(ContentUtil.ARTICLE_PATH).toArray(new ArticleItemBean[0]); int availableRows = articleItemBean.length; int nrOfRows = rows.intValue(); if (nrOfRows == 0) { nrOfRows = availableRows; } int maxRow = Math.min(start.intValue() + nrOfRows,availableRows); for (int i = start.intValue(); i < maxRow; i++) { String id = articleItemBean[i].getFolderLocation()+"/"+articleItemBean[i].getHeadline()+ArticleItemBean.ARTICLE_SUFFIX; ArticleListBean bean = new ArticleListBean(id, articleItemBean[i].getHeadline(), "", articleItemBean[i].getAuthor(), articleItemBean[i].getStatus()); _dataModel.set(bean, i); } _dataModel.setRowCount(availableRows); } catch (XmlException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
1,122,931
public ArticleListBean(String id, String headline, String published, String author, String status) { _id = id; _headline = headline; _published = published; _author = author; _status = status; _testStyle = ""; }
public ArticleListBean(String id, String headline, String published, String author, String status) { _id = id; _headline = headline; _published = published; _author = author; _status = status; _testStyle = ""; }
1,122,932
public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ List list = new ArrayList(); // File[] articleFile = folder.listFiles(); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String[] file = rootResource.list(); for(int i=0;i<file.length;i++){// System.out.println("Attempting to load "+articleFile[i].toString()); System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean();// article.load(articleFile[i].toString()); article.load(folder+"/"+file[i]); list.add(article); } return list; }
public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ List list = new ArrayList(); // File[] articleFile = folder.listFiles(); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavResource folderResource = session.getWebdavResource(folder); String[] file = rootResource.list(); for(int i=0;i<file.length;i++){// System.out.println("Attempting to load "+articleFile[i].toString()); System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean();// article.load(articleFile[i].toString()); article.load(folder+"/"+file[i]); list.add(article); } return list; }
1,122,933
public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ List list = new ArrayList(); // File[] articleFile = folder.listFiles(); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String[] file = rootResource.list(); for(int i=0;i<file.length;i++){// System.out.println("Attempting to load "+articleFile[i].toString()); System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean();// article.load(articleFile[i].toString()); article.load(folder+"/"+file[i]); list.add(article); } return list; }
public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ List list = new ArrayList(); // File[] articleFile = folder.listFiles(); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String[] file = folderResource.list(); for(int i=0;i<file.length;i++){// System.out.println("Attempting to load "+articleFile[i].toString()); System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean();// article.load(articleFile[i].toString()); article.load(folder+"/"+file[i]); list.add(article); } return list; }
1,122,934
public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ List list = new ArrayList(); // File[] articleFile = folder.listFiles(); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String[] file = rootResource.list(); for(int i=0;i<file.length;i++){// System.out.println("Attempting to load "+articleFile[i].toString()); System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean();// article.load(articleFile[i].toString()); article.load(folder+"/"+file[i]); list.add(article); } return list; }
public static List loadAllArticlesInFolder(String folder) throws XmlException, IOException{ List list = new ArrayList(); // File[] articleFile = folder.listFiles(); IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String[] file = rootResource.list(); for(int i=0;i<file.length;i++){// System.out.println("Attempting to load "+articleFile[i].toString()); System.out.println("Attempting to load "+file[i].toString()); ArticleItemBean article = new ArticleItemBean();// article.load(articleFile[i].toString()); article.load(folder+"/"+file[i]); list.add(article); } return list; }
1,122,935
public void load(String path) throws XmlException, IOException{ IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); //TODO have to find the host machine url to load the resource.// WebdavResource webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+path);// WebdavFile webdavFile = session.getWebdavFile(); HttpURL root = new HttpURL(service.getWebdavServerURL()+path, "root", "root");// root.setUserinfo("root","root"); WebdavResource webdavResource = new WebdavResource(root); ArticleDocument articleDoc; articleDoc = ArticleDocument.Factory.parse(webdavResource.getMethodDataAsString()); ArticleDocument.Article article = articleDoc.getArticle();// ArticleItemBean articleBean = new ArticleItemBean(); setHeadline(article.getHeadline()); setBody(article.getBody()); setTeaser(article.getTeaser()); setAuthor(article.getAuthor()); setSource(article.getSource()); setComment(article.getComment()); String category = ""; int lastSlash = path.lastIndexOf('/'); if(lastSlash>0) { category = path.substring(0,lastSlash); } setMainCategory(category); // System.out.println("loaded "+getBody()); }
public void load(String path) throws XmlException, IOException{ IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); //TODO have to find the host machine url to load the resource.// WebdavResource webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+path);// WebdavFile webdavFile = session.getWebdavFile(); HttpURL contentRoot = service.getWebdavServerURL(path); contentRoot.setUserinfo("root","root");// root.setUserinfo("root","root"); WebdavResource webdavResource = new WebdavResource(root); ArticleDocument articleDoc; articleDoc = ArticleDocument.Factory.parse(webdavResource.getMethodDataAsString()); ArticleDocument.Article article = articleDoc.getArticle();// ArticleItemBean articleBean = new ArticleItemBean(); setHeadline(article.getHeadline()); setBody(article.getBody()); setTeaser(article.getTeaser()); setAuthor(article.getAuthor()); setSource(article.getSource()); setComment(article.getComment()); String category = ""; int lastSlash = path.lastIndexOf('/'); if(lastSlash>0) { category = path.substring(0,lastSlash); } setMainCategory(category); // System.out.println("loaded "+getBody()); }
1,122,936
public void load(String path) throws XmlException, IOException{ IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); //TODO have to find the host machine url to load the resource.// WebdavResource webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+path);// WebdavFile webdavFile = session.getWebdavFile(); HttpURL root = new HttpURL(service.getWebdavServerURL()+path, "root", "root");// root.setUserinfo("root","root"); WebdavResource webdavResource = new WebdavResource(root); ArticleDocument articleDoc; articleDoc = ArticleDocument.Factory.parse(webdavResource.getMethodDataAsString()); ArticleDocument.Article article = articleDoc.getArticle();// ArticleItemBean articleBean = new ArticleItemBean(); setHeadline(article.getHeadline()); setBody(article.getBody()); setTeaser(article.getTeaser()); setAuthor(article.getAuthor()); setSource(article.getSource()); setComment(article.getComment()); String category = ""; int lastSlash = path.lastIndexOf('/'); if(lastSlash>0) { category = path.substring(0,lastSlash); } setMainCategory(category); // System.out.println("loaded "+getBody()); }
public void load(String path) throws XmlException, IOException{ IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); //TODO have to find the host machine url to load the resource.// WebdavResource webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+path);// WebdavFile webdavFile = session.getWebdavFile(); HttpURL root = new HttpURL(service.getWebdavServerURL()+path, "root", "root");// root.setUserinfo("root","root"); WebdavResource webdavResource = new WebdavResource(contentRoot); ArticleDocument articleDoc; articleDoc = ArticleDocument.Factory.parse(webdavResource.getMethodDataAsString()); ArticleDocument.Article article = articleDoc.getArticle();// ArticleItemBean articleBean = new ArticleItemBean(); setHeadline(article.getHeadline()); setBody(article.getBody()); setTeaser(article.getTeaser()); setAuthor(article.getAuthor()); setSource(article.getSource()); setComment(article.getComment()); String category = ""; int lastSlash = path.lastIndexOf('/'); if(lastSlash>0) { category = path.substring(0,lastSlash); } setMainCategory(category); // System.out.println("loaded "+getBody()); }
1,122,937
private String generateTableRowForClass(Clazz clazz) { StringBuffer ret = new StringBuffer(); double lineCoverage = clazz.getLineCoverageRate(); double branchCoverage = clazz.getBranchCoverageRate(); double ccn = Util.getCCN( new File(sourceDir, clazz.getLongFileName()), false); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + clazz.getLongName() + ".html\">" + clazz.getName() + "</a></td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
private String generateTableRowForClass(Clazz clazz) { StringBuffer ret = new StringBuffer(); double lineCoverage = clazz.getLineCoverageRate(); double branchCoverage = clazz.getBranchCoverageRate(); double ccn = Util.getCCN( new File(sourceDir, clazz.getLongFileName()), false); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + clazz.getLongName() + ".html\">" + clazz.getName() + "</a></td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
1,122,940
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); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getFormPanel(3); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "published_from"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "published_to"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "category"), WFUtil.getText(":"))); HtmlInputText searchPublishedFromInput = WFUtil.getInputText(SEARCH_PUBLISHED_FROM_ID, ref + "searchPublishedFrom"); searchPublishedFromInput.setSize(20); searchPublishedFromInput.setConverter(new WFDateConverter()); p.getChildren().add(searchPublishedFromInput); HtmlInputText searchPublishedToInput = WFUtil.getInputText(SEARCH_PUBLISHED_TO_ID, ref + "searchPublishedTo"); searchPublishedToInput.setSize(20); searchPublishedToInput.setConverter(new WFDateConverter()); p.getChildren().add(searchPublishedToInput); //HtmlSelectOneMenu searchCategoryMenu = WFUtil.getSelectOneMenu(SEARCH_CATEGORY_ID, ref + "categories", ref + "searchCategoryId"); //searchCategoryMenu.setConverter(new IntegerConverter()); //p.getChildren().add(searchCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getText(" ")); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.getButtonVB(LIST_BUTTON_ID, bref + "list", this)); mainContainer.add(p); return mainContainer; }
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); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getFormPanel(3); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "published_from"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "published_to"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "category"), WFUtil.getText(":"))); HtmlInputText searchPublishedFromInput = WFUtil.getInputText(SEARCH_PUBLISHED_FROM_ID, ref + "searchPublishedFrom"); searchPublishedFromInput.setSize(20); searchPublishedFromInput.setConverter(new WFDateConverter()); p.getChildren().add(searchPublishedFromInput); HtmlInputText searchPublishedToInput = WFUtil.getInputText(SEARCH_PUBLISHED_TO_ID, ref + "searchPublishedTo"); searchPublishedToInput.setSize(20); searchPublishedToInput.setConverter(new WFDateConverter()); p.getChildren().add(searchPublishedToInput); //HtmlSelectOneMenu searchCategoryMenu = WFUtil.getSelectOneMenu(SEARCH_CATEGORY_ID, ref + "categories", ref + "searchCategoryId"); //searchCategoryMenu.setConverter(new IntegerConverter()); //p.getChildren().add(searchCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getText(" ")); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.getButtonVB(LIST_BUTTON_ID, bref + "list", this)); mainContainer.add(p); return mainContainer; }
1,122,941
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() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } //Need to create article.setCategory(getCategory()); // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// }/* File path = new File(getFolder()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String uri = service.getWebdavServerURI(); String folderLoaction = getFolderLocation();// String filePath = service.getWebdavServerURI()+getFolderLocation();// boolean success = rootResource.mkcolMethod(filePath);// createPath(getFolderLocation()); IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); String path = getArticlePath(service); File file = new File(path); slideService.createAllFoldersInPath(file.getParent()); System.out.println("URI = "+uri); System.out.println("Folder location = "+folderLoaction); String article = getAsXML();// System.out.println("success "+success);// success = // String filename = createFileName(service); System.out.println("Stored language "+getLanguage()); rootResource.putMethod(session.getURI(path),article); try { load(getArticlePath(service)); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }// System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getFolder();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getFolder());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getFolder()+"/"+filename+ARTICLE_SUFFIX);// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+ARTICLE_SUFFIX);// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX);// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+ARTICLE_SUFFIX)); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getFolder()+"/"+filename+ARTICLE_SUFFIX));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
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() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } //Need to create article.setCategory(getCategory()); // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// }/* File path = new File(getFolder()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String uri = service.getWebdavServerURI(); String folderLoaction = getFolderLocation();// String filePath = service.getWebdavServerURI()+getFolderLocation();// boolean success = rootResource.mkcolMethod(filePath);// createPath(getFolderLocation()); IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); String path = getArticlePath(service); File file = new File(path); slideService.createAllFoldersInPath(file.getParent()); System.out.println("URI = "+uri); System.out.println("Folder location = "+folderLoaction); String article = getAsXML();// System.out.println("success "+success);// success = // String filename = createFileName(service); rootResource.putMethod(session.getURI(path),article); try { load(getArticlePath(service)); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }// System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getFolder();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getFolder());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getFolder()+"/"+filename+ARTICLE_SUFFIX);// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+ARTICLE_SUFFIX);// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX);// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+ARTICLE_SUFFIX)); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getFolder()+"/"+filename+ARTICLE_SUFFIX));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
1,122,942
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() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } //Need to create article.setCategory(getCategory()); // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// }/* File path = new File(getFolder()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String uri = service.getWebdavServerURI(); String folderLoaction = getFolderLocation();// String filePath = service.getWebdavServerURI()+getFolderLocation();// boolean success = rootResource.mkcolMethod(filePath);// createPath(getFolderLocation()); IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); String path = getArticlePath(service); File file = new File(path); slideService.createAllFoldersInPath(file.getParent()); System.out.println("URI = "+uri); System.out.println("Folder location = "+folderLoaction); String article = getAsXML();// System.out.println("success "+success);// success = // String filename = createFileName(service); System.out.println("Stored language "+getLanguage()); rootResource.putMethod(session.getURI(path),article); try { load(getArticlePath(service)); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }// System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getFolder();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getFolder());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getFolder()+"/"+filename+ARTICLE_SUFFIX);// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+ARTICLE_SUFFIX);// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX);// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+ARTICLE_SUFFIX)); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getFolder()+"/"+filename+ARTICLE_SUFFIX));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
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() != null && getRequestedStatus().equals(ContentItemCase.STATUS_PUBLISHED)) {// if (getCase().getPublishedFromDate() == null) {// addErrorKey(KEY_ERROR_PUBLISHED_FROM_DATE_EMPTY);// storeOk = false;// }// } //Need to create article.setCategory(getCategory()); // String filename = getHeadline();// if(null==filename || filename.length()==0) {// filename = "empty";// }/* File path = new File(getFolder()); if(!path.exists()) { path.mkdirs(); }*/ try { IWUserContext iwuc = IWContext.getInstance(); IWApplicationContext iwac = iwuc.getApplicationContext(); IWSlideSession session = (IWSlideSession)IBOLookup.getSessionInstance(iwuc,IWSlideSession.class); IWSlideService service = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); WebdavRootResource rootResource = session.getWebdavRootResource(); String uri = service.getWebdavServerURI(); String folderLoaction = getFolderLocation();// String filePath = service.getWebdavServerURI()+getFolderLocation();// boolean success = rootResource.mkcolMethod(filePath);// createPath(getFolderLocation()); IWSlideService slideService = (IWSlideService)IBOLookup.getServiceInstance(iwac,IWSlideService.class); String path = getArticlePath(service); File file = new File(path); slideService.createAllFoldersInPath(file.getParent()); System.out.println("URI = "+uri); System.out.println("Folder location = "+folderLoaction); String article = getAsXML();// System.out.println("success "+success);// success = // String filename = createFileName(service); System.out.println("Stored language "+getLanguage()); rootResource.putMethod(session.getURI(path),article); try { load(path); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); }// System.out.println("success "+success);// String webdavServletURL = getWebdavServletURL(iwuc)+"/"+getFolder();// System.out.println("webdavServletURL = "+webdavServletURL);// System.out.println("webdavServerURL = "+service.getWebdavServerURL());// WebdavResource webdavResource = session.getWebdavResource(session.getWebdavServerURL().toString());// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/"); // WebdavFile webdavFile = session.getWebdavFile();// WebdavFile path = new WebdavFile(webdavFile, getFolder());// path.mkdirs();// webdavResource = session.getWebdavResource(getWebdavServletURL(iwuc)+getFolder()+"/"+filename+ARTICLE_SUFFIX);// WebdavResource webdavResource = session.getWebdavResource("http://localhost:8080/servlet/webdav/"+filename+ARTICLE_SUFFIX);// IWSlideService iwss = new IWSlideService();// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/");// WebdavResource webdavResource = new WebdavResource("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX);// WebdavFile webdavFile = session.getWebdavFile();// webdavResource.putMethod(new File(filename+ARTICLE_SUFFIX)); /* HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX); root.setUserinfo("root","root"); WebdavFile webdavFile = new WebdavFile(webdavResource.getHttpURL()); webdavResource.close(); */// HttpURL root = new HttpURL("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// root.setUserinfo("root","root"); // WebdavFile webdavFile = new WebdavFile("http://localhost:8080/servlet/webdav/files/"+filename+ARTICLE_SUFFIX, "root", "root");// webdavFile.createNewFile();// if(!webdavFile.exists()) {// } // articleDoc.save(new File(getFolder()+"/"+filename+ARTICLE_SUFFIX));// articleDoc.save(webdavFile);// webdavFile.close(); } catch (IOException e1) { storeOk = false; // TODO Auto-generated catch block e1.printStackTrace(); } if (storeOk) { if (getRequestedStatus() != null) { setStatus(getRequestedStatus()); setRequestedStatus(null); } }else { throw new ArticleStoreException(); } }
1,122,943
private String processLine(final String line) { if (line == null) throw new IllegalArgumentException("\"line\" can not be null."); if ((line.indexOf('\n') != -1) || (line.indexOf('\r') != -1)) throw new IllegalArgumentException( "\"line\" can not contain newline or carriage return characters."); StringBuffer ret = new StringBuffer(); int currentIndex = 0; while (currentIndex != line.length()) { if (state == State.DEFAULT) { if ((currentIndex + 2 < line.length()) && line.substring(currentIndex, currentIndex + 3) .equals("/**")) { state = State.COMMENT_JAVADOC; } else if ((currentIndex + 1 < line.length()) && line.substring(currentIndex, currentIndex + 2) .equals("/*")) { state = State.COMMENT_MULTI; } else if ((currentIndex + 1 < line.length()) && (line.substring(currentIndex, currentIndex + 2) .equals("//"))) { state = State.COMMENT_SINGLE; } else if (Character.isJavaIdentifierStart(line .charAt(currentIndex))) { state = State.KEYWORD; } else if (line.charAt(currentIndex) == '\'') { state = State.QUOTE_SINGLE; } else if (line.charAt(currentIndex) == '"') { state = State.QUOTE_DOUBLE; } else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } } // End of State.DEFAULT else if ((state == State.COMMENT_MULTI) || (state == State.COMMENT_JAVADOC)) { // Print everything from the current character until the // closing */ No exceptions. ret.append("<span class=\"comment\">"); while ((currentIndex != line.length()) && !((currentIndex + 1 < line.length()) && (line .substring(currentIndex, currentIndex + 2) .equals("*/")))) { ret.append(escapeEntity(line.charAt(currentIndex++))); } if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("*/</span>"); state = State.DEFAULT; currentIndex += 2; } } // End of State.COMMENT_MULTI else if (state == State.COMMENT_SINGLE) { // Print everything from the current character until the // end of the line ret.append("<span class=\"comment\">"); while (currentIndex != line.length()) { ret.append(escapeEntity(line.charAt(currentIndex++))); } ret.append("</span>"); state = State.DEFAULT; } // End of State.COMMENT_SINGLE else if (state == State.KEYWORD) { StringBuffer tmp = new StringBuffer(); do { tmp.append(line.charAt(currentIndex++)); } while ((currentIndex != line.length()) && (Character.isJavaIdentifierPart(line .charAt(currentIndex)))); if (javaKeywords.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveLiterals.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveTypes.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else ret.append(tmp); if (tmp.toString().equals("import")) state = State.IMPORT_NAME; else if (tmp.toString().equals("package")) state = State.PACKAGE_NAME; else state = State.DEFAULT; } // End of State.KEYWORD else if (state == State.IMPORT_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.IMPORT_NAME else if (state == State.PACKAGE_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.PACKAGE_NAME else if (state == State.QUOTE_DOUBLE) { // Print everything from the current character until the // closing ", checking for \" ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '"') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_DOUBLE else if (state == State.QUOTE_SINGLE) { // Print everything from the current character until the // closing ', checking for \' ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '\'') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_SINGLE else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } // End of unknown state } return ret.toString(); }
private String processLine(final String line) { if (line == null) throw new IllegalArgumentException("\"line\" can not be null."); if ((line.indexOf('\n') != -1) || (line.indexOf('\r') != -1)) throw new IllegalArgumentException( "\"line\" can not contain newline or carriage return characters."); StringBuffer ret = new StringBuffer(); int currentIndex = 0; while (currentIndex != line.length()) { if (state == State.DEFAULT) { if ((currentIndex + 2 < line.length()) && line.substring(currentIndex, currentIndex + 3) .equals("/**")) { state = State.COMMENT_JAVADOC; } else if ((currentIndex + 1 < line.length()) && line.substring(currentIndex, currentIndex + 2) .equals("/*")) { state = State.COMMENT_MULTI; } else if ((currentIndex + 1 < line.length()) && (line.substring(currentIndex, currentIndex + 2) .equals("//"))) { state = State.COMMENT_SINGLE; } else if (Character.isJavaIdentifierStart(line .charAt(currentIndex))) { state = State.KEYWORD; } else if (line.charAt(currentIndex) == '\'') { state = State.QUOTE_SINGLE; } else if (line.charAt(currentIndex) == '"') { state = State.QUOTE_DOUBLE; } else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } } // End of State.DEFAULT else if ((state == State.COMMENT_MULTI) || (state == State.COMMENT_JAVADOC)) { // Print everything from the current character until the // closing */ No exceptions. ret.append("<span class=\"comment\">"); while ((currentIndex != line.length()) && !((currentIndex + 1 < line.length()) && (line .substring(currentIndex, currentIndex + 2) .equals("*/")))) { ret.append(escapeEntity(line.charAt(currentIndex++))); } if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("*/</span>"); state = State.DEFAULT; currentIndex += 2; } } // End of State.COMMENT_MULTI else if (state == State.COMMENT_SINGLE) { // Print everything from the current character until the // end of the line ret.append("<span class=\"comment\">"); while (currentIndex != line.length()) { ret.append(escapeEntity(line.charAt(currentIndex++))); } ret.append("</span>"); state = State.DEFAULT; } // End of State.COMMENT_SINGLE else if (state == State.KEYWORD) { StringBuffer tmp = new StringBuffer(); do { tmp.append(line.charAt(currentIndex++)); } while ((currentIndex != line.length()) && (Character.isJavaIdentifierPart(line .charAt(currentIndex)))); if (javaKeywords.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveLiterals.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveTypes.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else ret.append(tmp); if (tmp.toString().equals("import")) state = State.IMPORT_NAME; else if (tmp.toString().equals("package")) state = State.PACKAGE_NAME; else state = State.DEFAULT; } // End of State.KEYWORD else if (state == State.IMPORT_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.IMPORT_NAME else if (state == State.PACKAGE_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.PACKAGE_NAME else if (state == State.QUOTE_DOUBLE) { // Print everything from the current character until the // closing ", checking for \" ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '"') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_DOUBLE else if (state == State.QUOTE_SINGLE) { // Print everything from the current character until the // closing ', checking for \' ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '\'') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_SINGLE else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } // End of unknown state } return ret.toString(); }
1,122,944
private String processLine(final String line) { if (line == null) throw new IllegalArgumentException("\"line\" can not be null."); if ((line.indexOf('\n') != -1) || (line.indexOf('\r') != -1)) throw new IllegalArgumentException( "\"line\" can not contain newline or carriage return characters."); StringBuffer ret = new StringBuffer(); int currentIndex = 0; while (currentIndex != line.length()) { if (state == State.DEFAULT) { if ((currentIndex + 2 < line.length()) && line.substring(currentIndex, currentIndex + 3) .equals("/**")) { state = State.COMMENT_JAVADOC; } else if ((currentIndex + 1 < line.length()) && line.substring(currentIndex, currentIndex + 2) .equals("/*")) { state = State.COMMENT_MULTI; } else if ((currentIndex + 1 < line.length()) && (line.substring(currentIndex, currentIndex + 2) .equals("//"))) { state = State.COMMENT_SINGLE; } else if (Character.isJavaIdentifierStart(line .charAt(currentIndex))) { state = State.KEYWORD; } else if (line.charAt(currentIndex) == '\'') { state = State.QUOTE_SINGLE; } else if (line.charAt(currentIndex) == '"') { state = State.QUOTE_DOUBLE; } else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } } // End of State.DEFAULT else if ((state == State.COMMENT_MULTI) || (state == State.COMMENT_JAVADOC)) { // Print everything from the current character until the // closing */ No exceptions. ret.append("<span class=\"comment\">"); while ((currentIndex != line.length()) && !((currentIndex + 1 < line.length()) && (line .substring(currentIndex, currentIndex + 2) .equals("*/")))) { ret.append(escapeEntity(line.charAt(currentIndex++))); } if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("*/</span>"); state = State.DEFAULT; currentIndex += 2; } } // End of State.COMMENT_MULTI else if (state == State.COMMENT_SINGLE) { // Print everything from the current character until the // end of the line ret.append("<span class=\"comment\">"); while (currentIndex != line.length()) { ret.append(escapeEntity(line.charAt(currentIndex++))); } ret.append("</span>"); state = State.DEFAULT; } // End of State.COMMENT_SINGLE else if (state == State.KEYWORD) { StringBuffer tmp = new StringBuffer(); do { tmp.append(line.charAt(currentIndex++)); } while ((currentIndex != line.length()) && (Character.isJavaIdentifierPart(line .charAt(currentIndex)))); if (javaKeywords.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveLiterals.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveTypes.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else ret.append(tmp); if (tmp.toString().equals("import")) state = State.IMPORT_NAME; else if (tmp.toString().equals("package")) state = State.PACKAGE_NAME; else state = State.DEFAULT; } // End of State.KEYWORD else if (state == State.IMPORT_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.IMPORT_NAME else if (state == State.PACKAGE_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.PACKAGE_NAME else if (state == State.QUOTE_DOUBLE) { // Print everything from the current character until the // closing ", checking for \" ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '"') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_DOUBLE else if (state == State.QUOTE_SINGLE) { // Print everything from the current character until the // closing ', checking for \' ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '\'') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_SINGLE else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } // End of unknown state } return ret.toString(); }
private String processLine(final String line) { if (line == null) throw new IllegalArgumentException("\"line\" can not be null."); if ((line.indexOf('\n') != -1) || (line.indexOf('\r') != -1)) throw new IllegalArgumentException( "\"line\" can not contain newline or carriage return characters."); StringBuffer ret = new StringBuffer(); int currentIndex = 0; while (currentIndex != line.length()) { if (state == State.DEFAULT) { if ((currentIndex + 2 < line.length()) && line.substring(currentIndex, currentIndex + 3) .equals("/**")) { state = State.COMMENT_JAVADOC; } else if ((currentIndex + 1 < line.length()) && line.substring(currentIndex, currentIndex + 2) .equals("/*")) { state = State.COMMENT_MULTI; } else if ((currentIndex + 1 < line.length()) && (line.substring(currentIndex, currentIndex + 2) .equals("//"))) { state = State.COMMENT_SINGLE; } else if (Character.isJavaIdentifierStart(line .charAt(currentIndex))) { state = State.KEYWORD; } else if (line.charAt(currentIndex) == '\'') { state = State.QUOTE_SINGLE; } else if (line.charAt(currentIndex) == '"') { state = State.QUOTE_DOUBLE; } else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } } // End of State.DEFAULT else if ((state == State.COMMENT_MULTI) || (state == State.COMMENT_JAVADOC)) { // Print everything from the current character until the // closing */ No exceptions. ret.append("<span class=\"comment\">"); while ((currentIndex != line.length()) && !((currentIndex + 1 < line.length()) && (line .substring(currentIndex, currentIndex + 2) .equals("*/")))) { ret.append(escapeEntity(line.charAt(currentIndex++))); } if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("*/</span>"); state = State.DEFAULT; currentIndex += 2; } } // End of State.COMMENT_MULTI else if (state == State.COMMENT_SINGLE) { // Print everything from the current character until the // end of the line ret.append("<span class=\"comment\">"); while (currentIndex != line.length()) { ret.append(escapeEntity(line.charAt(currentIndex++))); } ret.append("</span>"); state = State.DEFAULT; } // End of State.COMMENT_SINGLE else if (state == State.KEYWORD) { StringBuffer tmp = new StringBuffer(); do { tmp.append(line.charAt(currentIndex++)); } while ((currentIndex != line.length()) && (Character.isJavaIdentifierPart(line .charAt(currentIndex)))); if (javaKeywords.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveLiterals.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveTypes.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else ret.append(tmp); if (tmp.toString().equals("import")) state = State.IMPORT_NAME; else if (tmp.toString().equals("package")) state = State.PACKAGE_NAME; else state = State.DEFAULT; } // End of State.KEYWORD else if (state == State.IMPORT_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.IMPORT_NAME else if (state == State.PACKAGE_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.PACKAGE_NAME else if (state == State.QUOTE_DOUBLE) { // Print everything from the current character until the // closing ", checking for \" ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '"') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_DOUBLE else if (state == State.QUOTE_SINGLE) { // Print everything from the current character until the // closing ', checking for \' ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '\'') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_SINGLE else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } // End of unknown state } return ret.toString(); }
1,122,945
private String processLine(final String line) { if (line == null) throw new IllegalArgumentException("\"line\" can not be null."); if ((line.indexOf('\n') != -1) || (line.indexOf('\r') != -1)) throw new IllegalArgumentException( "\"line\" can not contain newline or carriage return characters."); StringBuffer ret = new StringBuffer(); int currentIndex = 0; while (currentIndex != line.length()) { if (state == State.DEFAULT) { if ((currentIndex + 2 < line.length()) && line.substring(currentIndex, currentIndex + 3) .equals("/**")) { state = State.COMMENT_JAVADOC; } else if ((currentIndex + 1 < line.length()) && line.substring(currentIndex, currentIndex + 2) .equals("/*")) { state = State.COMMENT_MULTI; } else if ((currentIndex + 1 < line.length()) && (line.substring(currentIndex, currentIndex + 2) .equals("//"))) { state = State.COMMENT_SINGLE; } else if (Character.isJavaIdentifierStart(line .charAt(currentIndex))) { state = State.KEYWORD; } else if (line.charAt(currentIndex) == '\'') { state = State.QUOTE_SINGLE; } else if (line.charAt(currentIndex) == '"') { state = State.QUOTE_DOUBLE; } else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } } // End of State.DEFAULT else if ((state == State.COMMENT_MULTI) || (state == State.COMMENT_JAVADOC)) { // Print everything from the current character until the // closing */ No exceptions. ret.append("<span class=\"comment\">"); while ((currentIndex != line.length()) && !((currentIndex + 1 < line.length()) && (line .substring(currentIndex, currentIndex + 2) .equals("*/")))) { ret.append(escapeEntity(line.charAt(currentIndex++))); } if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("*/</span>"); state = State.DEFAULT; currentIndex += 2; } } // End of State.COMMENT_MULTI else if (state == State.COMMENT_SINGLE) { // Print everything from the current character until the // end of the line ret.append("<span class=\"comment\">"); while (currentIndex != line.length()) { ret.append(escapeEntity(line.charAt(currentIndex++))); } ret.append("</span>"); state = State.DEFAULT; } // End of State.COMMENT_SINGLE else if (state == State.KEYWORD) { StringBuffer tmp = new StringBuffer(); do { tmp.append(line.charAt(currentIndex++)); } while ((currentIndex != line.length()) && (Character.isJavaIdentifierPart(line .charAt(currentIndex)))); if (javaKeywords.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveLiterals.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveTypes.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else ret.append(tmp); if (tmp.toString().equals("import")) state = State.IMPORT_NAME; else if (tmp.toString().equals("package")) state = State.PACKAGE_NAME; else state = State.DEFAULT; } // End of State.KEYWORD else if (state == State.IMPORT_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.IMPORT_NAME else if (state == State.PACKAGE_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.PACKAGE_NAME else if (state == State.QUOTE_DOUBLE) { // Print everything from the current character until the // closing ", checking for \" ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '"') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_DOUBLE else if (state == State.QUOTE_SINGLE) { // Print everything from the current character until the // closing ', checking for \' ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '\'') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\"</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_SINGLE else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } // End of unknown state } return ret.toString(); }
private String processLine(final String line) { if (line == null) throw new IllegalArgumentException("\"line\" can not be null."); if ((line.indexOf('\n') != -1) || (line.indexOf('\r') != -1)) throw new IllegalArgumentException( "\"line\" can not contain newline or carriage return characters."); StringBuffer ret = new StringBuffer(); int currentIndex = 0; while (currentIndex != line.length()) { if (state == State.DEFAULT) { if ((currentIndex + 2 < line.length()) && line.substring(currentIndex, currentIndex + 3) .equals("/**")) { state = State.COMMENT_JAVADOC; } else if ((currentIndex + 1 < line.length()) && line.substring(currentIndex, currentIndex + 2) .equals("/*")) { state = State.COMMENT_MULTI; } else if ((currentIndex + 1 < line.length()) && (line.substring(currentIndex, currentIndex + 2) .equals("//"))) { state = State.COMMENT_SINGLE; } else if (Character.isJavaIdentifierStart(line .charAt(currentIndex))) { state = State.KEYWORD; } else if (line.charAt(currentIndex) == '\'') { state = State.QUOTE_SINGLE; } else if (line.charAt(currentIndex) == '"') { state = State.QUOTE_DOUBLE; } else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } } // End of State.DEFAULT else if ((state == State.COMMENT_MULTI) || (state == State.COMMENT_JAVADOC)) { // Print everything from the current character until the // closing */ No exceptions. ret.append("<span class=\"comment\">"); while ((currentIndex != line.length()) && !((currentIndex + 1 < line.length()) && (line .substring(currentIndex, currentIndex + 2) .equals("*/")))) { ret.append(escapeEntity(line.charAt(currentIndex++))); } if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("*/</span>"); state = State.DEFAULT; currentIndex += 2; } } // End of State.COMMENT_MULTI else if (state == State.COMMENT_SINGLE) { // Print everything from the current character until the // end of the line ret.append("<span class=\"comment\">"); while (currentIndex != line.length()) { ret.append(escapeEntity(line.charAt(currentIndex++))); } ret.append("</span>"); state = State.DEFAULT; } // End of State.COMMENT_SINGLE else if (state == State.KEYWORD) { StringBuffer tmp = new StringBuffer(); do { tmp.append(line.charAt(currentIndex++)); } while ((currentIndex != line.length()) && (Character.isJavaIdentifierPart(line .charAt(currentIndex)))); if (javaKeywords.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveLiterals.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else if (javaPrimitiveTypes.contains(tmp.toString())) ret.append("<span class=\"keyword\">" + tmp + "</span>"); else ret.append(tmp); if (tmp.toString().equals("import")) state = State.IMPORT_NAME; else if (tmp.toString().equals("package")) state = State.PACKAGE_NAME; else state = State.DEFAULT; } // End of State.KEYWORD else if (state == State.IMPORT_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.IMPORT_NAME else if (state == State.PACKAGE_NAME) { ret.append(escapeEntity(line.charAt(currentIndex++))); state = State.DEFAULT; } // End of State.PACKAGE_NAME else if (state == State.QUOTE_DOUBLE) { // Print everything from the current character until the // closing ", checking for \" ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '"') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\'</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_DOUBLE else if (state == State.QUOTE_SINGLE) { // Print everything from the current character until the // closing ', checking for \' ret.append("<span class=\"string\">"); do { ret.append(escapeEntity(line.charAt(currentIndex++))); } while ((currentIndex != line.length()) && (!(line.charAt(currentIndex) == '\'') || (line .charAt(currentIndex - 1) == '\\'))); if (currentIndex == line.length()) { ret.append("</span>"); } else { ret.append("\'</span>"); state = State.DEFAULT; currentIndex++; } } // End of State.QUOTE_SINGLE else { // Default: No highlighting. ret.append(escapeEntity(line.charAt(currentIndex++))); } // End of unknown state } return ret.toString(); }
1,122,946
public void setHeadline(Object o) { setValue(FIELDNAME_HEADLINE, o.toString()); }
public void setHeadline(String s) { setValue(FIELDNAME_HEADLINE, s); }
1,122,947
public final Object build(BuildContext bc) throws BuildException { Variable var = VariableBuilder.newVariable(_names,bc,_filtered); return var.evaluate(bc); }
public final Object build(BuildContext bc) throws BuildException { Variable var = VariableBuilder.newVariable(_names,bc,_filtered); return var.evaluate(bc); }
1,122,948
public void displayTab(Event e) { List<NoteTreeNode> treeNodes = dd.getTree().getSelectedNodes(); for (NoteTreeNode treeNode : treeNodes) { DisplayedNote dn = treeNode.getDisplayedNote(); if (dn.getTab() == null) { dd.getTabFolder().addNoteTab(dn); } else { dn.getTab().select(); } } }
public void displayTab(Event e) { List<NoteTreeNode> treeNodes = dd.getTree().getSelectedNodes(); for (NoteTreeNode treeNode : treeNodes) { DisplayedNote dn = treeNode.getDisplayedNote(); if (dn.getTab() == null) { dd.getTabFolder().addNoteTab(dn); } else { dn.getTab().select(); } } }
1,122,949
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.getTableModel().setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
1,122,950
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
private void bookmarkRoom(String serviceName, Tree serviceTree) { int selectedRow = roomsTable.getSelectedRow(); if (-1 == selectedRow) { JOptionPane.showMessageDialog(dlg, Res.getString("message.select.add.room.to.add"), Res.getString("title.group.chat"), JOptionPane.INFORMATION_MESSAGE); return; } final String roomJID = (String)roomsTable.getValueAt(selectedRow, 2) + "@" + serviceName; final String roomName = (String)roomsTable.getValueAt(selectedRow, 1); // Check to see what type of room this is. try { final RoomInfo roomInfo = MultiUserChat.getRoomInfo(SparkManager.getConnection(), roomJID); if (!roomInfo.isPersistent()) { JOptionPane.showMessageDialog(dlg, Res.getString("message.bookmark.temporary.room.error"), Res.getString("title.error"), JOptionPane.ERROR_MESSAGE); return; } } catch (Exception e) { // Do not return } JiveTreeNode rootNode = (JiveTreeNode)serviceTree.getModel().getRoot(); TreePath rootPath = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName}); boolean isBookmarked = isBookmarked(roomJID); if (!isBookmarked) { JiveTreeNode node = (JiveTreeNode)serviceTree.getLastSelectedPathComponent(); if (node == null) { TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), Conferences.getDefaultServiceName()}); node = (JiveTreeNode)path.getLastPathComponent(); } JiveTreeNode roomNode = new JiveTreeNode(roomName, false, SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)); roomNode.setAssociatedObject(roomJID); node.add(roomNode); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.nodeStructureChanged(node); serviceTree.expandPath(rootPath); roomsTable.setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BOOKMARK_ICON)), selectedRow, 0); addBookmarkUI(false); } else { // Remove bookmark TreePath path = serviceTree.findByName(serviceTree, new String[]{rootNode.toString(), serviceName, roomName}); JiveTreeNode node = (JiveTreeNode)path.getLastPathComponent(); final DefaultTreeModel model = (DefaultTreeModel)serviceTree.getModel(); model.removeNodeFromParent(node); roomsTable.getTableModel().setValueAt(new JLabel(SparkRes.getImageIcon(SparkRes.BLANK_IMAGE)), selectedRow, 0); addBookmarkUI(true); } }
1,122,951