rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(2, 2, 2, 2), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, 0));
public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } }
panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0));
titleLabel.setVerticalTextPosition(JLabel.CENTER); titleLabel.setFont(new Font("dialog", Font.BOLD, 14)); titleLabel.setForeground(Color.black); descriptionLabel.setFont(new Font("dialog", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 2, 2, 2), 0, 0));
public TitlePanel(String title, String description, Icon icon, boolean showDescription) { // Set the icon iconLabel.setIcon(icon); // Set the title setTitle(title); // Set the description setDescription(description); setLayout(gridBagLayout); if (showDescription) { add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(descriptionLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(0, 9, 5, 5), 0, 0)); add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); setBackground(Color.white); titleLabel.setFont(new Font("Verdana", Font.BOLD, 11)); descriptionLabel.setFont(new Font("Verdana", 0, 10)); } else { final JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createEtchedBorder()); panel.setLayout(new GridBagLayout()); panel.add(titleLabel, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); panel.add(iconLabel, new GridBagConstraints(2, 0, 1, 2, 0.0, 0.0, GridBagConstraints.NORTHEAST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); panel.setBackground(new Color(49, 106, 197)); titleLabel.setFont(new Font("Verdana", Font.BOLD, 13)); titleLabel.setForeground(Color.white); descriptionLabel.setFont(new Font("Verdana", 0, 10)); add(panel, new GridBagConstraints(0, 0, 1, 0, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 5, 5, 5), 0, 0)); } }
WebdavResource resource = slideService.getWebdavResourceAuthenticatedAsRoot(contentFolderPath);
private void makesureStandardFolderisCreated() { IWUserContext iwuc = getIWUserContext(); IWSlideService slideService = getIWSlideService(iwuc); String contentFolderPath = ArticleUtil.getContentRootPath(); String articlePath = ArticleUtil.getArticleRootPath(); try { //first make the folder: slideService.createAllFoldersInPathAsRoot(articlePath); WebdavResource resource = slideService.getWebdavResourceAuthenticatedAsRoot(contentFolderPath); AccessControlList aclList = slideService.getAccessControlList(contentFolderPath); AuthenticationBusiness authBusiness = ((IWSlideServiceBean)slideService).getAuthenticationBusiness(); String editorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_EDITOR); Ace editorAce = new Ace(editorRoleUri); editorAce.addPrivilege(Privilege.READ); editorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry editorEntry = new AccessControlEntry(editorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(editorEntry); String authorRoleUri = authBusiness.getRoleURI(StandardRoles.ROLE_KEY_AUTHOR); Ace authorAce = new Ace(authorRoleUri); authorAce.addPrivilege(Privilege.READ); authorAce.addPrivilege(Privilege.WRITE); //editorAce.addPrivilege(Privilege.READ); //editorAce.setInherited(true); AccessControlEntry authorEntry = new AccessControlEntry(authorAce,AccessControlEntry.PRINCIPAL_TYPE_ROLE); aclList.add(authorEntry); slideService.storeAccessControlList(aclList); //debug: aclList = slideService.getAccessControlList(contentFolderPath); } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } }
body = baos.toString();
body = baos.toString("UTF-8");
protected void prettifyBody() { String body = getBody(); if(body!=null){// System.out.println("ArticleIn = "+articleIn); //Use JTidy to clean up the html Tidy tidy = new Tidy(); tidy.setXHTML(true); tidy.setXmlOut(true); tidy.setCharEncoding(Configuration.UTF8); ByteArrayInputStream bais; try { bais = new ByteArrayInputStream(body.getBytes("UTF-8")); ByteArrayOutputStream baos = new ByteArrayOutputStream(); tidy.parse(bais, baos); body = baos.toString(); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } // System.out.println("ArticleOut = "+articleOut); setBody(body); } }
return ContentUtil.getContentRootPath();
return ContentUtil.getContentBaseFolderPath();
public static String getContentRootPath(){ return ContentUtil.getContentRootPath(); }
chatPref = (ChatPreferences)preferenceManager.getPreferenceData(ChatPreference.NAMESPACE);
public TranscriptWindow() { setEditable(false); /* Load Preferences for this instance */ PreferenceManager preferenceManager = SparkManager.getPreferenceManager(); chatPref = (ChatPreferences)preferenceManager.getPreferenceData(ChatPreference.NAMESPACE); addMouseListener(this); addMouseMotionListener(this); setDragEnabled(true); final TranscriptWindow window = this; addContextMenuListener(new ContextMenuListener() { public void poppingUp(Object component, JPopupMenu popup) { Action printAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { SparkManager.printChatTranscript(window); } }; Action clearAction = new AbstractAction() { public void actionPerformed(ActionEvent actionEvent) { clear(); } }; printAction.putValue(Action.NAME, "Print"); printAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.PRINTER_IMAGE_16x16)); clearAction.putValue(Action.NAME, "Clear"); clearAction.putValue(Action.SMALL_ICON, SparkRes.getImageIcon(SparkRes.ERASER_IMAGE)); popup.addSeparator(); popup.add(printAction); popup.add(clearAction); } public void poppingDown(JPopupMenu popup) { } public boolean handleDefaultAction(MouseEvent e) { return false; } }); // Make sure ctrl-c works getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("control c"), "copy"); getActionMap().put("copy", new AbstractAction("copy") { public void actionPerformed(ActionEvent evt) { StringSelection ss = new StringSelection(getSelectedText()); Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null); } }); }
chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE);
final LocalPreferences pref = SettingsManager.getLocalPreferences();
private String getDate(Date insertDate) { chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); if (insertDate == null) { insertDate = new Date(); } StyleConstants.setFontFamily(styles, font.getFontName()); StyleConstants.setFontSize(styles, font.getSize()); if (chatPref.showDatesInChat()) { final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); final String date = formatter.format(insertDate); return "[" + date + "] "; } lastUpdated = insertDate; return ""; }
if (chatPref.showDatesInChat()) {
if (pref.isTimeDisplayedInChat()) {
private String getDate(Date insertDate) { chatPref = (ChatPreferences)SparkManager.getPreferenceManager().getPreferenceData(ChatPreference.NAMESPACE); if (insertDate == null) { insertDate = new Date(); } StyleConstants.setFontFamily(styles, font.getFontName()); StyleConstants.setFontSize(styles, font.getSize()); if (chatPref.showDatesInChat()) { final SimpleDateFormat formatter = new SimpleDateFormat("h:mm a"); final String date = formatter.format(insertDate); return "[" + date + "] "; } lastUpdated = insertDate; return ""; }
from = chatPref.getNickname();
from = pref.getNickname();
public void saveTranscript(String fileName, List transcript, String headerData) { try { SimpleDateFormat formatter; File defaultSaveFile = new File(new File(Spark.getUserHome()), fileName); final JFileChooser fileChooser = new JFileChooser(defaultSaveFile); fileChooser.setSelectedFile(defaultSaveFile); // Show save dialog; this method does not return until the dialog is closed int result = fileChooser.showSaveDialog(this); final File selFile = fileChooser.getSelectedFile(); if (selFile != null && result == JFileChooser.APPROVE_OPTION) { final StringBuffer buf = new StringBuffer(); final Iterator transcripts = transcript.iterator(); buf.append("<html><body>"); if (headerData != null) { buf.append(headerData); } buf.append("<table width=600>"); while (transcripts.hasNext()) { final Message message = (Message)transcripts.next(); String from = message.getFrom(); if (from == null) { from = chatPref.getNickname(); } if (Message.Type.GROUP_CHAT == message.getType()) { if (ModelUtil.hasLength(StringUtils.parseResource(from))) { from = StringUtils.parseResource(from); } } final String body = message.getBody(); final Date insertionDate = (Date)message.getProperty("insertionDate"); formatter = new SimpleDateFormat("hh:mm:ss"); String value = ""; if (insertionDate != null) { value = "[" + formatter.format(insertionDate) + "] "; } buf.append("<tr><td nowrap><font size=2>").append(value).append("<strong>").append(from).append(":</strong>&nbsp;").append(body).append("</font></td></tr>"); } buf.append("</table></body></html>"); final BufferedWriter writer = new BufferedWriter(new FileWriter(selFile)); writer.write(buf.toString()); writer.close(); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Chat transcript has been saved.", "Chat Transcript Saved", JOptionPane.INFORMATION_MESSAGE); } } catch (Exception ex) { Log.error("Unable to save chat transcript.", ex); JOptionPane.showMessageDialog(SparkManager.getMainWindow(), "Could not save transcript.", "Error", JOptionPane.ERROR_MESSAGE); } }
boolean timing = context.isTiming();
timing = Flags.PROFILE && context.isTiming();
final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } }
context.stopTiming();
if (timing) context.stopTiming();
final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } }
context.startTiming("WMServlet.destroyContext()");
if (timing) context.startTiming("WMServlet.destroyContext()");
final private void doRequest( HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { WebContext context = null; if (_problem != null) { init(); if (_problem != null) { try { resp.setContentType("text/html"); FastWriter out = new FastWriter(resp.getOutputStream(), resp.getCharacterEncoding()); out.write("<html><head><title>WebMacro Error</title></head>"); out.write("<body><h1><font color=\"red\">WebMacro Error: "); out.write("</font></h1><pre>"); out.write(_problem); out.write("</pre>"); out.write("Please contat the server administrator"); out.flush(); out.close(); } catch (Exception e) { _log.error(_problem,e); } return; } } try { context = newContext(req,resp); boolean timing = context.isTiming(); if (timing) context.startTiming("WMServlet",req.getRequestURI()); Template t; try { if (timing) context.startTiming("handle"); t = handle(context); } finally { context.stopTiming(); } if (t != null) { execute(t,context); } context.startTiming("WMServlet.destroyContext()"); try { destroyContext(context); } finally { if (timing) context.stopTiming(); } } catch (HandlerException e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "Your handler was unable to process the request successfully " + "for some reason. Here are the details:<p>" + e); execute(tmpl,context); } catch (Exception e) { if (context == null) { context = _wcPrototype.newInstance(req,resp); } _log.error("Your handler failed to handle the request:" + this, e); Template tmpl = error(context, "The handler WebMacro used to handle this request failed for " + "some reason. This is likely a bug in the handler written " + "for this application. Here are the details:<p>" + e); execute(tmpl,_wcPrototype.newInstance(req,resp)); } finally { context.stopTiming(); context.clear(); } }
c.startTiming("Template.write", tmpl);
if (timing) c.startTiming("Template.write", tmpl);
final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } }
c.stopTiming();
if (timing) c.stopTiming();
final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } }
c.startTiming("FastWriter.close()");
if (timing) c.startTiming("FastWriter.close()");
final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } }
finally { c.stopTiming(); }
finally { if (timing) c.stopTiming(); }
final protected void execute(Template tmpl, WebContext c) { Writer out = null; try { c.startTiming("Template.write", tmpl); FastWriter fw; try { HttpServletResponse resp= c.getResponse(); fw = FastWriter.getInstance( resp.getOutputStream(), resp.getCharacterEncoding()); tmpl.write(fw, c); } finally { c.stopTiming(); } c.startTiming("FastWriter.close()"); try { fw.close(); } finally { c.stopTiming(); } } catch (IOException e) { // ignore disconnect } catch (Exception e) { String error = "WebMacro encountered an error while executing a template:\n" + ((tmpl != null) ? (tmpl + ": " + e + "\n") : ("The template failed to load; double check the " + "TemplatePath in your webmacro.properties file.")); _log.warning(error,e); try { out.write(error); } catch (Exception ignore) { } } finally { try { if (out != null) { out.flush(); out.close(); } } catch (Exception e3) { // ignore disconnect } } }
outputFile.getParentFile().mkdirs();
File parentFile = outputFile.getParentFile(); if (parentFile != null) { parentFile.mkdirs(); }
private void addInstrumentation(File file) { if (file.isDirectory()) { File[] contents = file.listFiles(); for (int i = 0; i < contents.length; i++) addInstrumentation(contents[i]); return; } if (!isClass(file)) { return; } if (logger.isDebugEnabled()) { logger.debug("instrumenting " + file.getAbsolutePath()); } InputStream inputStream = null; OutputStream outputStream = null; try { inputStream = new FileInputStream(file); ClassReader cr = new ClassReader(inputStream); ClassWriter cw = new ClassWriter(true); ClassInstrumenter cv = new ClassInstrumenter(projectData, cw, ignoreRegexp); cr.accept(cv, false); byte[] instrumentedClass = cw.toByteArray(); if (cv.isInstrumented()) { File outputFile = new File(destinationDirectory, cv .getClassName().replace('.', File.separatorChar) + ".class"); outputFile.getParentFile().mkdirs(); outputStream = new FileOutputStream(outputFile); outputStream.write(instrumentedClass); } } catch (IOException e) { logger.warn( "Unable to instrument file " + file.getAbsolutePath(), e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { } } if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { } } } }
condition.signalAll();
if (!satisfied) { satisfied = true; condition.signalAll(); }
public void setSatisfied() { lock.lock(); try { condition.signalAll(); } finally { lock.unlock(); } }
return Integer.parseInt(key);
return Integer.parseInt(snum);
public int getIntegerSetting(String key) { String snum = getSetting(key); try { return Integer.parseInt(key); } catch (Exception e) { return 0; } }
if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); }
if (!cMacro && Expression.isTrue(c)) return builder.getArg(IF_BLOCK);
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
? elseArgs.getArg(ELSE_BLOCK, bc) : "";
? elseArgs.getArg(ELSE_BLOCK) : "";
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc);
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
if (i == 0) return elseBlock; else
if (i == 0) return elseifArgs[j].getArg(ELSEIF_BLOCK); else { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc);
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc);
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
return elseBlock;
return elseArgs.getArg(ELSE_BLOCK); else elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc);
public Object build(DirectiveBuilder builder, BuildContext bc) throws BuildException { Object c = builder.getArg(IF_COND, bc); boolean cMacro = (c instanceof Macro); int elseifCount; DirectiveArgs elseArgs; DirectiveArgs[] elseifArgs = null; // If condition is static and true -- just return the block if (!cMacro && Expression.isTrue(c)) { return (Block) builder.getArg(IF_BLOCK, bc); } elseArgs = builder.getSubdirective(IF_ELSE); elseifArgs = builder.getRepeatingSubdirective(IF_ELSEIF); elseifCount = (elseifArgs == null) ? 0 : elseifArgs.length; // OK, how about no else-if subdirectives? if (elseifCount == 0) { // If condition is static and false -- just return the else block if (!cMacro) { return (elseArgs != null) ? elseArgs.getArg(ELSE_BLOCK, bc) : ""; } else { // Just one condition -- the IF condition, and maybe an ELSE block nConditions = 1; conditions = new Macro[1]; blocks = new Block[1]; conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); if (elseArgs != null) elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); return this; } } else { // This is the ugly case -- we have to guess at how many conditions // we'll have. We start with 1 + count(#elseof), and if any can be // folded out at compile time, we just won't use the whole thing int i=0; nConditions=elseifCount + (cMacro? 1 : 0); conditions = new Macro[nConditions]; blocks = new Block[nConditions]; if (cMacro) { conditions[0] = (Macro) c; blocks[0] = (Block) builder.getArg(IF_BLOCK, bc); ++i; } for (int j=0; j < elseifCount; j++) { c = elseifArgs[j].getArg(ELSEIF_COND, bc); if (c instanceof Macro) { conditions[i] = (Macro) c; blocks[i] = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); ++i; } else if (Expression.isTrue(c)) { elseBlock = (Block) elseifArgs[j].getArg(ELSEIF_BLOCK, bc); // If all the previous got folded out as false, then just return the // block from this condition, otherwise stash it in the elseBlock // and we're done with #elseif directives if (i == 0) return elseBlock; else break; } else { // Just skip this #elseif directive } } // If we didn't promote one of the elseif blocks to else, get the else if (elseBlock == null && elseArgs != null) { elseBlock = (Block) elseArgs.getArg(ELSE_BLOCK, bc); // If there are no valid conditions, just return the else block if (i == 0) return elseBlock; } if (i < nConditions) { // If we folded out some cases, we would want to resize the arrays, // but since the space doesn't really matter, we'll save time by // just remembering how big they really are. nConditions = i; } } return this; }
public Clazz(String longName)
private Clazz(String longName)
public Clazz(String longName) { if (longName == null) { throw new IllegalArgumentException("Class name can not be null."); } lines = new TreeMap(); packageName = ClassHelper.getPackageName(longName); name = ClassHelper.getBaseName(longName); numberOfBranches = 0; numberOfCoveredBranches = 0; numberOfCoveredLines = 0; numberOfLines = 0; }
numberOfBranches = 0; numberOfCoveredBranches = 0; numberOfCoveredLines = 0; numberOfLines = 0;
public Clazz(String longName) { if (longName == null) { throw new IllegalArgumentException("Class name can not be null."); } lines = new TreeMap(); packageName = ClassHelper.getPackageName(longName); name = ClassHelper.getBaseName(longName); numberOfBranches = 0; numberOfCoveredBranches = 0; numberOfCoveredLines = 0; numberOfLines = 0; }
return numberOfBranches;
return getRawCoverageData().getNumberOfValidBranches();
public int getNumberOfBranches() { return numberOfBranches; }
return numberOfCoveredBranches;
return getRawCoverageData().getNumberOfCoveredBranches();
public int getNumberOfCoveredBranches() { return numberOfCoveredBranches; }
return numberOfCoveredLines;
return getRawCoverageData().getNumberOfCoveredLines();
public int getNumberOfCoveredLines() { return numberOfCoveredLines; }
return numberOfLines;
return getRawCoverageData().getNumberOfValidLines();
public int getNumberOfLines() { return numberOfLines; }
public final void setRawCoverageData(CoverageData rawCoverageData)
private final void setRawCoverageData(CoverageData rawCoverageData)
public final void setRawCoverageData(CoverageData rawCoverageData) { this.rawCoverageData = rawCoverageData; }
Header.print(System.out);
private void addFilenames(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]); } Header.print(System.out);// System.out.println("instrumenting " + filenames.length + " "// + (filenames.length == 1 ? "class" : "classes")// + (toDir != null ? " to " + toDir : "")); }
addArg("--basedir");
public void execute() throws BuildException { initArgs(); if (dataFile != null) { addArg("--datafile"); addArg(dataFile); } addArg("--destination"); addArg(this.destDir.getAbsolutePath()); addArg("--format"); addArg(format); if (srcDir != null) { addArg("--basedir"); addArg(srcDir); } handleFilesets(); saveArgs(); /** * 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("Error running reports. See messages above."); } unInitArgs(); }
Set filenames = new HashSet();
int numberOfClasses = 0;
private void handleFilesets() { Set filenames = new HashSet(); Iterator iter = fileSets.iterator(); while (iter.hasNext()) { FileSet fileSet = (FileSet)iter.next(); addArg("--basedir"); addArg(baseDir(fileSet)); filenames.addAll(Arrays.asList(getFilenames(fileSet))); } addFilenames((String[])filenames.toArray(new String[filenames.size()])); }
filenames.addAll(Arrays.asList(getFilenames(fileSet)));
String[] fileNames = getFilenames(fileSet); numberOfClasses += fileNames.length; addFilenames(fileNames);
private void handleFilesets() { Set filenames = new HashSet(); Iterator iter = fileSets.iterator(); while (iter.hasNext()) { FileSet fileSet = (FileSet)iter.next(); addArg("--basedir"); addArg(baseDir(fileSet)); filenames.addAll(Arrays.asList(getFilenames(fileSet))); } addFilenames((String[])filenames.toArray(new String[filenames.size()])); }
addFilenames((String[])filenames.toArray(new String[filenames.size()]));
private void handleFilesets() { Set filenames = new HashSet(); Iterator iter = fileSets.iterator(); while (iter.hasNext()) { FileSet fileSet = (FileSet)iter.next(); addArg("--basedir"); addArg(baseDir(fileSet)); filenames.addAll(Arrays.asList(getFilenames(fileSet))); } addFilenames((String[])filenames.toArray(new String[filenames.size()])); }
MacroAdapter.createMacro(elseDir) : null;
MacroAdapter.createMacro(elseDir,rc.getEncoding()) : null;
public static final Object build(BuildContext rc, Condition cond, Macro body, Object elseDir) throws BuildException { if (cond instanceof Macro) { Macro elseMacro = (elseDir != null) ? MacroAdapter.createMacro(elseDir) : null; return new IfDirective(cond, body, elseMacro); } else { return (cond.test(rc)) ? body : elseDir; } }
FastWriter fw = new FastWriter(os, "UTF8");
FastWriter fw = new FastWriter(os, context.getEncoding());
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( "If: evaluate got IO exception on write to StringWriter"); return ""; } }
return os.toString("UTF8");
return os.toString(context.getEncoding());
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( "If: evaluate got IO exception on write to StringWriter"); return ""; } }
result = CommandLineBuilder.preprocessCommandLineArguments( args);
CommandLineBuilder.preprocessCommandLineArguments( args);
public void testCommandsFileOption() throws Exception { String[] args = { "Hello", "world" }; String[] result = CommandLineBuilder.preprocessCommandLineArguments( args); assertSame( args, result); try { args = new String[]{ "Hello", "--commandsfile" }; result = CommandLineBuilder.preprocessCommandLineArguments( args); fail( "IllegalArgumentException expected"); } catch( IllegalArgumentException ex) {} try { args = new String[]{ "Hello", "--commandsfile", "hello.cmd" }; result = CommandLineBuilder.preprocessCommandLineArguments( args); fail( "IO Exception expected"); } catch( IOException ex) {} }
jidField = new JTextField(); ResourceUtils.resLabel(jidLabel, jidField, "&JID:"); add(jidLabel, new GridBagConstraints(0, 6, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(jidField, new GridBagConstraints(1, 6, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); jidLabel.setVisible(false); jidField.setVisible(false);
public PersonalPanel() { setLayout(new GridBagLayout()); // Handle First Name JLabel firstNameLabel = new JLabel(); firstNameField = new JTextField(); ResourceUtils.resLabel(firstNameLabel, firstNameField, "&First Name:"); add(firstNameLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(firstNameField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); // Handle Middle Name JLabel middleNameLabel = new JLabel(); middleNameField = new JTextField(); ResourceUtils.resLabel(middleNameLabel, middleNameField, "&Middle Name:"); add(middleNameLabel, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(middleNameField, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); // Handle Last Name JLabel lastNameLabel = new JLabel(); lastNameField = new JTextField(); ResourceUtils.resLabel(lastNameLabel, lastNameField, "&Last Name:"); add(lastNameLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(lastNameField, new GridBagConstraints(1, 2, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); // Handle Nickname JLabel nicknameLabel = new JLabel(); nicknameField = new JTextField(); ResourceUtils.resLabel(nicknameLabel, nicknameField, "&Nickname:"); add(nicknameLabel, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(nicknameField, new GridBagConstraints(1, 4, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); // Handle Email Address JLabel emaiAddressLabel = new JLabel(); emailAddressField = new JTextField(); ResourceUtils.resLabel(emaiAddressLabel, emailAddressField, "&Email Address:"); add(emaiAddressLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); add(emailAddressField, new GridBagConstraints(1, 5, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); }
assertEscape("\u00F7","&divide;");
public void testEscaping () throws Exception { assertEscape("<B>", "&lt;B&gt;"); assertEscape("\u00f6", "&ouml;"); assertEscape("\u00a9", "&copy;"); assertEscape("\u00a3", "&pound;"); assertEscape("\u0080", "&euro;"); assertEscape("This is a test: \u0080\u0080\u0080 is better than" + "\u00a3\u00a3\u00a3!", "This is a test: &euro;&euro;&euro; is better than" + "&pound;&pound;&pound;!" ); }
return "constant-property:" + _vname;
return "constant-property:" + getVariableName();
public final String toString () { return "constant-property:" + _vname; }
_vname = makeName(names).intern();
Variable (Object names[]) { _vname = makeName(names).intern(); _names = names; }
public String getVariableName ()
public synchronized String getVariableName ()
public String getVariableName () { return _vname; }
return _vname;
if (_vname == null) { _vname = makeName(_names).intern(); } return _vname;
public String getVariableName () { return _vname; }
dd.getTree().disposeTreeEditor();
tree.disposeTreeEditor();
public void finishRenameNote(Event e) { if ((e.type == SWT.KeyDown && e.keyCode == SWT.CR) || e.type == SWT.FocusOut) { dd.getTree().disposeTreeEditor(); } }
String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNote(); dn.getNote().setName(newName);
String newName = tree.getTreeEditorText(); DisplayedNote dn = tree.getSelectedNote();
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNote(); dn.getNote().setName(newName); dn.setName(newName); }
protected static String getMethodDescriptor(Class clazz, String methodName) { return clazz.getCanonicalName() + SEPARATOR + methodName;
protected static String getMethodDescriptor(Class controllerClass, String methodName) { return controllerClass.getCanonicalName() + SEPARATOR + methodName;
protected static String getMethodDescriptor(Class clazz, String methodName) { return clazz.getCanonicalName() + SEPARATOR + methodName; }
note.setName(name);
public void setName(String name) { treeNode.setName(name); if (tab != null) tab.setName(name); }
bean.load(itemResourcePath);
bean.setResourcePath(itemResourcePath); bean.load();
public ContentItem loadContentItem(String itemResourcePath) { try { ArticleItemBean bean = new ArticleItemBean(); bean.setAutoCreateResource(isAutoCreateResource()); bean.load(itemResourcePath); return bean; } catch (Exception e) { e.printStackTrace(); } return null; }
return new BufferedReader(new FileReader(myFile));
return new BufferedReader(new InputStreamReader( new FileInputStream(myFile), myEncoding));
protected Reader getReader() throws IOException { return new BufferedReader(new FileReader(myFile)); }
JScrollBar sb = textScroller.getVerticalScrollBar(); sb.setValue(sb.getMaximum());
try { JScrollBar sb = textScroller.getVerticalScrollBar(); sb.setValue(sb.getMaximum()); } catch (Exception e) { Log.error(e); }
public void scrollToBottom() { if (mousePressed) { return; } int chatLength = transcriptWindow.getDocument().getLength(); transcriptWindow.setCaretPosition(chatLength); JScrollBar sb = textScroller.getVerticalScrollBar(); sb.setValue(sb.getMaximum()); }
HtmlPanelGrid p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":")));
HtmlPanelGrid p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":")));
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":")));
p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":")));
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
p.getChildren().add(teaserArea);
p.getChildren().add(teaserArea); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":")));
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":")));
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu);
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":")));
p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":")));
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
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);
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton);
p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "category"), WFUtil.getText(":"))); HtmlInputText categoryInput = WFUtil.getInputText(MAIN_CATEGORY_ID, ref + "mainCategory"); if(null==categoryInput.getValue() || "".equals(categoryInput.getValue())) { categoryInput.setValue(ROOT_CATEGORY); } categoryInput.setSize(40); p.getChildren().add(categoryInput);
private UIComponent getEditContainer() { 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.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "headline"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "language"), WFUtil.getText(":"))); HtmlInputText headlineInput = WFUtil.getInputText(HEADLINE_ID, ref + "headline"); headlineInput.setSize(40); 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(WFUtil.getTextVB(bref + "teaser"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "author"), WFUtil.getText(":"))); HtmlInputTextarea teaserArea = WFUtil.getTextArea(TEASER_ID, ref + "teaser", "440px", "30px"); p.getChildren().add(teaserArea); HtmlInputText authorInput = WFUtil.getInputText(AUTHOR_ID, ref + "author"); authorInput.setSize(22); p.getChildren().add(authorInput); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "body"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "images"), WFUtil.getText(":"))); // HtmlInputTextarea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "460px", "400px"); HTMLArea bodyArea = WFUtil.getHtmlAreaTextArea(BODY_ID, ref + "body", "100%", "400px"); 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); //HtmlCommandButton editButton = WFUtil.getButtonVB(EDIT_HTML_ID, bref + "edit"); //editButton.setOnclick("wurl='htmlarea/webface/htmledit.jsp?" + PREVIEW_ARTICLE_ITEM_ID + // "='+this.tabindex;window.open(wurl,'Edit','height=450,width=600,resizable=yes,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');return false;"); //p.getChildren().add(WFUtil.group(WFUtil.group(bodyArea, WFUtil.getBreak()), editButton)); p.getChildren().add(bodyArea); WFContainer imageContainer = new WFContainer(); imageContainer.add(WFUtil.getButtonVB(ADD_IMAGE_ID, bref + "add_image", this)); imageContainer.add(WFUtil.getBreak()); imageContainer.add(getImageList()); p.getChildren().add(imageContainer); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "source"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "main_category"), WFUtil.getText(":"))); HtmlInputTextarea sourceArea = WFUtil.getTextArea(SOURCE_ID, ref + "source", "440px", "30px"); p.getChildren().add(sourceArea); HtmlSelectOneMenu mainCategoryMenu = WFUtil.getSelectOneMenu(MAIN_CATEGORY_ID, ref + "categories", ref + "mainCategoryId"); p.getChildren().add(mainCategoryMenu); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "created"), WFUtil.getText(": 4/20/04 3:04PM"))); p.getChildren().add(WFUtil.getText(" ")); UIComponent t = WFUtil.group(WFUtil.getHeaderTextVB(bref + "status"), WFUtil.getText(": ")); t.getChildren().add(WFUtil.getTextVB(ref + "status")); p.getChildren().add(t); p.getChildren().add(WFUtil.getText(" ")); p.getChildren().add(WFUtil.group(WFUtil.getHeaderTextVB(bref + "current_version"), WFUtil.getText(": 1.5"))); mainContainer.add(p); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getFormPanel(2); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "comment"), WFUtil.getText(":"))); p.getChildren().add(WFUtil.group(WFUtil.getTextVB(bref + "attachments"), WFUtil.getText(":"))); HtmlInputTextarea commentArea = WFUtil.getTextArea(COMMENT_ID, ref + "comment", "400px", "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); mainContainer.add(WFUtil.getBreak()); p = WFPanelUtil.getPlainFormPanel(1); HtmlCommandButton editCategoriesButton = WFUtil.getButtonVB(EDIT_CATEGORIES_ID, bref + "edit_categories", this); p.getChildren().add(editCategoriesButton); p.getChildren().add(WFUtil.getBreak()); WFComponentSelector cs = new WFComponentSelector(); cs.setId(BUTTON_SELECTOR_ID); cs.setDividerText(" "); HtmlCommandButton saveButton = WFUtil.getButtonVB(SAVE_ID, bref + "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); 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); FileUploadForm f = new FileUploadForm(); f.setId(FILE_UPLOAD_FORM_ID); editorSelector.add(f); editorSelector.add(getRelatedContentItemsContainer()); editorSelector.setSelectedId(ARTICLE_EDITOR_ID, true); return editorSelector; }
context.put ("OWNM", new ObjectWithNullMethod());
public void stuffContext (Context context) throws Exception { context.setEvaluationExceptionHandler ( new CrankyEvaluationExceptionHandler(_wm.getBroker())); context.put ("TestObject", new TestObject()); context.put ("NullTestObject", new NullTestObject()); context.put("enum",new ThrowingEnumeration()); }
Collection packages;
SortedSet packages;
private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages // TODO TODO TODO: This needs to only look at classes in root package packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of source files in this package Collection sourceFiles; if (packageData == null) { sourceFiles = projectData.getSourceFiles(); } else { sourceFiles = packageData.getSourceFiles(); } // Output a line for each class if (sourceFiles.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = sourceFiles.iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter .next(); out .println(generateTableRowForSourceFile(sourceFileData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
packages = projectData.getChildren();
packages = projectData.getPackages();
private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages // TODO TODO TODO: This needs to only look at classes in root package packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of source files in this package Collection sourceFiles; if (packageData == null) { sourceFiles = projectData.getSourceFiles(); } else { sourceFiles = packageData.getSourceFiles(); } // Output a line for each class if (sourceFiles.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = sourceFiles.iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter .next(); out .println(generateTableRowForSourceFile(sourceFileData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
sourceFiles = projectData.getSourceFiles();
PackageData defaultPackage = (PackageData)projectData .getChild(""); if (defaultPackage != null) { sourceFiles = defaultPackage.getSourceFiles(); } else { sourceFiles = new TreeSet(); }
private void generateOverview(PackageData packageData) throws IOException { Iterator iter; String filename; if (packageData == null) { filename = "frame-summary.html"; } else { filename = "frame-summary-" + packageData.getName() + ".html"; } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/sortabletable.css\" />"); out .println("<script type=\"text/javascript\" src=\"js/popup.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/sortabletable.js\"></script>"); out .println("<script type=\"text/javascript\" src=\"js/customsorttypes.js\"></script>"); out.println("</head>"); out.println("<body>"); out.print("<h5>Coverage Report - "); out.print(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<p>"); out.println("<table class=\"report\" id=\"packageResults\">"); out.println("<thead>"); out.println("<tr>"); out.println(" <td class=\"heading\">Package</td>"); out.println(" <td class=\"heading\"># Classes</td>"); out.println(generateCommonTableColumns()); out.println("</tr>"); out.println("</thead>"); out.println("<tbody>"); Collection packages; if (packageData == null) { // Output a summary line for all packages out.println(generateTableRowForTotal()); // Get packages // TODO TODO TODO: This needs to only look at classes in root package packages = projectData.getChildren(); } else { // Get subpackages packages = projectData.getSubPackages(packageData.getName()); } // Output a line for each package or subpackage iter = packages.iterator(); while (iter.hasNext()) { PackageData subPackageData = (PackageData)iter.next(); out.println(generateTableRowForPackage(subPackageData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var packageTable = new SortableTable(document.getElementById(\"packageResults\"),"); out .println(" [\"String\", \"Number\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("packageTable.sort(0);"); out.println("</script>"); out.println("</p>"); // Get the list of source files in this package Collection sourceFiles; if (packageData == null) { sourceFiles = projectData.getSourceFiles(); } else { sourceFiles = packageData.getSourceFiles(); } // Output a line for each class if (sourceFiles.size() > 0) { out.println("<p>"); out.println("<table class=\"report\" id=\"classResults\">"); out.println(generateTableHeaderForClasses()); out.println("<tbody>"); iter = sourceFiles.iterator(); while (iter.hasNext()) { SourceFileData sourceFileData = (SourceFileData)iter .next(); out .println(generateTableRowForSourceFile(sourceFileData)); } out.println("</tbody>"); out.println("</table>"); out.println("<script type=\"text/javascript\">"); out .println("var classTable = new SortableTable(document.getElementById(\"classResults\"),"); out .println(" [\"String\", \"Percentage\", \"Percentage\", \"LocalizedNumber\"]);"); out.println("classTable.sort(0);"); out.println("</script>"); out.println("</p>"); } out.println("<div class=\"footer\">"); out .println("Report generated by <a href=\"http://cobertura.sourceforge.net/\" target=\"_top\">Cobertura</a>."); out.println("</div>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
Iterator iter = projectData.getChildren().iterator();
Iterator iter = projectData.getPackages().iterator();
private void generateOverviews() throws IOException { generateOverview(null); Iterator iter = projectData.getChildren().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); generateOverview(packageData); } }
SortedSet sortedPackages = new TreeSet(); sortedPackages.addAll(projectData.getChildren()); Iterator iter = sortedPackages.iterator();
Iterator iter = projectData.getPackages().iterator();
private void generatePackageList() throws IOException { File file = new File(destinationDir, "frame-packages.html"); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>Packages</h5>"); out.println("<table width=\"100%\">"); out.println("<tr>"); out .println("<td nowrap=\"nowrap\"><a href=\"frame-summary.html\" onClick='parent.sourceFileList.location.href=\"frame-sourcefiles.html\"' target=\"summary\">All</a></td>"); out.println("</tr>"); SortedSet sortedPackages = new TreeSet(); sortedPackages.addAll(projectData.getChildren()); Iterator iter = sortedPackages.iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; out.println("<tr>"); out .println("<td nowrap=\"nowrap\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"' target=\"summary\">" + generatePackageName(packageData) + "</a></td>"); out.println("</tr>"); } out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
Collection sourceFiles;
SortedSet sourceFiles;
private void generateSourceFileList(PackageData packageData) throws IOException { String filename; Collection sourceFiles; if (packageData == null) { filename = "frame-sourcefiles.html"; sourceFiles = projectData.getSourceFiles(); } else { filename = "frame-sourcefiles-" + packageData.getName() + ".html"; sourceFiles = packageData.getSourceFiles(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedSourceFileList = new TreeMap(); for (Iterator iter = sourceFiles.iterator(); iter.hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); out.println("<tr>"); String percentCovered; if (sourceFileData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(sourceFileData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
Map sortedSourceFileList = new TreeMap();
private void generateSourceFileList(PackageData packageData) throws IOException { String filename; Collection sourceFiles; if (packageData == null) { filename = "frame-sourcefiles.html"; sourceFiles = projectData.getSourceFiles(); } else { filename = "frame-sourcefiles-" + packageData.getName() + ".html"; sourceFiles = packageData.getSourceFiles(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedSourceFileList = new TreeMap(); for (Iterator iter = sourceFiles.iterator(); iter.hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); out.println("<tr>"); String percentCovered; if (sourceFileData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(sourceFileData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
{ SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();)
private void generateSourceFileList(PackageData packageData) throws IOException { String filename; Collection sourceFiles; if (packageData == null) { filename = "frame-sourcefiles.html"; sourceFiles = projectData.getSourceFiles(); } else { filename = "frame-sourcefiles-" + packageData.getName() + ".html"; sourceFiles = packageData.getSourceFiles(); } File file = new File(destinationDir, filename); PrintStream out = null; try { out = new PrintStream(new FileOutputStream(file)); out.println("<html>"); out.println("<head>"); out.println("<title>Coverage Report Classes</title>"); out .println("<link title=\"Style\" type=\"text/css\" rel=\"stylesheet\" href=\"css/main.css\" />"); out.println("</head>"); out.println("<body>"); out.println("<h5>"); out.println(packageData == null ? "All Packages" : generatePackageName(packageData)); out.println("</h5>"); out.println("<h5>Classes</h5>"); out.println("<table width=\"100%\">"); Map sortedSourceFileList = new TreeMap(); for (Iterator iter = sourceFiles.iterator(); iter.hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); sortedSourceFileList.put(sourceFileData.getBaseName(), sourceFileData); } for (Iterator iter = sortedSourceFileList.values().iterator(); iter .hasNext();) { SourceFileData sourceFileData = (SourceFileData)iter.next(); out.println("<tr>"); String percentCovered; if (sourceFileData.getNumberOfValidLines() > 0) percentCovered = getPercentValue(sourceFileData .getLineCoverageRate()); else percentCovered = "N/A"; out .println("<td nowrap=\"nowrap\"><a target=\"summary\" href=\"" + sourceFileData.getNormalizedName() + ".html\">" + sourceFileData.getBaseName() + "</a> <i>(" + percentCovered + ")</i></td>"); out.println("</tr>"); } out.println("</td>"); out.println("</tr>"); out.println("</table>"); out.println("</body>"); out.println("</html>"); } finally { if (out != null) { out.close(); } } }
Iterator iter = projectData.getChildren().iterator();
Iterator iter = projectData.getPackages().iterator();
private void generateSourceFileLists() throws IOException { generateSourceFileList(null); Iterator iter = projectData.getChildren().iterator(); while (iter.hasNext()) { PackageData packageData = (PackageData)iter.next(); generateSourceFileList(packageData); } }
ret.append("<td class=\"value\">" + packageData.getChildren().size()
ret.append("<td class=\"value\">" + packageData.getNumberOfChildren()
private String generateTableRowForPackage(PackageData packageData) { StringBuffer ret = new StringBuffer(); String url1 = "frame-summary-" + packageData.getName() + ".html"; String url2 = "frame-sourcefiles-" + packageData.getName() + ".html"; double lineCoverage = -1; double branchCoverage = -1; double ccn = Util.getCCN(new File(sourceDir, packageData .getSourceFileName()), false); if (packageData.getNumberOfValidLines() > 0) lineCoverage = packageData.getLineCoverageRate(); if (packageData.getNumberOfValidBranches() > 0) branchCoverage = packageData.getBranchCoverageRate(); ret.append(" <tr>"); ret.append("<td class=\"text\"><a href=\"" + url1 + "\" onClick='parent.sourceFileList.location.href=\"" + url2 + "\"'>" + generatePackageName(packageData) + "</a></td>"); ret.append("<td class=\"value\">" + packageData.getChildren().size() + "</td>"); ret.append(generateTableColumnsFromData(lineCoverage, branchCoverage, ccn)); ret.append("</tr>"); return ret.toString(); }
return getClasses().size();
return this.classes.size();
public int getNumberOfClasses() { return getClasses().size(); }
classLoader = new MultiParentClassLoader(applicationContext.getDisplayName(), urls, getClass().getClassLoader());
ClassLoader parentLoader = getClassLoader(applicationContext); classLoader = new MultiParentClassLoader(applicationContext.getDisplayName(), urls, parentLoader);
public void preprocess(SpringApplicationContext applicationContext, XmlBeanDefinitionReader reader, Document document) { // determine the classLoader ClassLoader classLoader; NodeList classpathElements = document.getDocumentElement().getElementsByTagName("classpath"); if (classpathElements.getLength() < 1) { classLoader = getClass().getClassLoader(); } else if (classpathElements.getLength() > 1) { throw new FatalBeanException("Expected only classpath element but found " + classpathElements.getLength()); } else { Element classpathElement = (Element) classpathElements.item(0); // build the classpath List classpath = new ArrayList(); NodeList locations = classpathElement.getElementsByTagName("location"); for (int i = 0; i < locations.getLength(); i++) { Element locationElement = (Element) locations.item(i); String location = ((Text) locationElement.getFirstChild()).getData().trim(); classpath.add(location); } // convert the paths to URLS URL[] urls = new URL[classpath.size()]; for (ListIterator iterator = classpath.listIterator(); iterator.hasNext();) { String location = (String) iterator.next(); urls[iterator.previousIndex()] = repository.getResource(location); } // create the classloader classLoader = new MultiParentClassLoader(applicationContext.getDisplayName(), urls, getClass().getClassLoader()); // remove the classpath element so Spring doesn't get confused document.getDocumentElement().removeChild(classpathElement); } // assign the class loader to the xml reader and the application context reader.setBeanClassLoader(classLoader); applicationContext.setClassLoader(classLoader); Thread.currentThread().setContextClassLoader(classLoader); }
bean.setAutoCreateResource(isAutoCreateResource());
public ContentItem loadContentItem(String itemResourcePath) { try { ArticleItemBean bean = new ArticleItemBean(); bean.load(itemResourcePath); return bean; } catch (Exception e) { e.printStackTrace(); } return null; }
public String render (WikiPage page) throws WikiPageRenderer.RenderException { WikiData[] dataElement = page.getData(); StringBuffer sb = new StringBuffer (2048); for (int x=0; x<dataElement.length; x++) { int type = dataElement[x].getType (); String data = (String) dataElement[x].getData (); String str = null; switch (type) { case WikiDataTypes.START_BOLD: str = renderBoldStart (); break; case WikiDataTypes.END_BOLD: str = renderBoldEnd (); break; case WikiDataTypes.START_UNDERLINE: str = renderUnderlineStart(); break; case WikiDataTypes.END_UNDERLINE: str = renderUnderlineEnd(); break; case WikiDataTypes.START_ITALIC: str = renderItalicStart(); break; case WikiDataTypes.END_ITALIC: str = renderItalicEnd(); break; case WikiDataTypes.PARAGRAPH_BREAK: str = renderParagraphBreak(); break; case WikiDataTypes.LINE_BREAK: str = renderLineBreak(); break; case WikiDataTypes.HORIZ_LINE: str = renderHorizLine(); break; case WikiDataTypes.PLAIN_TEXT: str = renderPlainText (data); break; case WikiDataTypes.PAGE_REFERENCE: str = renderWikiTerm (data, page.getTitle()); break; case WikiDataTypes.INDENT: int many = (data != null && data.length() > 0) ? Integer.parseInt(data) : 1; str = renderIndent (many); break; case WikiDataTypes.START_NAMED_HEADER: str = renderHeaderStart (data); break; case WikiDataTypes.END_NAMED_HEADER: str = renderHeaderEnd (data); break; case WikiDataTypes.URL: str = _urlRenderer.renderURL (data); break; case WikiDataTypes.IMAGE: str = renderImage (data); break; case WikiDataTypes.JAVADOC: str = renderJavaDoc (data); break; case WikiDataTypes.START_COLOR: str = renderColorStart (data); break; case WikiDataTypes.END_COLOR: str = renderColorEnd (); break; case WikiDataTypes.EMAIL: str = renderEmail (data); break; case WikiDataTypes.QUOTED_BLOCK: str = renderQuotedBlock (data); break; case WikiDataTypes.SPACE: str = renderSpace (); break; case WikiDataTypes.LT: str = renderLT (); break; case WikiDataTypes.GT: str = renderGT (); break; default: str = renderUnknown (dataElement[x]); } if (str != null) sb.append (str); } return sb.toString ();
public void render (WikiPage page, OutputStream out) throws IOException, WikiPageRenderer.RenderException { out.write (render (page).getBytes());
public String render (WikiPage page) throws WikiPageRenderer.RenderException { WikiData[] dataElement = page.getData(); StringBuffer sb = new StringBuffer (2048); for (int x=0; x<dataElement.length; x++) { int type = dataElement[x].getType (); String data = (String) dataElement[x].getData (); String str = null; switch (type) { case WikiDataTypes.START_BOLD: str = renderBoldStart (); break; case WikiDataTypes.END_BOLD: str = renderBoldEnd (); break; case WikiDataTypes.START_UNDERLINE: str = renderUnderlineStart(); break; case WikiDataTypes.END_UNDERLINE: str = renderUnderlineEnd(); break; case WikiDataTypes.START_ITALIC: str = renderItalicStart(); break; case WikiDataTypes.END_ITALIC: str = renderItalicEnd(); break; case WikiDataTypes.PARAGRAPH_BREAK: str = renderParagraphBreak(); break; case WikiDataTypes.LINE_BREAK: str = renderLineBreak(); break; case WikiDataTypes.HORIZ_LINE: str = renderHorizLine(); break; case WikiDataTypes.PLAIN_TEXT: str = renderPlainText (data); break; case WikiDataTypes.PAGE_REFERENCE: str = renderWikiTerm (data, page.getTitle()); break; case WikiDataTypes.INDENT: int many = (data != null && data.length() > 0) ? Integer.parseInt(data) : 1; str = renderIndent (many); break; case WikiDataTypes.START_NAMED_HEADER: str = renderHeaderStart (data); break; case WikiDataTypes.END_NAMED_HEADER: str = renderHeaderEnd (data); break; case WikiDataTypes.URL: str = _urlRenderer.renderURL (data); break; // @deprecated "image" is now a URL type. case WikiDataTypes.IMAGE: str = renderImage (data); break; // @deprecated "javadoc" is now a URL type. case WikiDataTypes.JAVADOC: str = renderJavaDoc (data); break; case WikiDataTypes.START_COLOR: str = renderColorStart (data); break; case WikiDataTypes.END_COLOR: str = renderColorEnd (); break; case WikiDataTypes.EMAIL: str = renderEmail (data); break; case WikiDataTypes.QUOTED_BLOCK: str = renderQuotedBlock (data); break; case WikiDataTypes.SPACE: str = renderSpace (); break; case WikiDataTypes.LT: str = renderLT (); break; case WikiDataTypes.GT: str = renderGT (); break; default: str = renderUnknown (dataElement[x]); } // esac if (str != null) sb.append (str); } // for x return sb.toString (); }
System.out.println("Context contains: helloWorld, hello, file, TestObject[] fruits, SelectList sl(fruits, 3), TestObject flipper"); System.out.println("- - - - - - - - - - - - - - - - - - - -");
public static void main(String arg[]) { Log.traceExceptions(true); Log.setLevel(Log.ALL); Log.setTarget(System.err); if (arg.length != 0) { System.out.println("Enabling log types"); Log.enableTypes(arg); } // Build a context WebMacro wm = null; Context context = null; try { wm = new WM(); context = new Context(null); Object names[] = { "prop" }; context.setProperty(names, "Example property"); } catch (Exception e) { e.printStackTrace(); } context.put("helloworld", "Hello World"); context.put("hello", "Hello"); context.put("file", "include.txt"); TestObject[] fruits = { new TestObject("apple",false), new TestObject("lemon",true), new TestObject("pear",false), new TestObject("orange",true), new TestObject("watermelon",false), new TestObject("peach",false), new TestObject("lime",true) }; SelectList sl = new SelectList(fruits, 3); context.put("sl-fruits", sl); context.put("fruits", fruits); context.put("flipper", new TestObject("flip",false)); System.out.println("- - - - - - - - - - - - - - - - - - - -"); try { Template t1 = new StreamTemplate(wm.getBroker(), new InputStreamReader(System.in)); t1.parse(); Writer w = new OutputStreamWriter(System.out); System.out.println("*** RESULT ***"); t1.write(w,context); w.close(); System.out.println("*** DONE ***"); //System.out.println(result); } catch (Exception e) { e.printStackTrace(); } }
return "</ul>";
return "</ul>\n";
protected String renderEndList() { return "</ul>"; }
return "<hr>";
return "<hr>\n";
protected String renderHorizLine() { return "<hr>"; }
return "<br>";
return "<br>\n";
protected String renderLineBreak() { return "<br>"; }
return "<br><br>";
return "<br><br>\n";
protected String renderParagraphBreak() { return "<br><br>"; }
.append ("</pre>");
.append ("</pre>\n");
protected String renderQuotedBlock(String text) { StringBuffer sb = new StringBuffer (text.length()); sb.append ("<pre>") .append (replace (replace (text, "<", "&lt;"), ">", "&gt;")) .append ("</pre>"); return sb.toString (); }
return "<ul>";
return "<ul>\n";
protected String renderStartList() { return "<ul>"; }
list.addKeyListener(this); addKeyListener(this);
list.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { if (keyEvent.getKeyCode() == KeyEvent.VK_ESCAPE) { textField.requestFocus(); } } });
public JContactItemField(List items, Window parentWindow) { setLayout(new BorderLayout()); this.items = items; add(textField, BorderLayout.CENTER); textField.addKeyListener(new KeyAdapter() { public void keyReleased(KeyEvent keyEvent) { char ch = keyEvent.getKeyChar(); if (validateChar(ch)) { showPopupMenu(); } if (ch == KeyEvent.VK_ENTER) { int index = list.getSelectedIndex(); if (index >= 0) { ContactItem selection = (ContactItem)list.getSelectedValue(); textField.setText(selection.getNickname()); popup.setVisible(false); } } if (ch == KeyEvent.VK_ESCAPE) { popup.setVisible(false); } dispatchEvent(keyEvent); } public void keyPressed(KeyEvent e) { if (isArrowKey(e)) { list.dispatchEvent(e); } } }); list.addKeyListener(this); addKeyListener(this); popup = new JWindow(parentWindow); popup.getContentPane().add(new JScrollPane(list)); list.setCellRenderer(new PopupRenderer()); }
return null;
return block;
public static final Object build(BuildContext rc, Object name, Macro block) throws BuildException { if (name instanceof Macro) { throw new BuildException( "Profile name must be a static string, not a dynamic macro"); } if (Flags.PROFILE) { return new ProfileDirective(name.toString(), block); } else { return null; } }
if (!_list) {
if (_list && _listType != LIST_TYPE_NORMAL) endList(); if (!_list) {
public void li() { if (!_list) { newData(); _currentData.setType(WikiDataTypes.START_LIST); _list = true; } newData(); _currentData.setType(WikiDataTypes.LI); }
_listType = LIST_TYPE_NORMAL;
public void li() { if (!_list) { newData(); _currentData.setType(WikiDataTypes.START_LIST); _list = true; } newData(); _currentData.setType(WikiDataTypes.LI); }
if (_list) { newData(); _currentData.setType(WikiDataTypes.END_LIST); _list = false; }
if (_list) endList();
public void paragraph() { finishFormatting (); if (_list) { newData(); _currentData.setType(WikiDataTypes.END_LIST); _list = false; } newData (); _currentData.setType (WikiDataTypes.PARAGRAPH_BREAK); }
personalPanel.setJID(vcard.getJabberId());
private void populateVCardUI(VCard vcard) { personalPanel.setFirstName(vcard.getFirstName()); personalPanel.setMiddleName(vcard.getMiddleName()); personalPanel.setLastName(vcard.getLastName()); personalPanel.setEmailAddress(vcard.getEmailHome()); personalPanel.setNickname(vcard.getNickName()); businessPanel.setCompany(vcard.getOrganization()); businessPanel.setDepartment(vcard.getOrganizationUnit()); businessPanel.setStreetAddress(vcard.getAddressFieldWork("STREET")); businessPanel.setCity(vcard.getAddressFieldWork("LOCALITY")); businessPanel.setState(vcard.getAddressFieldWork("REGION")); businessPanel.setZipCode(vcard.getAddressFieldWork("PCODE")); businessPanel.setCountry(vcard.getAddressFieldWork("CTRY")); businessPanel.setJobTitle(vcard.getField("TITLE")); businessPanel.setPhone(vcard.getPhoneWork("VOICE")); businessPanel.setFax(vcard.getPhoneWork("FAX")); businessPanel.setPager(vcard.getPhoneWork("PAGER")); businessPanel.setMobile(vcard.getPhoneWork("CELL")); businessPanel.setWebPage(vcard.getField("URL")); // Load Home Info homePanel.setStreetAddress(vcard.getAddressFieldHome("STREET")); homePanel.setCity(vcard.getAddressFieldHome("LOCALITY")); homePanel.setState(vcard.getAddressFieldHome("REGION")); homePanel.setZipCode(vcard.getAddressFieldHome("PCODE")); homePanel.setCountry(vcard.getAddressFieldHome("CTRY")); homePanel.setPhone(vcard.getPhoneHome("VOICE")); homePanel.setFax(vcard.getPhoneHome("FAX")); homePanel.setPager(vcard.getPhoneHome("PAGER")); homePanel.setMobile(vcard.getPhoneHome("CELL")); // Set avatar byte[] bytes = vcard.getAvatar(); if (bytes != null) { ImageIcon icon = new ImageIcon(bytes); avatarPanel.setAvatar(icon); avatarPanel.setAvatarBytes(bytes); if (avatarLabel != null) { icon = GraphicUtils.scaleImageIcon(icon, 48, 48); avatarLabel.setIcon(icon); } } }
personalPanel.showJID(true);
private void showUserProfile(String jid, VCard vcard, JComponent parent) { final JTabbedPane tabbedPane = new JTabbedPane(); personalPanel = new PersonalPanel(); tabbedPane.addTab("Personal", personalPanel); businessPanel = new BusinessPanel(); tabbedPane.addTab("Business", businessPanel); homePanel = new HomePanel(); tabbedPane.addTab("Home", homePanel); avatarPanel = new AvatarPanel(); avatarPanel.setEditable(false); personalPanel.allowEditing(false); businessPanel.allowEditing(false); homePanel.allowEditing(false); final JOptionPane pane; final JFrame dlg; avatarLabel = new JLabel(); avatarLabel.setHorizontalAlignment(JButton.RIGHT); avatarLabel.setBorder(new PartialLineBorder(Color.gray, 1)); // Construct main panel w/ layout. final JPanel mainPanel = new JPanel(); mainPanel.setLayout(new GridBagLayout()); mainPanel.add(avatarLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 5, 0, 5), 0, 0)); // The user should only be able to close this dialog. Object[] options = {"Close"}; pane = new JOptionPane(tabbedPane, JOptionPane.PLAIN_MESSAGE, JOptionPane.OK_CANCEL_OPTION, null, options, options[0]); mainPanel.add(pane, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0)); dlg = new JFrame("Viewing Profile For " + jid); dlg.setIconImage(SparkRes.getImageIcon(SparkRes.SMALL_PROFILE_IMAGE).getImage()); dlg.pack(); dlg.setSize(500, 400); dlg.setResizable(true); dlg.setContentPane(mainPanel); dlg.setLocationRelativeTo(parent); PropertyChangeListener changeListener = new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { if (pane.getValue() instanceof Integer) { pane.removePropertyChangeListener(this); dlg.dispose(); return; } String value = (String)pane.getValue(); if ("Close".equals(value)) { pane.removePropertyChangeListener(this); dlg.dispose(); } } }; pane.addPropertyChangeListener(changeListener); dlg.addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent keyEvent) { if (keyEvent.getKeyChar() == KeyEvent.VK_ESCAPE) { dlg.dispose(); } } }); populateVCardUI(vcard); dlg.setVisible(true); dlg.toFront(); dlg.requestFocus(); }
public boolean isDefaultGroup(long groupID) throws IAdminException, UnknownException, PermissionsException
public boolean isDefaultGroup(String name) throws IAdminException, UnknownException, PermissionsException
public boolean isDefaultGroup(long groupID) throws IAdminException, UnknownException, PermissionsException { try { return (iAdmin.getDefaultGroup(currentUser).getId() == groupID); } catch(ome.conditions.ApiUsageException e) { ExceptionHandler.get().catchException(e); } return false; }
return (iAdmin.getDefaultGroup(currentUser).getId() == groupID);
return (iAdmin.getDefaultGroup(currentUser).getId() == getGroupID(name));
public boolean isDefaultGroup(long groupID) throws IAdminException, UnknownException, PermissionsException { try { return (iAdmin.getDefaultGroup(currentUser).getId() == groupID); } catch(ome.conditions.ApiUsageException e) { ExceptionHandler.get().catchException(e); } return false; }
super.encodeBegin(context);
public void encodeBegin(FacesContext context) throws IOException { if(clearOnInit) { //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); ArticleItemBean bean = getArticleItemBean(); if(bean!=null){ bean.clear(); } } // WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "updateLocale");// updateEditButtons(); super.encodeBegin(context); IWContext iwc = IWContext.getIWContext(context); String resourcePath = iwc.getParameter(ContentViewer.PARAMETER_CONTENT_RESOURCE); String baseFolderPath = iwc.getParameter(ContentItemToolbar.PARAMETER_BASE_FOLDER_PATH); if(resourcePath!=null){ getArticleItemBean().setResourcePath(resourcePath); } if(baseFolderPath!=null){ getArticleItemBean().setBaseFolderLocation(baseFolderPath); } if(isInCreateMode()){ //if("create".equals(iwc.getParameter(ContentViewer.PARAMETER_ACTION))){ //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"setFolderLocation",resourcePath,String.class); //getArticleItemBean().setFolderLocation(resourcePath); WebDAVCategories categoriesUI = (WebDAVCategories)getCategoryEditor(); categoriesUI.reset(); } else { //We are in edit mode and an article already exits //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"load",resourcePath,String.class); try { //getArticleItemBean().load(resourcePath); getArticleItemBean().load(); WebDAVCategories categoriesUI = (WebDAVCategories)getCategoryEditor(); //Update the categoriesUI with the resourcePath given: if(categoriesUI!=null){ //there is no resourcepath set for the article if it's about to be created categoriesUI.setResourcePath(resourcePath); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } //} //else{ //}// if(((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"getLanguageChange")).booleanValue()) { //String languageChange=(String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"getLanguageChange"); String languageChange = getArticleItemBean().getLanguageChange(); if(languageChange!=null) { /*String articlePath = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getArticlePath"); if(null!=articlePath && articlePath.length()>0) { boolean result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+languageChange+ArticleItemBean.ARTICLE_FILE_SUFFIX)).booleanValue(); if(!result) { System.out.println("Warning loading new language did not work!"); } } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLanguageChange",""); */ getArticleItemBean().setLanguageChange(languageChange); } }
if(isInDeleteMode()){ try { getArticleItemBean().load(); } catch (Exception e) { e.printStackTrace(); } } super.encodeBegin(context);
public void encodeBegin(FacesContext context) throws IOException { if(clearOnInit) { //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "clear"); ArticleItemBean bean = getArticleItemBean(); if(bean!=null){ bean.clear(); } } // WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "updateLocale");// updateEditButtons(); super.encodeBegin(context); IWContext iwc = IWContext.getIWContext(context); String resourcePath = iwc.getParameter(ContentViewer.PARAMETER_CONTENT_RESOURCE); String baseFolderPath = iwc.getParameter(ContentItemToolbar.PARAMETER_BASE_FOLDER_PATH); if(resourcePath!=null){ getArticleItemBean().setResourcePath(resourcePath); } if(baseFolderPath!=null){ getArticleItemBean().setBaseFolderLocation(baseFolderPath); } if(isInCreateMode()){ //if("create".equals(iwc.getParameter(ContentViewer.PARAMETER_ACTION))){ //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"setFolderLocation",resourcePath,String.class); //getArticleItemBean().setFolderLocation(resourcePath); WebDAVCategories categoriesUI = (WebDAVCategories)getCategoryEditor(); categoriesUI.reset(); } else { //We are in edit mode and an article already exits //WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"load",resourcePath,String.class); try { //getArticleItemBean().load(resourcePath); getArticleItemBean().load(); WebDAVCategories categoriesUI = (WebDAVCategories)getCategoryEditor(); //Update the categoriesUI with the resourcePath given: if(categoriesUI!=null){ //there is no resourcepath set for the article if it's about to be created categoriesUI.setResourcePath(resourcePath); } } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); } } //} //else{ //}// if(((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"getLanguageChange")).booleanValue()) { //String languageChange=(String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID,"getLanguageChange"); String languageChange = getArticleItemBean().getLanguageChange(); if(languageChange!=null) { /*String articlePath = (String)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "getArticlePath"); if(null!=articlePath && articlePath.length()>0) { boolean result = ((Boolean)WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "load",articlePath+"/"+languageChange+ArticleItemBean.ARTICLE_FILE_SUFFIX)).booleanValue(); if(!result) { System.out.println("Warning loading new language did not work!"); } } WFUtil.invoke(ARTICLE_ITEM_BEAN_ID, "setLanguageChange",""); */ getArticleItemBean().setLanguageChange(languageChange); } }
UIComponent categoriesUi = findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); return categoriesUi;
WebDAVCategories categoriesUI = (WebDAVCategories)findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); if(categoriesUI==null){ categoriesUI=new WebDAVCategories(); categoriesUI.setCategoriesOnParent(true); categoriesUI.setDisplaySaveButton(false); categoriesUI.setDisplayHeader(false); FacesContext context = getFacesContext(); String setCategories = (String) context.getExternalContext().getRequestParameterMap().get(ContentItemToolbar.PARAMETER_CATEGORIES); if(setCategories!=null){ categoriesUI.setCategories(setCategories); } } return categoriesUI;
private UIComponent getCategoryEditor() { UIComponent categoriesUi = findComponent(WebDAVCategories.CATEGORIES_BLOCK_ID); return categoriesUi; }
IWContext iwc = IWContext.getInstance();
FacesContext context = FacesContext.getCurrentInstance(); IWContext iwc = IWContext.getIWContext(context);
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle();// 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); //Saving the state of the articleItemBean specially because the scpoe //of this bean now is 'request' not 'session' UISaveState beanSaveState = new UISaveState(); ValueBinding binding = WFUtil.createValueBinding("#{"+ARTICLE_ITEM_BEAN_ID+"}"); beanSaveState.setId("articleItemBeanSaveState"); beanSaveState.setValueBinding("value",binding); mainContainer.add(beanSaveState); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); UIComponent langDropdown = getLanguageDropdownMenu(); 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); //bodyArea.addPlugin("TableOperations"); //bodyArea.addPlugin("Template"); //bodyArea.addPlugin("Forms"); //bodyArea.addPlugin("FormOperations"); //bodyArea.addPlugin("EditTag"); //bodyArea.addPlugin("Stylist"); //bodyArea.addPlugin("CSS"); //bodyArea.addPlugin("DynamicCSS"); //bodyArea.addPlugin("FullPage"); //bodyArea.addPlugin("NoteServer"); //bodyArea.addPlugin("QuickTag"); //bodyArea.addPlugin("InsertSmiley"); //bodyArea.addPlugin("InsertWords"); //bodyArea.addPlugin("ContextMenu"); //bodyArea.addPlugin("LangMarks"); //bodyArea.addPlugin("DoubleClick"); //bodyArea.addPlugin("ListType"); //bodyArea.addPlugin("ImageManager"); 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) getArticleItemBean(); //String resourcePath = articleItemBean.getArticleResourcePath(); addCategoryEditor(p); 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; return mainContainer; }
WFContainer mainContainer = new WFContainer(); mainContainer.setId(ARTICLE_EDITOR_ID); WFErrorMessages em = new WFErrorMessages(); em.addErrorMessage(HEADLINE_ID); em.addErrorMessage(TEASER_ID); em.addErrorMessage(SAVE_ID); mainContainer.add(em); UISaveState beanSaveState = new UISaveState(); ValueBinding binding = WFUtil.createValueBinding("#{"+ARTICLE_ITEM_BEAN_ID+"}"); beanSaveState.setId("articleItemBeanSaveState"); beanSaveState.setValueBinding("value",binding); mainContainer.add(beanSaveState); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2);
WFContainer mainContainer = getMainContainer();
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle();// 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); //Saving the state of the articleItemBean specially because the scpoe //of this bean now is 'request' not 'session' UISaveState beanSaveState = new UISaveState(); ValueBinding binding = WFUtil.createValueBinding("#{"+ARTICLE_ITEM_BEAN_ID+"}"); beanSaveState.setId("articleItemBeanSaveState"); beanSaveState.setValueBinding("value",binding); mainContainer.add(beanSaveState); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); UIComponent langDropdown = getLanguageDropdownMenu(); 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); //bodyArea.addPlugin("TableOperations"); //bodyArea.addPlugin("Template"); //bodyArea.addPlugin("Forms"); //bodyArea.addPlugin("FormOperations"); //bodyArea.addPlugin("EditTag"); //bodyArea.addPlugin("Stylist"); //bodyArea.addPlugin("CSS"); //bodyArea.addPlugin("DynamicCSS"); //bodyArea.addPlugin("FullPage"); //bodyArea.addPlugin("NoteServer"); //bodyArea.addPlugin("QuickTag"); //bodyArea.addPlugin("InsertSmiley"); //bodyArea.addPlugin("InsertWords"); //bodyArea.addPlugin("ContextMenu"); //bodyArea.addPlugin("LangMarks"); //bodyArea.addPlugin("DoubleClick"); //bodyArea.addPlugin("ListType"); //bodyArea.addPlugin("ImageManager"); 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) getArticleItemBean(); //String resourcePath = articleItemBean.getArticleResourcePath(); addCategoryEditor(p); 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; return mainContainer; }
p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":")));
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle();// 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); //Saving the state of the articleItemBean specially because the scpoe //of this bean now is 'request' not 'session' UISaveState beanSaveState = new UISaveState(); ValueBinding binding = WFUtil.createValueBinding("#{"+ARTICLE_ITEM_BEAN_ID+"}"); beanSaveState.setId("articleItemBeanSaveState"); beanSaveState.setValueBinding("value",binding); mainContainer.add(beanSaveState); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); UIComponent langDropdown = getLanguageDropdownMenu(); 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); //bodyArea.addPlugin("TableOperations"); //bodyArea.addPlugin("Template"); //bodyArea.addPlugin("Forms"); //bodyArea.addPlugin("FormOperations"); //bodyArea.addPlugin("EditTag"); //bodyArea.addPlugin("Stylist"); //bodyArea.addPlugin("CSS"); //bodyArea.addPlugin("DynamicCSS"); //bodyArea.addPlugin("FullPage"); //bodyArea.addPlugin("NoteServer"); //bodyArea.addPlugin("QuickTag"); //bodyArea.addPlugin("InsertSmiley"); //bodyArea.addPlugin("InsertWords"); //bodyArea.addPlugin("ContextMenu"); //bodyArea.addPlugin("LangMarks"); //bodyArea.addPlugin("DoubleClick"); //bodyArea.addPlugin("ListType"); //bodyArea.addPlugin("ImageManager"); 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) getArticleItemBean(); //String resourcePath = articleItemBean.getArticleResourcePath(); addCategoryEditor(p); 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; return mainContainer; }
p.getChildren().add(langDropdown); p.getChildren().add(WFUtil.group(localizer.getTextVB("headline"), WFUtil.getText(":")));
UIComponent languageText = WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":")); HtmlOutputLabel languageLabel = new HtmlOutputLabel(); languageLabel.getChildren().add(languageText); languageLabel.setFor(langDropdown.getClientId(context)); WFFormItem languageItem = new WFFormItem(); languageItem.add(languageLabel); languageItem.add(langDropdown); mainContainer.add(languageItem);
public UIComponent getEditContainer() { IWContext iwc = IWContext.getInstance(); WFResourceUtil localizer = WFResourceUtil.getResourceUtilArticle();// 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); //Saving the state of the articleItemBean specially because the scpoe //of this bean now is 'request' not 'session' UISaveState beanSaveState = new UISaveState(); ValueBinding binding = WFUtil.createValueBinding("#{"+ARTICLE_ITEM_BEAN_ID+"}"); beanSaveState.setId("articleItemBeanSaveState"); beanSaveState.setValueBinding("value",binding); mainContainer.add(beanSaveState); HtmlPanelGrid p = WFPanelUtil.getPlainFormPanel(2); //Language dropdown p.getChildren().add(WFUtil.group(localizer.getTextVB("language"), WFUtil.getText(":"))); UIComponent langDropdown = getLanguageDropdownMenu(); 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); //bodyArea.addPlugin("TableOperations"); //bodyArea.addPlugin("Template"); //bodyArea.addPlugin("Forms"); //bodyArea.addPlugin("FormOperations"); //bodyArea.addPlugin("EditTag"); //bodyArea.addPlugin("Stylist"); //bodyArea.addPlugin("CSS"); //bodyArea.addPlugin("DynamicCSS"); //bodyArea.addPlugin("FullPage"); //bodyArea.addPlugin("NoteServer"); //bodyArea.addPlugin("QuickTag"); //bodyArea.addPlugin("InsertSmiley"); //bodyArea.addPlugin("InsertWords"); //bodyArea.addPlugin("ContextMenu"); //bodyArea.addPlugin("LangMarks"); //bodyArea.addPlugin("DoubleClick"); //bodyArea.addPlugin("ListType"); //bodyArea.addPlugin("ImageManager"); 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) getArticleItemBean(); //String resourcePath = articleItemBean.getArticleResourcePath(); addCategoryEditor(p); 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; return mainContainer; }