bugged
stringlengths
6
599k
fixed
stringlengths
10
599k
__index_level_0__
int64
0
1.13M
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getChildren()); } return sourceFiles; }
public SortedSet getSourceFiles() { SortedSet sourceFiles = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); sourceFiles.addAll(packageData.getSourceFiles()); } return sourceFiles; }
1,124,032
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
public SortedSet getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
1,124,033
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
public Collection getSubPackages(String packageName) { SortedSet subPackages = new TreeSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
1,124,034
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().equals(packageName)) subPackages.add(packageData); } return subPackages; }
public Collection getSubPackages(String packageName) { Collection subPackages = new HashSet(); Iterator iter = this.children.values().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); if (packageData.getName().startsWith(packageName)) subPackages.add(packageData); } return subPackages; }
1,124,035
private void selectComponent() { WFComponentSelector cs = (WFComponentSelector) findComponent(COMPONENT_SELECTOR_ID); String headline = WFUtil.getStringValue(ARTICLE_ITEM_BEAN_ID, "headline"); if (cs != null) { if (headline == null || headline.length() == 0) { cs.setSelectedId(NO_ARTICLE_ID, true); cs.setSelectedId(ARTICLE_VIEW_ID, false); }else { cs.setSelectedId(NO_ARTICLE_ID, false); cs.setSelectedId(ARTICLE_VIEW_ID, true); } }else { cs.setSelectedId(NO_ARTICLE_ID, false); cs.setSelectedId(ARTICLE_VIEW_ID, true); System.out.println("Could not find the Component selector!!!"); } }
private void selectComponent() { WFComponentSelector cs = (WFComponentSelector) findComponent(COMPONENT_SELECTOR_ID); ArticleItemBean articleBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String headline = articleBean.getHeadline(); if (cs != null) { if (headline == null || headline.length() == 0) { cs.setSelectedId(NO_ARTICLE_ID, true); cs.setSelectedId(ARTICLE_VIEW_ID, false); }else { cs.setSelectedId(NO_ARTICLE_ID, false); cs.setSelectedId(ARTICLE_VIEW_ID, true); } }else { cs.setSelectedId(NO_ARTICLE_ID, false); cs.setSelectedId(ARTICLE_VIEW_ID, true); System.out.println("Could not find the Component selector!!!"); } }
1,124,037
public static FastWriter getInstance(OutputStream out, String encoding) throws UnsupportedEncodingException { FastWriter fw = null; SimpleStack ss = (SimpleStack) _writerCache.get(encoding); if (ss != null) { fw = (FastWriter) ss.pop(); fw.reset(out); } if (fw == null) { fw = new FastWriter(out,encoding); } return fw; }
public static FastWriter getInstance(OutputStream out, String encoding) throws UnsupportedEncodingException { FastWriter fw = null; SimpleStack ss = (SimpleStack) _writerCache.get(encoding); if (ss != null) { fw = (FastWriter) ss.pop(); if (fw != null) { fw.reset(out); return fw; } } if (fw == null) { fw = new FastWriter(out,encoding); } return fw; }
1,124,038
public static FastWriter getInstance(OutputStream out, String encoding) throws UnsupportedEncodingException { FastWriter fw = null; SimpleStack ss = (SimpleStack) _writerCache.get(encoding); if (ss != null) { fw = (FastWriter) ss.pop(); fw.reset(out); } if (fw == null) { fw = new FastWriter(out,encoding); } return fw; }
public static FastWriter getInstance(OutputStream out, String encoding) throws UnsupportedEncodingException { FastWriter fw = null; SimpleStack ss = (SimpleStack) _writerCache.get(encoding); if (ss != null) { fw = (FastWriter) ss.pop(); fw.reset(out); } if (fw == null) { fw = new FastWriter(out,encoding); } return fw; }
1,124,039
public void log(Date date, String name, String level, String message, Exception e) { synchronized(_args) { _args[0] = date; _args[1] = name; _args[2] = level; _args[3] = message; if (e == null) _servletContext.log(_mf.format(_args)); else _servletContext.log(e, _mf.format(_args)); } }
public void log(Date date, String name, String level, String message, Exception e) { synchronized(_args) { _args[0] = date; _args[1] = name; _args[2] = level; _args[3] = message; if (e == null) _servletContext.log(_mf.format(_args)); else _servletContext.log(_mf.format(_args),e); } }
1,124,041
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(AUTHOR_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle(); String ref = ARTICLE_ITEM_BEAN_ID + ".";// String bref = WFPage.CONTENT_BUNDLE + "."; WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID);// em.addErrorMessage(PUBLISHED_FROM_DATE_ID);// em.addErrorMessage(PUBLISHED_TO_DATE_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); Iterator iter = ICLocaleBusiness.getListOfLocalesJAVA().iterator(); HtmlSelectOneMenu langDropdown = new HtmlSelectOneMenu(); List arrayList = new ArrayList(); while(iter.hasNext()) { Locale locale = (Locale)iter.next(); String keyStr = locale.getLanguage(); String langStr = locale.getDisplayLanguage(); SelectItem itemTemp = new SelectItem(keyStr, langStr, keyStr, false); arrayList.add(itemTemp); } UISelectItems items = new UISelectItems(); items.setValue(arrayList); langDropdown.getChildren().add(items); ValueBinding vb = WFUtil.createValueBinding("#{" + ref +"contentLanguage" + "}"); langDropdown.setValueBinding("value", vb); langDropdown.getValue(); langDropdown.addValueChangeListener(this); langDropdown.setImmediate(true); langDropdown.setOnchange("submit();"); p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(70); p.getChildren().add(headlineInput); //HtmlSelectOneMenu localeMenu = WFUtil.getSelectOneMenu(LOCALE_ID, ref + "allLocales", ref + "pendingLocaleId"); //localeMenu.setOnchange("document.forms[0].submit();"); //p.getChildren().add(localeMenu); p.getChildren().add(WFUtil.group(localizer.getTextVB("author"), WFUtil.getText(":"))); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(70); User user = iwc.getCurrentUser(); if(user!=null){ String userName = user.getName(); getArticleItemBean().setAuthor(userName); } p.getChildren().add(authorInput); //Article body p.getChildren().add(WFUtil.group(localizer.getTextVB("body"), WFUtil.getText(":"))); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "500px", "400px"); //HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body"); /*bodyArea.addPlugin(HTMLArea.PLUGIN_TABLE_OPERATIONS); bodyArea.addPlugin(HTMLArea.PLUGIN_DYNAMIC_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CSS, "3"); bodyArea.addPlugin(HTMLArea.PLUGIN_CONTEXT_MENU); bodyArea.addPlugin(HTMLArea.PLUGIN_LIST_TYPE); bodyArea.addPlugin(HTMLArea.PLUGIN_CHARACTER_MAP); */ bodyArea.setAllowFontSelection(false); p.getChildren().add(WFUtil.group(bodyArea, WFUtil.getBreak())); p.getChildren().add(WFUtil.group(localizer.getTextVB("teaser"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "500px", "60px"); p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(localizer.getTextVB("source"), WFUtil.getText(":"))); HtmlInputText sourceArea = WFUtil.getInputText(SOURCE_ID, ref + "source"); sourceArea.setSize(70); p.getChildren().add(sourceArea); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getPlainFormPanel(1);/* p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getTextVB(ref + "creationDate") ));*/// p.getChildren().add(WFUtil.getText(" "));// UIComponent t = WFUtil.group(localizer.getHeaderTextVB("status"), WFUtil.getText(": "));// t.getChildren().add(WFUtil.getTextVB(ref + "status"));// p.getChildren().add(t); p.getChildren().add(WFUtil.group(localizer.getTextVB("status"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(WFUtil.group(localizer.getTextVB("current_version"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.getTextVB(ref + "versionName")); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); // p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(localizer.getTextVB("comment"), WFUtil.getText(":")));// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "500px", "60px"); p.getChildren().add(commentArea);// WFContainer attachmentContainer = new WFContainer();// attachmentContainer.add(WFUtil.getButtonVB(ADD_ATTACHMENT_ID, bref + "add_attachment", this));// attachmentContainer.add(WFUtil.getBreak());// attachmentContainer.add(getAttachmentList());// p.getChildren().add(attachmentContainer); // mainContainer.add(p); // p = WFPanelUtil.getFormPanel(1);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "related_content_items"), WFUtil.getText(":"))); // WFContainer contentItemContainer = new WFContainer(); // contentItemContainer.add(WFUtil.getButtonVB(ADD_RELATED_CONTENT_ITEM_ID, bref + "add_content_item", this));// contentItemContainer.add(WFUtil.getBreak());// contentItemContainer.add(getRelatedContentItemsList());// p.getChildren().add(contentItemContainer);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "publishing_date"), WFUtil.getText(":"))); // WFDateInput publishedFromInput = WFUtil.getDateInput(PUBLISHED_FROM_DATE_ID, ref + "case.publishedFromDate");// publishedFromInput.setShowTime(true);// p.getChildren().add(publishedFromInput);// p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "expiration_date"), WFUtil.getText(":"))); // WFDateInput publishedToInput = WFUtil.getDateInput(PUBLISHED_TO_DATE_ID, ref + "case.publishedToDate");// publishedToInput.setShowTime(true);// p.getChildren().add(publishedToInput); // mainContainer.add(p); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// mainContainer.add(WFUtil.getBreak());// p = WFPanelUtil.getPlainFormPanel(1);// HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this);// p.getChildren().add(editCategoriesButton); //Temporary taking away folderr location/* p.getChildren().add(WFUtil.group(localizer.getTextVB("folder"), WFUtil.getText(":"))); HtmlInputText folderInput = WFUtil.getInputText(FOLDER_ID, ref + "folderLocation"); if(null==folderInput.getValue() || "".equals(folderInput.getValue())) { String FolderString = ArticleUtil.getArticleYearMonthPath();// System.out.println("Folder "+FolderString); folderInput.setValue(FolderString); } else { File file = new File(folderInput.getValue().toString()); folderInput.setValue(file.getParentFile().getParent()); } folderInput.setSize(70); p.getChildren().add(folderInput); */ p.getChildren().add(WFUtil.getBreak()); //Categories// WebDAVCategories categoriesUI = new WebDAVCategories(); ArticleItemBean articleItemBean = (ArticleItemBean) WFUtil.getBeanInstance(ARTICLE_ITEM_BEAN_ID); String resourcePath = articleItemBean.getArticleResourcePath(); categoriesUI.setResourcePath(resourcePath); p.getChildren().add(categoriesUI); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak()); p.getChildren().add(WFUtil.getBreak());// WFComponentSelector cs = new WFComponentSelector();// cs.setId(BUTTON_SELECTOR_ID);// cs.setDividerText(" "); HtmlCommandButton saveButton = localizer.getButtonVB(SAVE_ID, "save", this);// HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, WFPage.CONTENT_BUNDLE + "save", this);// cs.add(saveButton);// cs.add(WFUtil.getButtonVB(FOR_REVIEW_ID, bref + "for_review", this));// cs.add(WFUtil.getButtonVB(PUBLISH_ID, bref + "publish", this));// cs.add(WFUtil.getButtonVB(REWRITE_ID, bref + "rewrite", this));// cs.add(WFUtil.getButtonVB(REJECT_ID, bref + "reject", this));// cs.add(WFUtil.getButtonVB(DELETE_ID, bref + "delete", this));// cs.add(WFUtil.getButtonVB(CANCEL_ID, bref + "cancel", this));// cs.setSelectedId(CANCEL_ID, true);// p.getChildren().add(cs); p.getChildren().add(saveButton); mainContainer.add(p); WFComponentSelector editorSelector = new WFComponentSelector(); editorSelector.setId(EDITOR_SELECTOR_ID); editorSelector.add(mainContainer); editorSelector.add(getCategoryEditContainer());// FileUploadForm f = new FileUploadForm(this, FILE_UPLOAD_ID, FILE_UPLOAD_CANCEL_ID); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
1,124,042
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem(Res.getString("menuitem.add.contact"), SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem(Res.getString("menuitem.add.contact.group"), SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem(Res.getString("menuitem.remove.from.group"), SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem(Res.getString("menuitem.start.a.chat"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem(Res.getString("menuitem.rename"), SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(treeScroller, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(unfiledGroup); addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { searchContacts(""); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); commandPanel.add(addContactButton); addContactButton.setToolTipText(Res.getString("message.add.a.contact")); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
public ContactList() { // Load Local Preferences localPreferences = SettingsManager.getLocalPreferences(); offlineGroup = new ContactGroup("Offline Group"); JToolBar toolbar = new JToolBar(); toolbar.setFloatable(false); addContactMenu = new JMenuItem(Res.getString("menuitem.add.contact"), SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); addContactGroupMenu = new JMenuItem(Res.getString("menuitem.add.contact.group"), SparkRes.getImageIcon(SparkRes.SMALL_ADD_IMAGE)); removeContactFromGroupMenu = new JMenuItem(Res.getString("menuitem.remove.from.group"), SparkRes.getImageIcon(SparkRes.SMALL_DELETE)); chatMenu = new JMenuItem(Res.getString("menuitem.start.a.chat"), SparkRes.getImageIcon(SparkRes.SMALL_MESSAGE_IMAGE)); renameMenu = new JMenuItem(Res.getString("menuitem.rename"), SparkRes.getImageIcon(SparkRes.DESKTOP_IMAGE)); addContactMenu.addActionListener(this); removeContactFromGroupMenu.addActionListener(this); chatMenu.addActionListener(this); renameMenu.addActionListener(this); setLayout(new BorderLayout()); addingGroupButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.ADD_CONTACT_IMAGE)); RolloverButton groupChatButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.JOIN_GROUPCHAT_IMAGE)); toolbar.add(addingGroupButton); toolbar.add(groupChatButton); addingGroupButton.addActionListener(this); mainPanel.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0, true, false)); mainPanel.setBackground((Color)UIManager.get("List.background")); treeScroller = new JScrollPane(mainPanel); treeScroller.setBorder(BorderFactory.createEmptyBorder()); treeScroller.getVerticalScrollBar().setBlockIncrement(50); treeScroller.getVerticalScrollBar().setUnitIncrement(20); retryPanel = new RetryPanel(); workspace = SparkManager.getWorkspace(); workspace.getCardPanel().add(RETRY_PANEL, retryPanel); add(treeScroller, BorderLayout.CENTER); // Load Properties file props = new Properties(); // Save to properties file. propertiesFile = new File(new File(Spark.getUserHome(), "Spark"), "groups.properties"); try { props.load(new FileInputStream(propertiesFile)); } catch (IOException e) { // File does not exist. } // Add ActionListener(s) to menus addContactGroup(unfiledGroup); addContactGroup(offlineGroup); showHideMenu.setSelected(false); // Add KeyMappings getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control N"), "searchContacts"); getActionMap().put("searchContacts", new AbstractAction("searchContacts") { public void actionPerformed(ActionEvent evt) { SparkManager.getUserManager().searchContacts("", SparkManager.getWorkspace().getContactList()); } }); // Save state on shutdown. SparkManager.getMainWindow().addMainWindowListener(new MainWindowListener() { public void shutdown() { saveState(); } public void mainWindowActivated() { } public void mainWindowDeactivated() { } }); SparkManager.getConnection().addConnectionListener(this); // Get command panel and add View Online/Offline, Add Contact StatusBar statusBar = SparkManager.getWorkspace().getStatusBar(); JPanel commandPanel = statusBar.getCommandPanel(); final RolloverButton addContactButton = new RolloverButton(SparkRes.getImageIcon(SparkRes.USER1_ADD_16x16)); commandPanel.add(addContactButton); addContactButton.setToolTipText(Res.getString("message.add.a.contact")); addContactButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); } }); }
1,124,043
public void actionPerformed(ActionEvent evt) { searchContacts(""); }
public void actionPerformed(ActionEvent evt) { SparkManager.getUserManager().searchContacts("", SparkManager.getWorkspace().getContactList()); }
1,124,044
public void actionPerformed(ActionEvent e) { if (e.getSource() == addingGroupButton) { new RosterDialog().showRosterDialog(); } else if (e.getSource() == chatMenu) { if (activeItem != null) { activateChat(activeItem.getContactJID(), activeItem.getNickname()); } } else if (e.getSource() == addContactMenu) { RosterDialog rosterDialog = new RosterDialog(); if (activeGroup != null) { rosterDialog.setDefaultGroup(activeGroup); } rosterDialog.showRosterDialog(); } else if (e.getSource() == removeContactFromGroupMenu) { if (activeItem != null) { removeContactFromGroup(activeItem); } } else if (e.getSource() == renameMenu) { if (activeItem == null) { return; } String oldNickname = activeItem.getNickname(); String newNickname = JOptionPane.showInputDialog(this, Res.getString("label.rename.to") + ":", oldNickname); if (ModelUtil.hasLength(newNickname)) { String address = activeItem.getFullJID(); ContactGroup contactGroup = getContactGroup(activeItem.getGroupName()); ContactItem contactItem = contactGroup.getContactItemByNickname(activeItem.getNickname()); contactItem.setNickname(newNickname); final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(address); entry.setName(newNickname); final Iterator contactGroups = groupList.iterator(); String user = StringUtils.parseBareAddress(address); while (contactGroups.hasNext()) { ContactGroup cg = (ContactGroup)contactGroups.next(); ContactItem ci = cg.getContactItemByJID(user); if (ci != null) { ci.setNickname(newNickname); } } } } }
public void actionPerformed(ActionEvent e) { if (e.getSource() == addingGroupButton) { new RosterDialog().showRosterDialog(); } else if (e.getSource() == chatMenu) { if (activeItem != null) { SparkManager.getChatManager().activateChat(activeItem.getContactJID(), activeItem.getNickname()); } } else if (e.getSource() == addContactMenu) { RosterDialog rosterDialog = new RosterDialog(); if (activeGroup != null) { rosterDialog.setDefaultGroup(activeGroup); } rosterDialog.showRosterDialog(); } else if (e.getSource() == removeContactFromGroupMenu) { if (activeItem != null) { removeContactFromGroup(activeItem); } } else if (e.getSource() == renameMenu) { if (activeItem == null) { return; } String oldNickname = activeItem.getNickname(); String newNickname = JOptionPane.showInputDialog(this, Res.getString("label.rename.to") + ":", oldNickname); if (ModelUtil.hasLength(newNickname)) { String address = activeItem.getFullJID(); ContactGroup contactGroup = getContactGroup(activeItem.getGroupName()); ContactItem contactItem = contactGroup.getContactItemByNickname(activeItem.getNickname()); contactItem.setNickname(newNickname); final Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(address); entry.setName(newNickname); final Iterator contactGroups = groupList.iterator(); String user = StringUtils.parseBareAddress(address); while (contactGroups.hasNext()) { ContactGroup cg = (ContactGroup)contactGroups.next(); ContactItem ci = cg.getContactItemByJID(user); if (ci != null) { ci.setNickname(newNickname); } } } } }
1,124,045
public void actionPerformed(ActionEvent e) { new RosterDialog().showRosterDialog(); }
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
1,124,046
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
public void actionPerformed(ActionEvent e) { String groupName = JOptionPane.showInputDialog(getGUI(), Res.getString("message.name.of.group") + ":", Res.getString("title.add.new.group"), JOptionPane.QUESTION_MESSAGE); if (ModelUtil.hasLength(groupName)) { ContactGroup contactGroup = getContactGroup(groupName); if (contactGroup == null) { contactGroup = addContactGroup(groupName); contactGroup.setVisible(true); validateTree(); repaint(); } } }
1,124,047
public void run() { subscriptionRequest(presence.getFrom()); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
1,124,048
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Presence unsub = new Presence(Presence.Type.unsubscribed); unsub.setTo(presence.getFrom()); SparkManager.getConnection().sendPacket(unsub); Log.error(e); } } }
1,124,049
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
1,124,051
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
public void run() { Roster roster = SparkManager.getConnection().getRoster(); RosterEntry entry = roster.getEntry(presence.getFrom()); if (entry != null) { try { removeContactItem(presence.getFrom()); roster.removeEntry(entry); } catch (XMPPException e) { Log.error(e); } } String jid = StringUtils.parseBareAddress(presence.getFrom()); removeContactItem(jid); }
1,124,052
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
1,124,053
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
public void run() { SwingUtilities.invokeLater(new Runnable() { public void run() { final Iterator users = new ArrayList(initialPresences).iterator(); while (users.hasNext()) { Presence userToUpdate = (Presence)users.next(); initialPresences.remove(userToUpdate); updateUserPresence(userToUpdate); } } }); }
1,124,054
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
1,124,055
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
1,124,056
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
public void actionPerformed(ActionEvent e) { int ok = JOptionPane.showConfirmDialog(group, Res.getString("message.delete.confirmation", group.getGroupName()), Res.getString("title.confirmation"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.YES_OPTION) { String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { for (RosterEntry entry : rosterGroup.getEntries()) { try { rosterGroup.removeEntry(entry); } catch (XMPPException e1) { Log.error("Error removing entry", e1); } } } // Remove from UI removeContactGroup(group); invalidate(); repaint(); } }
1,124,057
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, Res.getString("label.rename.to") + ":", Res.getString("title.rename.roster.group"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
public void actionPerformed(ActionEvent e) { String newName = JOptionPane.showInputDialog(group, Res.getString("label.rename.to") + ":", Res.getString("title.rename.roster.group"), JOptionPane.QUESTION_MESSAGE); if (!ModelUtil.hasLength(newName)) { return; } String groupName = group.getGroupName(); Roster roster = SparkManager.getConnection().getRoster(); RosterGroup rosterGroup = roster.getGroup(groupName); if (rosterGroup != null) { removeContactGroup(group); rosterGroup.setName(newName); } }
1,124,058
public void contactItemDoubleClicked(ContactItem item) { activeItem = item; ChatManager chatManager = SparkManager.getChatManager(); boolean handled = chatManager.fireContactItemDoubleClicked(item); if (!handled) { activateChat(item.getContactJID(), item.getNickname()); } clearSelectionList(item); }
public void contactItemDoubleClicked(ContactItem item) { activeItem = item; ChatManager chatManager = SparkManager.getChatManager(); boolean handled = chatManager.fireContactItemDoubleClicked(item); if (!handled) { chatManager.activateChat(item.getContactJID(), item.getNickname()); } clearSelectionList(item); }
1,124,059
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
public void actionPerformed(ActionEvent actionEvent) { SparkManager.getTransferManager().sendFileTo(item); }
1,124,060
public void actionPerformed(ActionEvent e) { removeContactFromRoster(item); }
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
1,124,061
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
public void actionPerformed(ActionEvent e) { VCardManager vcardSupport = SparkManager.getVCardManager(); String jid = item.getFullJID(); vcardSupport.viewProfile(jid, SparkManager.getWorkspace()); }
1,124,062
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), Res.getString("message.idle.for", time), Res.getString("title.last.activity"), JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
public void actionPerformed(ActionEvent actionEvent) { try { LastActivity activity = LastActivity.getLastActivity(SparkManager.getConnection(), item.getFullJID()); long idleTime = (activity.getIdleTime() * 1000); String time = ModelUtil.getTimeFromLong(idleTime); JOptionPane.showMessageDialog(getGUI(), Res.getString("message.idle.for", time), Res.getString("title.last.activity"), JOptionPane.INFORMATION_MESSAGE); } catch (XMPPException e1) { } }
1,124,063
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.subscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
public void actionPerformed(ActionEvent e) { String jid = item.getFullJID(); Presence response = new Presence(Presence.Type.subscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
1,124,065
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
1,124,066
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); Presence response = new Presence(Presence.Type.subscribed); response.setTo(jid); SparkManager.getConnection().sendPacket(response); int ok = JOptionPane.showConfirmDialog(getGUI(), Res.getString("message.add.user"), Res.getString("message.add.to.roster"), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); if (ok == JOptionPane.OK_OPTION) { RosterDialog rosterDialog = new RosterDialog(); rosterDialog.setDefaultJID(UserManager.unescapeJID(jid)); rosterDialog.showRosterDialog(); } }
1,124,067
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
public void actionPerformed(ActionEvent e) { SparkManager.getWorkspace().removeAlert(layoutPanel); // Send subscribed Presence response = new Presence(Presence.Type.unsubscribe); response.setTo(jid); SparkManager.getConnection().sendPacket(response); }
1,124,068
private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry)) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumeted entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } }
private void addInstrumentationToArchive(ZipInputStream archive, ZipOutputStream output) throws Exception { ZipEntry entry; while ((entry = archive.getNextEntry()) != null) { try { ZipEntry outputEntry = new ZipEntry(entry.getName()); output.putNextEntry(outputEntry); // Read current entry byte[] entryBytes = IOUtil .createByteArrayFromInputStream(archive); // Check if we have class file if (isClass(entry)) { // Instrument class ClassReader cr = new ClassReader(entryBytes); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexes); cr.accept(cv, CustomAttribute.getExtraAttributes(), false); // If class was instrumented, get bytes that define the // class if (cv.isInstrumented()) { logger.debug("Putting instrumented entry: " + entry.getName()); entryBytes = cw.toByteArray(); } } // Add entry to the output output.write(entryBytes); output.closeEntry(); archive.closeEntry(); } catch (Exception e) { logger.warn("Problems with archive entry: " + entry); throw e; } output.flush(); } }
1,124,069
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
1,124,070
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Map passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
public final void write(FastWriter out, Context data) throws IOException { try { if (_content == null) { parse(); } } catch (Exception e) { _log.error("Template: Unable to read template: " + this, e); out.write("<!--\n Template failed to read. Reason: "); out.write(e.toString()); out.write(" \n-->"); } try { _content.write(out,data); } catch (PropertyException e) { String warning = "Template: Missing data in Context passed to template " + this; _log.warning(warning,e); out.write("<!--\n Could not interpret template. Reason: "); out.write(warning); out.write(e.toString()); out.write(" \n-->"); } }
1,124,071
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
1,124,072
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
public void closeActiveRoom() { ChatRoom room = null; try { room = getActiveChatRoom(); } catch (ChatRoomNotFoundException e1) { // AgentLog.logError("Chat room not found", e1); } // Confirm end session boolean isGroupChat = room.getChatType() == Message.Type.GROUP_CHAT; String message = "Would you like to end this session?"; if (true) { room.closeChatRoom(); return; } else { if (!room.isActive()) { room.closeChatRoom(); return; } } final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), message, "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { room.closeChatRoom(); return; } }
1,124,073
public void addClassData(ClassData classData) { if (children.containsKey(classData.getBaseName())) throw new IllegalArgumentException("Source file " + this.name + " already contains a class with the name " + classData.getBaseName()); // Each key is a class basename, stored as an String object. // Each value is information about the class, stored as a ClassData object. children.put(classData.getBaseName(), classData); }
public synchronized void addClassData(ClassData classData) { if (children.containsKey(classData.getBaseName())) throw new IllegalArgumentException("Source file " + this.name + " already contains a class with the name " + classData.getBaseName()); // Each key is a class basename, stored as an String object. // Each value is information about the class, stored as a ClassData object. children.put(classData.getBaseName(), classData); }
1,124,075
protected String createDiscoveryPathName(String uri, String localName) { if (uri == null || uri.length() == 0) { return localName; } // TODO proper encoding required // lets replace any dodgy characters return uri.replaceAll("://", "/").replace(':', '/').replace(' ', '_') + "/" + localName; }
protected String createDiscoveryPathName(String uri, String localName) { if (uri == null || uri.length() == 0) { return localName; } // TODO proper encoding required // lets replace any dodgy characters return createDiscoveryPathName(uri) + "/" + localName;//", "/").replace(':', '/').replace(' ', '_') + "/" + localName; }
1,124,076
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // 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) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = META_INF_PREFIX + createDiscoveryPathName(namespaceURI, localName); InputStream in = loadResource(uri); if (in == null) { in = loadResource(META_INF_PREFIX + createDiscoveryPathName(namespaceURI)); } // 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) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
1,124,077
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // 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) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // 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) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
1,124,078
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // 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) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
protected MappingMetaData findNamespaceProperties(String namespaceURI, String localName) { // lets look for the magic prefix if (namespaceURI != null && namespaceURI.startsWith(JAVA_PACKAGE_PREFIX)) { String packageName = namespaceURI.substring(JAVA_PACKAGE_PREFIX.length()); return new MappingMetaData(packageName); } String uri = "META-INF/services/org/xbean/spring/" + createDiscoveryPathName(namespaceURI, localName); // 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) { logger.warn("Could not find resource: " + uri); return null; } } // lets load the file try { Properties properties = new Properties(); properties.load(in); return new MappingMetaData(properties); } catch (IOException e) { log.warn("Failed to load resource from uri: " + uri, e); return null; } }
1,124,079
protected int parseBeanDefinitions(Element root) throws BeanDefinitionStoreException { NodeList nl = root.getChildNodes(); int beanDefinitionCount = 0; for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element ele = (Element) node; if (IMPORT_ELEMENT.equals(node.getNodeName())) { importBeanDefinitionResource(ele); } else if (ALIAS_ELEMENT.equals(node.getNodeName())) { String name = ele.getAttribute(NAME_ATTRIBUTE); String alias = ele.getAttribute(ALIAS_ATTRIBUTE); getBeanDefinitionReader().getBeanFactory().registerAlias(name, alias); } else if (BEAN_ELEMENT.equals(node.getNodeName())) { beanDefinitionCount++; BeanDefinitionHolder bdHolder = parseBeanDefinitionElement(ele, false); BeanDefinitionReaderUtils.registerBeanDefinition(bdHolder, getBeanDefinitionReader().getBeanFactory()); } else { BeanDefinitionHolder bdHolder = parseBeanFromExtensionElement(ele); if (bdHolder != null) { beanDefinitionCount++; } else { log.debug("Ignoring unknown element namespace: " + ele.getNamespaceURI() + " localName: " + ele.getLocalName()); } BeanDefinitionReaderUtils.registerBeanDefinition(bdHolder, getBeanDefinitionReader().getBeanFactory()); } } } return beanDefinitionCount; }
protected int parseBeanDefinitions(Element root) throws BeanDefinitionStoreException { NodeList nl = root.getChildNodes(); int beanDefinitionCount = 0; for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); if (node instanceof Element) { Element ele = (Element) node; if (IMPORT_ELEMENT.equals(node.getNodeName())) { importBeanDefinitionResource(ele); } else if (ALIAS_ELEMENT.equals(node.getNodeName())) { String name = ele.getAttribute(NAME_ATTRIBUTE); String alias = ele.getAttribute(ALIAS_ATTRIBUTE); getBeanDefinitionReader().getBeanFactory().registerAlias(name, alias); } else if (BEAN_ELEMENT.equals(node.getNodeName())) { beanDefinitionCount++; BeanDefinitionHolder bdHolder = parseBeanDefinitionElement(ele, false); } else { BeanDefinitionHolder bdHolder = parseBeanFromExtensionElement(ele); if (bdHolder != null) { beanDefinitionCount++; } else { log.debug("Ignoring unknown element namespace: " + ele.getNamespaceURI() + " localName: " + ele.getLocalName()); } } } } return beanDefinitionCount; }
1,124,080
public void run() { int period = now(); while( !isInterrupted()) { try { sleep(_duration); } catch (InterruptedException e) { continue; } int newPeriod = now(); while (period != newPeriod) { if (++period >= _periods) period = 0; synchronized(_locks[period]) { Runnable tasks[] = _tasks[period]; boolean repeats[] = _repeats[period]; for (int i = 0; i < tasks.length; i++) { if (tasks[i] != null) { try { tasks[i].run(); } catch (Exception e) { _syslog.warning(this + ": task " + tasks[i] + " threw an exception", e); } finally { if (!repeats[i]) { tasks[i] = null; } } } } } } } }
public void run() { int period = now(); while( !isInterrupted()) { try { sleep(_duration); } catch (InterruptedException e) { break; } int newPeriod = now(); while (period != newPeriod) { if (++period >= _periods) period = 0; synchronized(_locks[period]) { Runnable tasks[] = _tasks[period]; boolean repeats[] = _repeats[period]; for (int i = 0; i < tasks.length; i++) { if (tasks[i] != null) { try { tasks[i].run(); } catch (Exception e) { _syslog.warning(this + ": task " + tasks[i] + " threw an exception", e); } finally { if (!repeats[i]) { tasks[i] = null; } } } } } } } }
1,124,081
public XMLReport(ProjectData projectData, File destinationDir, File sourceDirectory) throws IOException { this.sourceDirectory = sourceDirectory; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(sourceDirectory); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
public XMLReport(ProjectData projectData, File destinationDir, FileFinder finder) throws IOException { this.sourceDirectory = sourceDirectory; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(sourceDirectory); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
1,124,082
public XMLReport(ProjectData projectData, File destinationDir, File sourceDirectory) throws IOException { this.sourceDirectory = sourceDirectory; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(sourceDirectory); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
public XMLReport(ProjectData projectData, File destinationDir, File sourceDirectory) throws IOException { this.finder = finder; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(sourceDirectory); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
1,124,083
public XMLReport(ProjectData projectData, File destinationDir, File sourceDirectory) throws IOException { this.sourceDirectory = sourceDirectory; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(sourceDirectory); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
public XMLReport(ProjectData projectData, File destinationDir, File sourceDirectory) throws IOException { this.sourceDirectory = sourceDirectory; pw = new PrintWriter(new FileWriter(new File(destinationDir, "coverage.xml"))); try { println("<?xml version=\"1.0\"?>"); println("<!DOCTYPE coverage SYSTEM \"http://cobertura.sourceforge.net/xml/" + coverageDTD + "\">"); println(""); // TODO: Set a schema? //println("<coverage " + sourceDirectories.toString() + " xmlns=\"http://cobertura.sourceforge.net\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:schemaLocation=\"http://cobertura.sourceforge.net/xml/coverage.xsd\">"); println("<coverage line-rate=\"" + projectData.getLineCoverageRate() + "\" branch-rate=\"" + projectData.getBranchCoverageRate() + "\" version=\"" + Header.version() + "\" timestamp=\"" + new Date().getTime() + "\">"); increaseIndentation(); dumpSources(); dumpPackages(projectData); decreaseIndentation(); println("</coverage>"); } finally { pw.close(); } }
1,124,084
private void dumpClass(ClassData classData) { logger.debug("Dumping class " + classData.getName()); double ccn = Util.getCCN(new File(sourceDirectory, classData .getSourceFileName()), false); println("<class name=\"" + classData.getName() + "\" filename=\"" + classData.getSourceFileName() + "\" line-rate=\"" + classData.getLineCoverageRate() + "\" branch-rate=\"" + classData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpMethods(classData); dumpLines(classData); decreaseIndentation(); println("</class>"); }
private void dumpClass(ClassData classData) { logger.debug("Dumping class " + classData.getName()); double ccn = Util.getCCN(finder.findFile(classData .getSourceFileName()), false); println("<class name=\"" + classData.getName() + "\" filename=\"" + classData.getSourceFileName() + "\" line-rate=\"" + classData.getLineCoverageRate() + "\" branch-rate=\"" + classData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpMethods(classData); dumpLines(classData); decreaseIndentation(); println("</class>"); }
1,124,085
private void dumpPackage(PackageData packageData) { logger.debug("Dumping package " + packageData.getName()); double ccn = Util.getCCN(new File(sourceDirectory, packageData .getSourceFileName()), false); println("<package name=\"" + packageData.getName() + "\" line-rate=\"" + packageData.getLineCoverageRate() + "\" branch-rate=\"" + packageData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpSourceFiles(packageData); decreaseIndentation(); println("</package>"); }
private void dumpPackage(PackageData packageData) { logger.debug("Dumping package " + packageData.getName()); double ccn = Util.getCCN(new File(sourceDirectory, packageData .getSourceFileName()), false); println("<package name=\"" + packageData.getName() + "\" line-rate=\"" + packageData.getLineCoverageRate() + "\" branch-rate=\"" + packageData.getBranchCoverageRate() + "\" complexity=\"" + ccn + "\"" + ">"); increaseIndentation(); dumpSourceFiles(packageData); decreaseIndentation(); println("</package>"); }
1,124,086
private void dumpSources(File sourceDirectory) { if (sourceDirectory == null) return; println("<sources>"); increaseIndentation(); dumpSource(sourceDirectory); decreaseIndentation(); println("</sources>"); }
private void dumpSources() { if (sourceDirectory == null) return; println("<sources>"); increaseIndentation(); dumpSource(sourceDirectory); decreaseIndentation(); println("</sources>"); }
1,124,087
private void dumpSources(File sourceDirectory) { if (sourceDirectory == null) return; println("<sources>"); increaseIndentation(); dumpSource(sourceDirectory); decreaseIndentation(); println("</sources>"); }
private void dumpSources(File sourceDirectory) { if (sourceDirectory == null) return; println("<sources>"); increaseIndentation(); dumpSource(sourceDirectory); decreaseIndentation(); println("</sources>"); }
1,124,088
private void dumpSources(File sourceDirectory) { if (sourceDirectory == null) return; println("<sources>"); increaseIndentation(); dumpSource(sourceDirectory); decreaseIndentation(); println("</sources>"); }
private void dumpSources(File sourceDirectory) { if (sourceDirectory == null) return; println("<sources>"); increaseIndentation(); for (Iterator it = finder.getBaseDirectories().iterator(); it.hasNext(); ) { File dir = (File) it.next(); dumpSource(dir); } decreaseIndentation(); println("</sources>"); }
1,124,089
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, context.getEncoding()); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
1,124,090
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString(context.getEncoding()); } catch (IOException e) { Engine.log.exception(e); Engine.log.error("evaluate got IO exception on write to StringWriter"); return ""; } }
1,124,091
public void generate(JFormatter f) { f.p(value.getName().replace('$', '.')); f.p(".class"); }
public void generate(JFormatter f) { f.p(value.getName().replace('$', '.')); f.p(".class"); }
1,124,092
final public boolean setProperty(final Object[] names, final Object value) throws PropertyException, ContextException { if (names.length == 0) { return false; } else if (_bean == null) { return setLocal(names, value) || setTool(names, value); } else { return PropertyOperator.setProperty(this,_bean,names,value); } }
final public boolean setProperty(final Object[] names, final Object value) throws PropertyException, ContextException { if (names.length == 0) { return false; } else if (_bean == null) { return setLocal(names, value) || setTool(names, value); } else { return PropertyOperator.setProperty(this,_bean,names,value) || setTool(names, value); } }
1,124,093
public void addClassData(ClassData classData) { LOGGER.debug("ProjectData.addClassData: " + classData.getName()); String packageName = classData.getPackageName(); PackageData packageData = (PackageData)children.get(packageName); if (packageData == null) { packageData = new PackageData(packageName); // Each key is a package name, stored as an String object. // Each value is information about the package, stored as a PackageData object. this.children.put(packageName, packageData); } packageData.addClassData(classData); }
public void addClassData(ClassData classData) { String packageName = classData.getPackageName(); PackageData packageData = (PackageData)children.get(packageName); if (packageData == null) { packageData = new PackageData(packageName); // Each key is a package name, stored as an String object. // Each value is information about the package, stored as a PackageData object. this.children.put(packageName, packageData); } packageData.addClassData(classData); }
1,124,094
public ClassData getClassData(String name) { for (Iterator it = children.values().iterator(); it.hasNext(); ) { PackageData packageData = (PackageData) it.next(); ClassData classData = packageData.getClassData(name); if (classData != null) { return classData; } } return null; }
public ClassData getClassData(String name) { for (Iterator it = children.values().iterator(); it.hasNext(); ) { PackageData packageData = (PackageData) it.next(); ClassData classData = packageData.getClassData(name); if (classData != null) { return classData; } } return null; }
1,124,096
public void initialize() { soundPreference = new SoundPreference(); SparkManager.getPreferenceManager().addPreference(soundPreference); SparkManager.getChatManager().addChatRoomListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } } }, new PacketTypeFilter(Presence.class)); Thread thread = new Thread(new Runnable() { public void run() { soundPreference.loadFromFile(); } }); thread.start(); }
public void initialize() { soundPreference = new SoundPreference(); SparkManager.getPreferenceManager().addPreference(soundPreference); SparkManager.getChatManager().addChatRoomListener(this); SparkManager.getConnection().addPacketListener(new PacketListener() { public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } } }, new PacketTypeFilter(Presence.class)); Thread thread = new Thread(new Runnable() { public void run() { soundPreference.loadFromFile(); } }); thread.start(); }
1,124,097
public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } }
public void processPacket(Packet packet) { Presence presence = (Presence)packet; if (presence != null && presence.getType() == Presence.Type.unavailable) { SoundPreferences preferences = soundPreference.getPreferences(); if (preferences != null && preferences.isPlayOfflineSound()) { String offline = preferences.getOfflineSound(); File offlineFile = new File(offline); SparkManager.getSoundManager().playClip(offlineFile); } } }
1,124,098
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); final Iterator bookmarkLinks = bookmarkedLinks.iterator(); while (bookmarkLinks.hasNext()) { final BookmarkedURL link = (BookmarkedURL)bookmarkLinks.next(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
1,124,099
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
1,124,100
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
1,124,101
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
public void initialize() { final SwingWorker bookmarkThreadWorker = new SwingWorker() { public Object construct() { // Register own provider for simpler implementation. PrivateDataManager.addPrivateDataProvider("storage", "storage:bookmarks", new Bookmarks.Provider()); PrivateDataManager manager = new PrivateDataManager(SparkManager.getConnection()); Bookmarks bookmarks = null; try { bookmarks = (Bookmarks)manager.getPrivateData("storage", "storage:bookmarks"); } catch (XMPPException e) { Log.error(e); } return bookmarks; } public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } } }; bookmarkThreadWorker.start(); }
1,124,102
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); final Iterator bookmarkLinks = bookmarkedLinks.iterator(); while (bookmarkLinks.hasNext()) { final BookmarkedURL link = (BookmarkedURL)bookmarkLinks.next(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
1,124,103
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
1,124,104
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
1,124,105
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
public void finished() { final Bookmarks bookmarks = (Bookmarks)get(); if (bookmarks != null) { Collection bookmarkedConferences = bookmarks.getBookmarkedConferences(); final Collection bookmarkedLinks = bookmarks.getBookmarkedURLS(); BookmarkUI bookmarkUI = new BookmarkUI(); Iterator links = bookmarkedLinks.iterator(); while (links.hasNext()) { final BookmarkedURL bookmarkedLink = (BookmarkedURL)links.next(); bookmarkUI.addURL(bookmarkedLink); } ContactList contactList = SparkManager.getWorkspace().getContactList(); contactList.getMainPanel().add(bookmarkUI); Iterator conferences = bookmarkedConferences.iterator(); while (conferences.hasNext()) { final BookmarkedConference bookmarkedConference = (BookmarkedConference)conferences.next(); bookmarkUI.addConference(bookmarkedConference); } } }
1,124,106
void parse_args(DirectiveDescriptor descriptor, ArgDescriptor[] args, DirectiveArgs da) throws ParseException { try { for (int i=0; i < args.length; ) { ArgDescriptor arg = args[i]; if (arg.type == Directive.ArgType_GROUP) parse_arg_group(descriptor, args, i, da); else if (arg.type == Directive.ArgType_CHOICE) { for (int j=0; j<arg.subordinateArgs; j++) { // Each child is a GROUP, so we want to look at child's first child ArgDescriptor child = args[arg.children[j]]; if (lookahead_keyword(args[child.children[0]].keyword)) parse_arg_group(descriptor, args, arg.children[j], da); } } else { Object o = parse_arg(descriptor, arg); da.setArg(arg.id, o); } i = arg.nextArg; } } catch (BuildException e) { throw new ParseException("BuildException", e); } }
void parse_args(DirectiveDescriptor descriptor, ArgDescriptor[] args, DirectiveArgs da) throws ParseException { try { for (int i=0; i < args.length; ) { ArgDescriptor arg = args[i]; if (arg.type == Directive.ArgType_GROUP) parse_arg_group(descriptor, args, i, da); else if (arg.type == Directive.ArgType_CHOICE) { for (int j=0; j<arg.subordinateArgs; j++) { // Each child is a GROUP, so we want to look at child's first child ArgDescriptor child = args[arg.children[j]]; if (lookahead_keyword(args[child.children[0]].keyword)) parse_arg_group(descriptor, args, arg.children[j], da); } } else { Object o = parse_arg(descriptor, arg); da.setArg(arg.id, o); } i = arg.nextArg; } } catch (BuildException e) { throw new ParseException("BuildException", e); } }
1,124,108
public void testQdox() throws Exception{ QdoxMappingLoader mappingLoader = new QdoxMappingLoader(DEFAULT_NAMESPACE, new File[] { new File("src/test")}); Set namespaces = mappingLoader.loadNamespaces(); validateModel(namespaces); }
public void testQdox() throws Exception{ String basedir = System.getProperties().getProperty("basedir", "."); QdoxMappingLoader mappingLoader = new QdoxMappingLoader(DEFAULT_NAMESPACE, new File[] { new File(basedir, "/src/test")}); Set namespaces = mappingLoader.loadNamespaces(); validateModel(namespaces); }
1,124,109
public void indent(int many) { newData(); _currentData.setType (WikiDataTypes.INDENT); _currentData.setData (""+many); }
public void indent(int many) { newData(); _currentData.setType (WikiDataTypes.INDENT); _currentData.setData (""+many); }
1,124,110
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
public SortedSet getLines() { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
1,124,112
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
public Collection getLines(String methodNameAndDescriptor) { Collection lines = new HashSet(); Iterator iter = children.values().iterator(); while (iter.hasNext()) { LineData next = (LineData)iter.next(); if (methodNameAndDescriptor.equals(next.getMethodName() + next.getMethodDescriptor())) { lines.add(next); } } return lines; }
1,124,113
void coverage(String[] filenames) { if (filenames.length == 0) { return; } for (int i = 0; i < filenames.length; i++) { getProject().log("Adding " + filenames[i] + " to list", Project.MSG_VERBOSE); addArg(filenames[i]); } saveArgs(); Copyright.print(System.out); System.out.println("instrumenting " + filenames.length + " " + (filenames.length == 1 ? "class" : "classes") + (toDir != null ? " to " + toDir : "")); /** * TODO: Do something here so that we can set System.in and System.out on * getJava() to the one we're using now. So that when instrumentation calls * System.out, it will show up as "[instrument] doing stuff" instead of * "[java] doing stuff" in the ant output. */ if (getJava().executeJava() != 0) { throw new BuildException(); } }
void coverage(String[] filenames) { if (filenames.length == 0) { return; } for (int i = 0; i < filenames.length; i++) { getProject().log("Adding " + filenames[i] + " to list", Project.MSG_VERBOSE); addArg(filenames[i]); } saveArgs(); Header.print(System.out); System.out.println("instrumenting " + filenames.length + " " + (filenames.length == 1 ? "class" : "classes") + (toDir != null ? " to " + toDir : "")); /** * TODO: Do something here so that we can set System.in and System.out on * getJava() to the one we're using now. So that when instrumentation calls * System.out, it will show up as "[instrument] doing stuff" instead of * "[java] doing stuff" in the ant output. */ if (getJava().executeJava() != 0) { throw new BuildException(); } }
1,124,114
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").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++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), 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(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").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++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean String id = articleItemBean[i].getMainCategory()+"/"+articleItemBean[i].getHeadline()+".xml"; ListArticlesBean bean = new ListArticlesBean(id, articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), 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,124,115
protected UIComponent getMainTaskbar() { String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setMainAreaStyleClass(null); tb.setId(MAIN_TASKBAR_ID); WFTab buttonContent = tb.addButtonVB(TASK_ID_CONTENT, bref + "content", getContentPerspective()); buttonContent.addActionListener(this); WFTab buttonEdit = tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditPerspective()); buttonEdit.addActionListener(this); tb.addTaskbarListener(this); UICommand debugButton = new HtmlCommandButton(); debugButton.setId("debugbutton"); debugButton.setValue("debug"); debugButton.setImmediate(true); debugButton.addActionListener(this); this.getChildren().add(debugButton); return tb; }
protected UIComponent getMainTaskbar() { String bref = WFPage.CONTENT_BUNDLE + "."; WFTabbedPane tb = new WFTabbedPane(); tb.setMainAreaStyleClass(null); tb.setId(MAIN_TASKBAR_ID); WFTab buttonContent = tb.addButtonVB(TASK_ID_CONTENT, bref + "content", getContentPerspective()); buttonContent.addActionListener(this); WFTab buttonEdit = tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditPerspective()); buttonEdit.addActionListener(this); tb.addTaskbarListener(this); UICommand debugButton = new HtmlCommandButton(); debugButton.setId("debugbutton"); debugButton.setValue("debug"); debugButton.setImmediate(true); debugButton.addActionListener(this); this.getChildren().add(debugButton); return tb; }
1,124,116
protected UIComponent getMainTaskbar() { String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setMainAreaStyleClass(null); tb.setId(MAIN_TASKBAR_ID); WFTab buttonContent = tb.addButtonVB(TASK_ID_CONTENT, bref + "content", getContentPerspective()); buttonContent.addActionListener(this); WFTab buttonEdit = tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditPerspective()); buttonEdit.addActionListener(this); tb.addTaskbarListener(this); UICommand debugButton = new HtmlCommandButton(); debugButton.setId("debugbutton"); debugButton.setValue("debug"); debugButton.setImmediate(true); debugButton.addActionListener(this); this.getChildren().add(debugButton); return tb; }
protected UIComponent getMainTaskbar() { String bref = WFPage.CONTENT_BUNDLE + "."; WFTabBar tb = new WFTabBar(); tb.setMainAreaStyleClass(null); tb.setId(MAIN_TASKBAR_ID); WFTab buttonContent = tb.addButtonVB(TASK_ID_CONTENT, bref + "content", getContentPerspective()); buttonContent.addActionListener(this); WFTab buttonEdit = tb.addButtonVB(TASK_ID_EDIT, bref + "edit", getEditPerspective()); buttonEdit.addActionListener(this); tb.addTabListener(this); UICommand debugButton = new HtmlCommandButton(); debugButton.setId("debugbutton"); debugButton.setValue("debug"); debugButton.setImmediate(true); debugButton.addActionListener(this); this.getChildren().add(debugButton); return tb; }
1,124,117
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"); WFTabbedPane tb = (WFTabbedPane) 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,124,118
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.setSelectedMenuItemId(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,124,119
public void tabPressed(WFTabEvent e) { WFTabBar t = e.getTaskbar(); UIComponent articleVersionBlock = t.findComponent(ArticleVersionBlock.ARTICLE_VERSION_BLOCK_ID); if (t.getSelectedButtonId().equals(ArticleBlock.TASK_ID_PREVIEW)) { articleVersionBlock.setRendered(true); } else { articleVersionBlock.setRendered(false); } }
public void tabPressed(WFTabEvent e) { WFTabbedPane t = e.getTaskbar(); UIComponent articleVersionBlock = t.findComponent(ArticleVersionBlock.ARTICLE_VERSION_BLOCK_ID); if (t.getSelectedButtonId().equals(ArticleBlock.TASK_ID_PREVIEW)) { articleVersionBlock.setRendered(true); } else { articleVersionBlock.setRendered(false); } }
1,124,120
public void tabPressed(WFTabEvent e) { WFTabBar t = e.getTaskbar(); UIComponent articleVersionBlock = t.findComponent(ArticleVersionBlock.ARTICLE_VERSION_BLOCK_ID); if (t.getSelectedButtonId().equals(ArticleBlock.TASK_ID_PREVIEW)) { articleVersionBlock.setRendered(true); } else { articleVersionBlock.setRendered(false); } }
public void tabPressed(WFTabEvent e) { WFTabBar t = e.getTaskbar(); UIComponent articleVersionBlock = t.findComponent(ArticleVersionBlock.ARTICLE_VERSION_BLOCK_ID); if (t.getSelectedMenuItemId().equals(ArticleBlock.TASK_ID_PREVIEW)) { articleVersionBlock.setRendered(true); } else { articleVersionBlock.setRendered(false); } }
1,124,121
public static BeanDefinitionHolder createBeanDefinition(String propertyName, Set patterns, String referenceType) { RootBeanDefinition beanDefinition = new RootBeanDefinition(SingletonReference.class, 0); ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName()); return new BeanDefinitionHolder(beanDefinition, SingletonReference.class.getName()); }
public static BeanDefinitionHolder createBeanDefinition(String name, Set patterns, String referenceType) { RootBeanDefinition beanDefinition = new RootBeanDefinition(SingletonReference.class, 0); ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName()); return new BeanDefinitionHolder(beanDefinition, SingletonReference.class.getName()); }
1,124,122
public static BeanDefinitionHolder createBeanDefinition(String propertyName, Set patterns, String referenceType) { RootBeanDefinition beanDefinition = new RootBeanDefinition(SingletonReference.class, 0); ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName()); return new BeanDefinitionHolder(beanDefinition, SingletonReference.class.getName()); }
public static BeanDefinitionHolder createBeanDefinition(String propertyName, Set patterns, String referenceType) { RootBeanDefinition beanDefinition = new RootBeanDefinition(SingletonReference.class, 0); ConstructorArgumentValues args = beanDefinition.getConstructorArgumentValues(); args.addIndexedArgumentValue(0, propertyName, String.class.getName()); args.addIndexedArgumentValue(1, patterns, Set.class.getName()); args.addIndexedArgumentValue(2, referenceType, String.class.getName()); return new BeanDefinitionHolder(beanDefinition, SingletonReference.class.getName()); }
1,124,123
public void viewProfile(final String jid, final JComponent parent) { SwingWorker worker = new SwingWorker() { VCard userVCard = new VCard(); public Object construct() { userVCard = getVCard(jid); return vcard; } public void finished() { if (userVCard.getError() != null) { // Show vcard not found JOptionPane.showMessageDialog(parent, "Unable to locate a profile for " + jid, "Profile Not Found", JOptionPane.ERROR_MESSAGE); return; } else { showUserProfile(jid, userVCard, parent); } } }; worker.start(); }
public void viewProfile(final String jid, final JComponent parent) { SwingWorker worker = new SwingWorker() { VCard userVCard = new VCard(); public Object construct() { userVCard = getVCard(jid); return vcard; } public void finished() { if (userVCard.getError() != null || userVCard == null) { // Show vcard not found JOptionPane.showMessageDialog(parent, "Unable to locate a profile for " + jid, "Profile Not Found", JOptionPane.ERROR_MESSAGE); return; } else { showUserProfile(jid, userVCard, parent); } } }; worker.start(); }
1,124,124
public void finished() { if (userVCard.getError() != null) { // Show vcard not found JOptionPane.showMessageDialog(parent, "Unable to locate a profile for " + jid, "Profile Not Found", JOptionPane.ERROR_MESSAGE); return; } else { showUserProfile(jid, userVCard, parent); } }
public void finished() { if (userVCard.getError() != null || userVCard == null) { // Show vcard not found JOptionPane.showMessageDialog(parent, "Unable to locate a profile for " + jid, "Profile Not Found", JOptionPane.ERROR_MESSAGE); return; } else { showUserProfile(jid, userVCard, parent); } }
1,124,125
public final Template handle(WebContext wc) throws HandlerException { String pageName = null; WikiPage wikiPage = null; // who is trying to do something? WikiUser user = getUser (wc); // which action wants to respond to this request? PageAction action = _actionManager.getAction (wc, user); // use the action to determine which WikiPage // we should be dealing with if (action != null) pageName = action.getWikiPageName (_wiki, wc); if (pageName != null) wikiPage = _wiki.getPage (pageName); // stuff the webcontext with useful stuff stuffContext (wc, wikiPage, user); if (action == null) throw new HandlerException ("Unable to find a PageAction to handle" + " this request."); try { // attempt to perform the action against the page action.perform (_wiki, wc, user, wikiPage); } catch (PageAction.RedirectException re) { // action wants us to redirect somewhere else try { wc.getResponse().sendRedirect (re.getURL()); } catch (IOException ioe) { throw new HandlerException ("Cannot redirect to " + re.getURL(), ioe); } return null; } catch (Exception e) { // something bad happened while performing the action // TODO: Handle error and error template ourselves _log.error ("Could not perform action", e); throw new HandlerException (e.toString()); } // the action performed successfully, so now return // the template it wants us to use try { // determine the template name and return String templateName = action.getTemplateName(_wiki, wikiPage); return getTemplate (templateName); } catch (ResourceException re) { throw new HandlerException ("Could not get template", re); } }
public final Template handle(WebContext wc) throws HandlerException { String pageName = null; WikiPage wikiPage = null; // who is trying to do something? WikiUser user = getUser (wc); // which action wants to respond to this request? PageAction action = _actionManager.getAction (wc, user); // use the action to determine which WikiPage // we should be dealing with if (action != null) pageName = action.getWikiPageName (_wiki, wc); if (pageName != null) wikiPage = _wiki.getPage (pageName); // stuff the webcontext with useful stuff stuffContext (wc, wikiPage, user, pageName); if (action == null) throw new HandlerException ("Unable to find a PageAction to handle" + " this request."); try { // attempt to perform the action against the page action.perform (_wiki, wc, user, wikiPage); } catch (PageAction.RedirectException re) { // action wants us to redirect somewhere else try { wc.getResponse().sendRedirect (re.getURL()); } catch (IOException ioe) { throw new HandlerException ("Cannot redirect to " + re.getURL(), ioe); } return null; } catch (Exception e) { // something bad happened while performing the action // TODO: Handle error and error template ourselves _log.error ("Could not perform action", e); throw new HandlerException (e.toString()); } // the action performed successfully, so now return // the template it wants us to use try { // determine the template name and return String templateName = action.getTemplateName(_wiki, wikiPage); return getTemplate (templateName); } catch (ResourceException re) { throw new HandlerException ("Could not get template", re); } }
1,124,126
private void stuffContext (WebContext wc, WikiPage page, WikiUser user) { wc.put ("Wiki", _wiki); wc.put ("WikiUtil", WikiUtil.getInstance()); wc.put ("Renderer", _wiki.getPageRenderer()); wc.put ("Page", page); wc.put ("User", user); }
private void stuffContext (WebContext wc, WikiPage page, WikiUser user, String pageName) { wc.put ("Wiki", _wiki); wc.put ("WikiUtil", WikiUtil.getInstance()); wc.put ("Renderer", _wiki.getPageRenderer()); wc.put ("Page", page); wc.put ("User", user); }
1,124,127
public void updateDataModel(Integer start, Integer rows) { if (_dataModel == null) { _dataModel = new WFDataModel(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder(new File("/Test/article/")).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++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), 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(); } try { ArticleItemBean[] articleItemBean = (ArticleItemBean[]) ArticleListBean.loadAllArticlesInFolder("/files/content").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++) {// ListArticlesBean bean = new ListArticlesBean(String.valueOf(i), testHeadlines[i], testPublished[i]); //TODO we don't have published in the article item bean ListArticlesBean bean = new ListArticlesBean(articleItemBean[i].getHeadline(), articleItemBean[i].getHeadline(), "");// ArticleListBean a = new ArticleListBean(String.valueOf(i), articleItemBean[i].getHeadline(), articleItemBean[i].getItemType(), 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,124,129
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 (XMPPException e) { 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 (XMPPException e) { 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); } }
1,124,130
public void testXMLReportValidity() throws Exception { String[] args; // Serialize the current coverage data to disk ProjectData.saveGlobalProjectData(); String dataFileName = CoverageDataFileHandler.getDefaultDataFile() .getAbsolutePath(); // Then we need to generate the XML report args = new String[] { "-f", "xml", "--datafile", dataFileName, "-o", pathToTestOutput, "-s", pathToSourceCode }; net.sourceforge.cobertura.reporting.Main.main(args); // Create a validating XML document parser DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); DocumentBuilder documentBuilder = factory.newDocumentBuilder(); documentBuilder.setEntityResolver(new JUnitXMLParserEntityResolver( basedir)); documentBuilder.setErrorHandler(new JUnitXMLParserErrorHandler()); // Parse the XML report InputStream inputStream = null; try { inputStream = new FileInputStream(pathToXMLReport); documentBuilder.parse(inputStream); } finally { if (inputStream != null) inputStream.close(); } }
public void testXMLReportValidity() throws Exception { String[] args; // Serialize the current coverage data to disk ProjectData.saveGlobalProjectData(); String dataFileName = CoverageDataFileHandler.getDefaultDataFile() .getAbsolutePath(); // Then we need to generate the XML report args = new String[] { "-f", "xml", "--datafile", dataFileName, "-o", pathToTestOutput, "-s", pathToSourceCode }; net.sourceforge.cobertura.reporting.Main.main(args); // Create a validating XML document parser DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); factory.setValidating(true); DocumentBuilder documentBuilder = factory.newDocumentBuilder(); documentBuilder.setEntityResolver(new JUnitXMLParserEntityResolver( basedir)); documentBuilder.setErrorHandler(new JUnitXMLParserErrorHandler()); // Parse the XML report InputStream inputStream = null; try { inputStream = new FileInputStream(pathToXMLReport); documentBuilder.parse(inputStream); } finally { if (inputStream != null) inputStream.close(); } }
1,124,131
final public Object get(String field) { Object locale = null; try { Field f = Locale.class.getField(field); locale = f.get(null); } catch (Exception ne) { StringTokenizer st = new StringTokenizer(field,"_"); String[] parts = new String[] {"","",""}; try { for (int i=0; i<3; i++) { parts[i] = st.nextToken(); } } catch (NoSuchElementException e) {}// System.out.println("Creating Locale: "// +parts[0]+"-"+parts[1]+"-"+parts[2]); locale = new Locale(parts[0], parts[1], parts[2]); }// System.out.println("Returning locale for "+field+" -> "+locale); return locale; }
final public Object get(String field) { Object locale = null; try { Field f = Locale.class.getField(field); locale = f.get(null); } catch (Exception ne) { StringTokenizer st = new StringTokenizer(field,"_"); String[] parts = new String[] {"","",""}; try { for (int i=0; i<3; i++) { parts[i] = st.nextToken(); } } catch (NoSuchElementException e) {}// System.out.println("Creating Locale: "// +parts[0]+"-"+parts[1]+"-"+parts[2]); locale = new Locale(parts[0], parts[1], parts[2]); }// System.out.println("Returning locale for "+field+" -> "+locale); return locale; }
1,124,134
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.getPathname())) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
1,124,135
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
private void addInstrumentation(CoberturaFile coberturaFile) { if (coberturaFile.isClass() && shouldInstrument(coberturaFile.pathname)) { addInstrumentationToSingleClass(coberturaFile); } else if (coberturaFile.isDirectory()) { String[] contents = coberturaFile.list(); for (int i = 0; i < contents.length; i++) { File relativeFile = new File(coberturaFile.pathname, contents[i]); CoberturaFile relativeCoberturaFile = new CoberturaFile(coberturaFile.baseDir, relativeFile.toString()); //recursion! addInstrumentation(relativeCoberturaFile); } } }
1,124,136
public URL getTemplate(String name) { if (_templatePrefix == null) return getTemplate(name); else { URL u = getResource(_templatePrefix + name); return (u != null) ? u : getResource(name); } }
public URL getTemplate(String name) { if (_templatePrefix == null) return getResource(name); else { URL u = getResource(_templatePrefix + name); return (u != null) ? u : getResource(name); } }
1,124,137
public void write(FastWriter out, Context context) throws ContextException, IOException { boolean done=false; try { if (result instanceof Macro) target.setValue(context, ((Macro) result).evaluate(context)); else target.setValue(context, result); } catch (ContextException e) { String errorText = "Set: Unable to set value: " + target; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
public void write(FastWriter out, Context context) throws ContextException, IOException { boolean done=false; try { if (result instanceof Macro) target.setValue(context, ((Macro) result).evaluate(context)); else target.setValue(context, result); } catch (ContextException e) { String errorText = "#set: Unable to set value: " + target; context.getBroker().getLog("engine").error(errorText); writeWarning(errorText, out); } }
1,124,138
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
1,124,139
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
1,124,140
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
private void checkForStaleRooms() { int delay = 1000; // delay for 1 minute int period = 60000; // repeat every 30 seconds. Timer timer = new Timer(); timer.scheduleAtFixedRate(new TimerTask() { public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } } }, delay, period); }
1,124,141
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
public void run() { for (ChatRoom chatRoom : getStaleChatRooms()) { // Turn tab gray int index = indexOfComponent(chatRoom); if (index == -1) { return; } SparkTab tab = getTabAt(index); final JLabel titleLabel = tab.getTitleLabel(); titleLabel.setForeground(Color.gray); titleLabel.setFont(tab.getDefaultFont()); String jid = ((ChatRoomImpl)chatRoom).getParticipantJID(); Presence presence = SparkManager.getConnection().getRoster().getPresence(jid); if (presence == null || presence.getType() == Presence.Type.unavailable) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_UNAVAILABLE_STALE_IMAGE)); } else if (presence != null) { Presence.Mode mode = presence.getMode(); if (mode == Presence.Mode.available) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AVAILABLE_STALE_IMAGE)); } else if (mode == Presence.Mode.away) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_AWAY_STALE_IMAGE)); } else if (mode == Presence.Mode.chat) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_FREE_CHAT_STALE_IMAGE)); } else if (mode == Presence.Mode.dnd) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } else if (mode == Presence.Mode.xa) { tab.setIcon(SparkRes.getImageIcon(SparkRes.IM_DND_STALE_IMAGE)); } } titleLabel.validate(); titleLabel.repaint(); } }
1,124,142