bugged
stringlengths 6
599k
| fixed
stringlengths 6
40.8M
| __index_level_0__
int64 0
3.24M
|
|---|---|---|
private void updateLensImage() { if (view.isLensVisible()) view.setLensPlaneImage(model.getRenderedImage()); timer.stop(); }
|
private void updateLensImage() { if (view.isLensVisible()) view.setLensPlaneImage(model.getImage()); timer.stop(); }
| 3,229,203
|
public ZoomAction(ImViewer model, int zoomingIndex) { super(model); controlsIndex(zoomingIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); this.zoomingIndex = zoomingIndex; putValue(Action.NAME, names[zoomingIndex]); setName(names[zoomingIndex]); }
|
public ZoomAction(ImViewer model, int zoomingIndex) { super(model); controlsIndex(zoomingIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); this.zoomingIndex = zoomingIndex; putValue(Action.NAME, names[zoomingIndex]); name = names[zoomingIndex]; }
| 3,229,204
|
public ColorModelAction(ImViewer model, int modelIndex) { super(model, NAME); controlIndex(modelIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); this.modelIndex = modelIndex; putValue(Action.NAME, names[modelIndex]); putValue(Action.SMALL_ICON, getColorModelIcon(modelIndex)); setName(names[modelIndex]); }
|
public ColorModelAction(ImViewer model, int modelIndex) { super(model, NAME); controlIndex(modelIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(getDescription(modelIndex))); this.modelIndex = modelIndex; putValue(Action.NAME, names[modelIndex]); putValue(Action.SMALL_ICON, getColorModelIcon(modelIndex)); setName(names[modelIndex]); }
| 3,229,205
|
public ColorModelAction(ImViewer model, int modelIndex) { super(model, NAME); controlIndex(modelIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); this.modelIndex = modelIndex; putValue(Action.NAME, names[modelIndex]); putValue(Action.SMALL_ICON, getColorModelIcon(modelIndex)); setName(names[modelIndex]); }
|
public ColorModelAction(ImViewer model, int modelIndex) { super(model, NAME); controlIndex(modelIndex); putValue(Action.SHORT_DESCRIPTION, UIUtilities.formatToolTipText(DESCRIPTION)); this.modelIndex = modelIndex; putValue(Action.NAME, names[modelIndex]); putValue(Action.SMALL_ICON, getColorModelIcon(modelIndex)); name = names[modelIndex]; }
| 3,229,206
|
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 : "")); }
|
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 : "")); }
| 3,229,207
|
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(); }
|
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(); }
| 3,229,208
|
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()])); }
|
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()])); }
| 3,229,209
|
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()])); }
|
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()])); }
| 3,229,210
|
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()])); }
|
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()])); }
| 3,229,211
|
public void testEnterExecuting() { readPointID = ExecCommand.LOCK_ACQUIRED_BY_ENTER_EXECUTING; target.run(); threads.awaitAltFlow(); assertEquals("Concurrent access to command state.", ExecCommand.EXECUTING, tState); }
|
public void testEnterExecuting() { readPointID = ExecCommand.LOCK_ACQUIRED_BY_ENTER_EXECUTING; target.run(); threads.awaitAltFlow(); assertEquals("Concurrent access to command state.", ExecCommand.EXECUTING, tState); }
| 3,229,212
|
protected RubyModule(IRuby runtime, RubyClass metaClass, RubyClass superClass, SinglyLinkedList parentCRef, String name) { super(runtime, metaClass); this.superClass = superClass; //this.parentModule = parentModule; setBaseName(name); // If no parent is passed in, it is safe to assume Object. if (parentCRef == null) { if (runtime.getObject() != null) { parentCRef = runtime.getObject().getCRef(); } } this.cref = new SinglyLinkedList(this, parentCRef); }
|
protectedRubyModule(IRubyruntime,RubyClassmetaClass,RubyClasssuperClass,SinglyLinkedListparentCRef,Stringname){super(runtime,metaClass);this.superClass=superClass;//this.parentModule=parentModule; setBaseName(name);//Ifnoparentispassedin,itissafetoassumeObject.if(parentCRef==null){if(runtime.getObject()!=null){parentCRef=runtime.getObject().getCRef();}}this.cref=newSinglyLinkedList(this,parentCRef);}
| 3,229,213
|
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; } }
|
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,rc.getEncoding()) : null; return new IfDirective(cond, body, elseMacro); } else { return (cond.test(rc)) ? body : elseDir; } }
| 3,229,216
|
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 ""; } }
|
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, context.getEncoding()); write(fw,context); fw.flush(); return os.toString("UTF8"); } catch (IOException e) { Engine.log.exception(e); Engine.log.error( "If: evaluate got IO exception on write to StringWriter"); return ""; } }
| 3,229,217
|
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 ""; } }
|
public Object evaluate(Context context) throws ContextException { try { ByteArrayOutputStream os = new ByteArrayOutputStream(256); FastWriter fw = new FastWriter(os, "UTF8"); write(fw,context); fw.flush(); return os.toString(context.getEncoding()); } catch (IOException e) { Engine.log.exception(e); Engine.log.error( "If: evaluate got IO exception on write to StringWriter"); return ""; } }
| 3,229,218
|
public static RubyBinding newBinding(IRuby runtime) { ThreadContext context = runtime.getCurrentContext(); // FIXME: We should be cloning, not reusing: frame, scope, dynvars, and potentially iter/block info RubyModule wrapper = context.getWrapper(); Iter iter = context.getCurrentIter(); Frame frame = context.getPreviousFrame(); // for TOPLEVEL_BINDING if (frame == null) { frame = context.getCurrentFrame(); } DynamicVariableSet dynVars = context.getCurrentDynamicVars(); Block bindingBlock = Block.createBinding(wrapper, iter, frame, dynVars); RubyBinding newBinding = new RubyBinding(runtime, runtime.getClass("Binding"), bindingBlock, context.getRubyClass()); return newBinding; }
|
public static RubyBinding newBinding(IRuby runtime) { ThreadContext context = runtime.getCurrentContext(); // FIXME: We should be cloning, not reusing: frame, scope, dynvars, and potentially iter/block info RubyModule wrapper = context.getWrapper(); Iter iter = context.getCurrentIter(); Frame frame = context.getPreviousFrame(); // for TOPLEVEL_BINDING if (frame == null) { frame = context.getCurrentFrame(); } DynamicVariableSet dynVars = context.getCurrentDynamicVars(); Block bindingBlock = Block.createBinding(wrapper, iter, frame, dynVars); RubyBinding newBinding = new RubyBinding(runtime, runtime.getClass("Binding"), bindingBlock, context.getRubyClass()); return newBinding; }
| 3,229,219
|
public RubyArray coerce(RubyObject num) { RubyNumeric other = numericValue(num); return RubyArray.newArray(getRuby(), this, newFloat(getRuby(), other.getDoubleValue())); }
|
public RubyArray coerce(RubyObject num) { RubyNumeric other = numericValue(num); return RubyArray.newArray(getRuby(), newFloat(getRuby(), other.getDoubleValue()), this); }
| 3,229,220
|
public void erase() { DrawingCanvasMng mng = drawingCanvas.getManager(); if (mng.getCurrentROI() != null) mng.erase(); }
|
public void erase() { DrawingCanvasMng mng = drawingCanvas.getManager(); ROIShape roi = mng.getCurrentROI(); if (roi != null && roi.getAnnotation() != null && mng.isAnnotationOnOff()) { setAnnotation(null); } if (roi != null) mng.erase(); }
| 3,229,221
|
public void eraseAll() { drawingCanvas.getManager().eraseAll(); }
|
public void eraseAll() { drawingCanvas.getManager().eraseAll(); setAnnotation(null); }
| 3,229,222
|
public void onOffDrawing(boolean b) { abstraction.onOffDrawing(b); }
|
public void onOffDrawing(boolean b) { abstraction.onOffDrawing(b); }
| 3,229,223
|
void onOffDrawing(boolean b) { drawOnOff = b; postedAdd = true; registry.getEventBus().post(new AddROICanvas(b)); }
|
void onOffDrawing(boolean b) { drawOnOff = b; registry.getEventBus().post(new AddROICanvas(b)); }
| 3,229,224
|
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) {} }
|
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) {} }
| 3,229,228
|
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) {} }
|
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) {} }
| 3,229,229
|
protected String[] getConfigLocations() { return ConfigHelper.getDaoConfigLocations(); }
|
protected String[] getConfigLocations() { return ConfigHelper.getDbUnitConfigLocations(); }
| 3,229,230
|
public DataObject createDataObject(DataObject child, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (child == null) throw new IllegalArgumentException("The child cannot be null."); IObject obj = ModelMapper.createIObject(child, parent); if (obj == null) throw new NullPointerException("Cannot convert object."); IObject created = gateway.createObject(obj, (new PojoOptions()).map()); //DataObject doCreated = PojoMapper.asDataObject(created); if (parent != null) ModelMapper.linkParentToChild(created, parent.asIObject()); return PojoMapper.asDataObject(created); }
|
publicDataObjectcreateDataObject(DataObjectchild,DataObjectparent)throwsDSOutOfServiceException,DSAccessException{if(child==null)thrownewIllegalArgumentException("Thechildcannotbenull.");IObjectobj=ModelMapper.createIObject(child,parent);if(obj==null)thrownewNullPointerException("Cannotconvertobject.");IObjectcreated=gateway.createObject(obj,(newPojoOptions()).map());//DataObjectdoCreated=PojoMapper.asDataObject(created);if(parent!=null)ModelMapper.linkParentToChild(created,parent.asIObject());returnPojoMapper.asDataObject(created);}
| 3,229,231
|
public DataObject createDataObject(DataObject child, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (child == null) throw new IllegalArgumentException("The child cannot be null."); IObject obj = ModelMapper.createIObject(child, parent); if (obj == null) throw new NullPointerException("Cannot convert object."); IObject created = gateway.createObject(obj, (new PojoOptions()).map()); //DataObject doCreated = PojoMapper.asDataObject(created); if (parent != null) ModelMapper.linkParentToChild(created, parent.asIObject()); return PojoMapper.asDataObject(created); }
|
public DataObject createDataObject(DataObject child, DataObject parent) throws DSOutOfServiceException, DSAccessException { if (child == null) throw new IllegalArgumentException("The child cannot be null."); IObject obj = ModelMapper.createIObject(child, parent); if (obj == null) throw new NullPointerException("Cannot convert object."); IObject created = gateway.createObject(obj, (new PojoOptions()).map()); //DataObject doCreated = PojoMapper.asDataObject(created); if (parent != null) ModelMapper.linkParentToChild(created, parent.asIObject()); return PojoMapper.asDataObject(created); }
| 3,229,232
|
public DataObject updateDataObject(DataObject object) throws DSOutOfServiceException, DSAccessException { if (object == null) throw new DSAccessException("No object to update."); IObject updated = gateway.updateObject(object.asIObject(), (new PojoOptions()).map()); return PojoMapper.asDataObject(updated); }
|
public DataObject updateDataObject(DataObject object) throws DSOutOfServiceException, DSAccessException { if (object == null) throw new DSAccessException("No object to update."); IObject ob = object.asIObject(); IObject updated = gateway.updateObject(ob, (new PojoOptions()).map()); return PojoMapper.asDataObject(updated); }
| 3,229,233
|
public static void linkParentToChild(IObject child, IObject parent) { if (parent == null) return; if (child == null) throw new IllegalArgumentException("Child cannot" + "be null."); if (parent instanceof Project) { if (!(child instanceof Dataset)) throw new IllegalArgumentException("Child not valid."); Project p = ((Project) parent); Dataset d = ((Dataset) child); Set links = d.findProjectDatasetLink(p); if (links != null) { Iterator i = links.iterator(); int j = 0; while (i.hasNext()) { System.out.println("creation: "+j); p.addProjectDatasetLink((ProjectDatasetLink) i.next(), false); } } //((ProjectData) parent).getDatasets().add(child); // (parent.asProject()).linkDataset(child.asDataset()); } }
|
public static void linkParentToChild(IObject child, IObject parent) { if (parent == null) return; if (child == null) throw new IllegalArgumentException("Child cannot" + "be null."); if (parent instanceof Project) { if (!(child instanceof Dataset)) throw new IllegalArgumentException("Child not valid."); Project p = ((Project) parent); Dataset d = ((Dataset) child); Set links = d.findProjectDatasetLink(p); if (links != null) { Iterator i = links.iterator(); int j = 0; while (i.hasNext()) { System.out.println("creation: "+j); p.addProjectDatasetLink((ProjectDatasetLink) i.next(), false); } } //((ProjectData) parent).getDatasets().add(child); // (parent.asProject()).linkDataset(child.asDataset()); } }
| 3,229,235
|
public static void linkParentToChild(IObject child, IObject parent) { if (parent == null) return; if (child == null) throw new IllegalArgumentException("Child cannot" + "be null."); if (parent instanceof Project) { if (!(child instanceof Dataset)) throw new IllegalArgumentException("Child not valid."); Project p = ((Project) parent); Dataset d = ((Dataset) child); Set links = d.findProjectDatasetLink(p); if (links != null) { Iterator i = links.iterator(); int j = 0; while (i.hasNext()) { System.out.println("creation: "+j); p.addProjectDatasetLink((ProjectDatasetLink) i.next(), false); } } //((ProjectData) parent).getDatasets().add(child); // (parent.asProject()).linkDataset(child.asDataset()); } }
|
public static void linkParentToChild(IObject child, IObject parent) { if (parent == null) return; if (child == null) throw new IllegalArgumentException("Child cannot" + "be null."); if (parent instanceof Project) { if (!(child instanceof Dataset)) throw new IllegalArgumentException("Child not valid."); Project p = ((Project) parent); Dataset d = ((Dataset) child); Set links = d.findProjectDatasetLink(p); if (links != null) { Iterator i = links.iterator(); int j = 0; while (i.hasNext()) { System.out.println("creation: "+j); p.addProjectDatasetLink((ProjectDatasetLink) i.next(), false); } else if (parent instanceof CategoryGroup) { if (!(child instanceof Category)) throw new IllegalArgumentException("Child not valid."); CategoryGroup p = (CategoryGroup) parent; Category d = (Category) child; CategoryGroupCategoryLink link; Iterator it = d.iterateCategoryGroupLinks(); while (it.hasNext()) { link = (CategoryGroupCategoryLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryGroupCategoryLink(link, false); } } else if (parent instanceof Dataset) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Dataset p = (Dataset) parent; Image d = (Image) child; DatasetImageLink link; Iterator it = d.iterateDatasetLinks(); while (it.hasNext()) { link = (DatasetImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addDatasetImageLink(link, false); } } else if (parent instanceof Category) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Category p = (Category) parent; Image d = (Image) child; CategoryImageLink link; Iterator it = d.iterateCategoryLinks(); while (it.hasNext()) { link = (CategoryImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryImageLink(link, false); } } } else if (parent instanceof CategoryGroup) { if (!(child instanceof Category)) throw new IllegalArgumentException("Child not valid."); CategoryGroup p = (CategoryGroup) parent; Category d = (Category) child; CategoryGroupCategoryLink link; Iterator it = d.iterateCategoryGroupLinks(); while (it.hasNext()) { link = (CategoryGroupCategoryLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryGroupCategoryLink(link, false); } } else if (parent instanceof Dataset) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Dataset p = (Dataset) parent; Image d = (Image) child; DatasetImageLink link; Iterator it = d.iterateDatasetLinks(); while (it.hasNext()) { link = (DatasetImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addDatasetImageLink(link, false); } } else if (parent instanceof Category) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Category p = (Category) parent; Image d = (Image) child; CategoryImageLink link; Iterator it = d.iterateCategoryLinks(); while (it.hasNext()) { link = (CategoryImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryImageLink(link, false); } } //((ProjectData) parent).getDatasets().add(child); // (parent.asProject()).linkDataset(child.asDataset()); } else if (parent instanceof CategoryGroup) { if (!(child instanceof Category)) throw new IllegalArgumentException("Child not valid."); CategoryGroup p = (CategoryGroup) parent; Category d = (Category) child; CategoryGroupCategoryLink link; Iterator it = d.iterateCategoryGroupLinks(); while (it.hasNext()) { link = (CategoryGroupCategoryLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryGroupCategoryLink(link, false); } } else if (parent instanceof Dataset) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Dataset p = (Dataset) parent; Image d = (Image) child; DatasetImageLink link; Iterator it = d.iterateDatasetLinks(); while (it.hasNext()) { link = (DatasetImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addDatasetImageLink(link, false); } } else if (parent instanceof Category) { if (!(child instanceof Image)) throw new IllegalArgumentException("Child not valid."); Category p = (Category) parent; Image d = (Image) child; CategoryImageLink link; Iterator it = d.iterateCategoryLinks(); while (it.hasNext()) { link = (CategoryImageLink) it.next(); if (p.getId().equals(link.parent().getId())) p.addCategoryImageLink(link, false); } } }
| 3,229,236
|
void deleteObject(IObject object, Map options) throws DSOutOfServiceException, DSAccessException { try { //IPojos service = getIPojosService(); IUpdate service = getIUpdateService(); service.deleteObject(object); } catch (Exception e) { handleException(e, "Cannot delete the object."); } }
|
void deleteObject(IObject object) throws DSOutOfServiceException, DSAccessException { try { //IPojos service = getIPojosService(); IUpdate service = getIUpdateService(); service.deleteObject(object); } catch (Exception e) { handleException(e, "Cannot delete the object."); } }
| 3,229,237
|
void deleteObject(IObject object, Map options) throws DSOutOfServiceException, DSAccessException { try { //IPojos service = getIPojosService(); IUpdate service = getIUpdateService(); service.deleteObject(object); } catch (Exception e) { handleException(e, "Cannot delete the object."); } }
|
voiddeleteObject(IObjectobject,Mapoptions)throwsDSOutOfServiceException,DSAccessException{try{//IPojosservice=getIPojosService();IUpdateservice=getIUpdateService();service.deleteObject(object);}catch(Exceptione){handleException(e,"Cannotdeletetheobject.");}}
| 3,229,238
|
PlaneSlicingDialog(QuantumPaneManager control, PlaneSlicingContext psCtx) { super(control.getReferenceFrame(), "Plane Slicing", true); manager = new PlaneSlicingDialogManager(this, control, psCtx); int yStart, yEnd, s, e; s = control.getCodomainStart(); e = control.getCodomainEnd(); yStart = TB+manager.convertRealIntoGraphics(psCtx.getLowerLimit(), s-e, e); yEnd = TB+manager.convertRealIntoGraphics(psCtx.getUpperLimit(), s-e, e); psPanel = new PlaneSlicingPanel(yStart, yEnd); pssPanel = new PlaneSlicingStaticPanel(); boolean constant = psCtx.IsConstant(); psPanel.setIsSelected(constant); pssPanel.setIsSelected(!constant); manager.setOutputStartBox(yStart); manager.setOutputEndBox(yEnd); Integer pSelected = new Integer(psCtx.getPlaneSelected()); Integer j = (Integer) rBitPlanes.get(pSelected); int i = PlaneSlicingDialogManager.B_SEVEN; if (j != null) i = j.intValue(); initialize(i, constant); manager.attachListeners(); buildGUI(); }
|
PlaneSlicingDialog(QuantumPaneManager control, PlaneSlicingContext psCtx) { super(control.getReferenceFrame(), "Plane Slicing", true); manager = new PlaneSlicingDialogManager(this, control, psCtx); int yStart, yEnd, s, e; s = control.getCodomainStart(); e = control.getCodomainEnd(); yStart = TB+manager.convertRealIntoGraphics(psCtx.getLowerLimit(), s-e, e); yEnd = TB+manager.convertRealIntoGraphics(psCtx.getUpperLimit(), s-e, e); psPanel = new PlaneSlicingPanel(yStart, yEnd); pssPanel = new PlaneSlicingStaticPanel(); boolean constant = psCtx.IsConstant(); psPanel.setIsSelected(constant); pssPanel.setIsSelected(!constant); manager.setOutputStartBox(yStart); manager.setOutputEndBox(yEnd); Integer pSelected = new Integer(psCtx.getPlaneSelected()); Integer j = (Integer) rBitPlanes.get(pSelected); int i = PlaneSlicingDialogManager.B_SEVEN; if (j != null) i = j.intValue(); initialize(i, constant); manager.attachListeners(); buildGUI(); }
| 3,229,242
|
private void buildGUI() { Container contentPane = super.getContentPane(); contentPane.setLayout(null); psPanel.setBounds(0, 0, PlaneSlicingPanel.WIDTH, PlaneSlicingPanel.HEIGHT); pssPanel.setBounds(PlaneSlicingPanel.WIDTH, 0, PlaneSlicingPanel.WIDTH, PlaneSlicingPanel.HEIGHT); contentPane.add(psPanel); contentPane.add(pssPanel); contentPane.add(buildRadioGroupPanel()); setSize(WIDTH_WIN, HEIGHT_WIN); setResizable(false); super.repaint(); }
|
private void buildGUI() { Container contentPane = super.getContentPane(); contentPane.setLayout(null); psPanel.setBounds(0, 0, PlaneSlicingPanel.WIDTH, PlaneSlicingPanel.HEIGHT); pssPanel.setBounds(PlaneSlicingPanel.WIDTH, 0, PlaneSlicingPanel.WIDTH, PlaneSlicingPanel.HEIGHT); contentPane.add(psPanel); contentPane.add(pssPanel); contentPane.add(buildRadioGroupPanel()); setSize(WIDTH_WIN, HEIGHT_WIN); setResizable(false); super.repaint(); }
| 3,229,243
|
RenderingAgtUIF getReferenceFrame() { return eventManager.getReferenceFrame(); }
|
RenderingAgtUIF getReferenceFrame() { return eventManager.getReferenceFrame(); }
| 3,229,244
|
PlaneSlicingPanel(int yStart, int yEnd) { isSelected = true; setKnobOutputStart(leftBorder-10, yStart); setKnobOutputEnd(lS+10, yEnd); startPt = new Point2D.Double(); endPt = new Point2D.Double(); startPt.setLocation((double) leftBorder, (double) yStart); endPt.setLocation((double) lS, (double) yEnd); super.repaint(); }
|
PlaneSlicingPanel(int yStart, int yEnd) { isSelected = true; setKnobOutputStart(leftBorder-10, yStart); setKnobOutputEnd(lS+10, yEnd); startPt = new Point2D.Double(); endPt = new Point2D.Double(); startPt.setLocation((double) leftBorder, (double) yStart); endPt.setLocation((double) lS, (double) yEnd); super.repaint(); }
| 3,229,245
|
public static List fillChainExecutions(List execs,ChainExecutionData ceProto, DatasetData dsProto,AnalysisChainData acProto,NodeExecutionData neProto,AnalysisNodeData anProto,ModuleData mProto,ModuleExecutionData meProto) { List execList= new ArrayList(); //The returned summary list. Iterator i = execs.iterator(); ChainExecution e; ChainExecutionData exec; Dataset d; DatasetData ds; AnalysisChain c; AnalysisChainData chain; while (i.hasNext()) { e = (ChainExecution) i.next(); //Make a new DataObject and fill it up. exec = (ChainExecutionData) ceProto.makeNew(); exec.setID(e.getID()); exec.setTimestamp(e.getTimestamp()); // dataset d = e.getDataset(); ds = (DatasetData) dsProto.makeNew(); ds.setID(d.getID()); exec.setDataset(ds); //chain c = e.getChain(); chain = (AnalysisChainData) acProto.makeNew(); chain.setID(e.getID()); exec.setChain(chain); //node executions getNodeExecutions(exec,e,neProto,anProto,mProto,meProto); execList.add(exec); } return execList; }
|
public static List fillChainExecutions(List execs,ChainExecutionData ceProto, DatasetData dsProto,AnalysisChainData acProto,NodeExecutionData neProto,AnalysisNodeData anProto,ModuleData mProto,ModuleExecutionData meProto) { List execList= new ArrayList(); //The returned summary list. Iterator i = execs.iterator(); ChainExecution e; ChainExecutionData exec; Dataset d; DatasetData ds; AnalysisChain c; AnalysisChainData chain; while (i.hasNext()) { e = (ChainExecution) i.next(); //Make a new DataObject and fill it up. exec = (ChainExecutionData) ceProto.makeNew(); exec.setID(e.getID()); exec.setTimestamp(e.getTimestamp()); // dataset d = e.getDataset(); ds = (DatasetData) dsProto.makeNew(); ds.setID(d.getID()); exec.setDataset(ds); //chain c = e.getChain(); chain = (AnalysisChainData) acProto.makeNew(); chain.setID(e.getID()); exec.setChain(chain); //node executions getNodeExecutions(exec,e,neProto,anProto,mProto,meProto); execList.add(exec); } return execList; }
| 3,229,246
|
ToolBar(ImViewerControl controller, ImViewerModel model) { if (controller == null) throw new NullPointerException("No control."); if (model == null) throw new NullPointerException("No model."); this.controller = controller; this.model = model; charWidth = getFontMetrics(getFont()).charWidth('m'); initComponents(); }
|
ToolBar(ImViewerControl controller, ImViewerModel model) { if (controller == null) throw new NullPointerException("No control."); if (model == null) throw new NullPointerException("No model."); this.controller = controller; this.model = model; initComponents(); }
| 3,229,247
|
private String toRubyName(String javaName) { if (javaName.equals("getElementAt")) { return "[]"; } else if (javaName.equals("getValueAt")) { return "[]"; } else if (javaName.equals("setValueAt")) { return "[]="; } else if (javaName.startsWith("get")) { return Character.toLowerCase(javaName.charAt(3)) + javaName.substring(4); } else if (javaName.startsWith("is")) { return Character.toLowerCase(javaName.charAt(2)) + javaName.substring(3) + "?"; } else if (javaName.startsWith("can")) { return javaName + "?"; } else if (javaName.startsWith("has")) { return javaName + "?"; } else if (javaName.startsWith("set")) { return Character.toLowerCase(javaName.charAt(3)) + javaName.substring(4) + "="; } else if (javaName.equals("compareTo")) { return "<=>"; } return javaName; }
|
private String toRubyName(String javaName) { if (javaName.equals("get")) { return "[]"; } else if (javaName.equals("set")) { return "[]="; } else if (javaName.equals("getElementAt")) { return "[]"; } else if (javaName.equals("getValueAt")) { return "[]"; } else if (javaName.equals("setValueAt")) { return "[]="; } else if (javaName.startsWith("get")) { return Character.toLowerCase(javaName.charAt(3)) + javaName.substring(4); } else if (javaName.startsWith("is")) { return Character.toLowerCase(javaName.charAt(2)) + javaName.substring(3) + "?"; } else if (javaName.startsWith("can")) { return javaName + "?"; } else if (javaName.startsWith("has")) { return javaName + "?"; } else if (javaName.startsWith("set")) { return Character.toLowerCase(javaName.charAt(3)) + javaName.substring(4) + "="; } else if (javaName.equals("compareTo")) { return "<=>"; } return javaName; }
| 3,229,248
|
public JavaEachMethod(String hasNextMethod, String nextMethod) { this.hasNextMethod = hasNextMethod; this.nextMethod = nextMethod; }
|
public JavaEachMethod(String iteratorMethod, String hasNextMethod, String nextMethod) { this.iteratorMethod = iteratorMethod; this.hasNextMethod = hasNextMethod; this.nextMethod = nextMethod; }
| 3,229,249
|
public InputStream getInStream() { return handler.getInputStream(); }
|
public InputStream getInStream() { if (handler instanceof IOHandlerJavaIO) { return ((IOHandlerJavaIO) handler).getInputStream(); } else { return null; } }
| 3,229,253
|
public OutputStream getOutStream() { return handler.getOutputStream(); }
|
public OutputStream getOutStream() { if(handler instanceof IOHandlerJavaIO) { return ((IOHandlerJavaIO) handler).getOutputStream(); } else { return null; } }
| 3,229,254
|
public IRubyObject reopen(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("wrong number of arguments"); } if (args[0].isKindOf(getRuntime().getClass("IO"))) { RubyIO ios = (RubyIO) args[0]; int keepFileno = handler.getFileno(); // close the old handler before it gets overwritten if (handler.isOpen()) { try { handler.close(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) try { handler = ios.handler.cloneIOHandler(); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOHandler.PipeException e) { throw getRuntime().newErrnoESPIPEError(); } catch (FileNotFoundException e) { throw getRuntime().newErrnoENOENTError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (args[0].isKindOf(getRuntime().getClass("String"))) { String path = ((RubyString) args[0]).toString(); String mode = "r"; if (args.length > 1) { if (!args[1].isKindOf(getRuntime().getClass("String"))) { throw getRuntime().newTypeError(args[1], getRuntime().getClass("String")); } mode = ((RubyString) args[1]).toString(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; }
|
public IRubyObject reopen(IRubyObject[] args) { if (args.length < 1) { throw getRuntime().newArgumentError("wrong number of arguments"); } if (args[0].isKindOf(getRuntime().getClass("IO"))) { RubyIO ios = (RubyIO) args[0]; int keepFileno = handler.getFileno(); // close the old handler before it gets overwritten if (handler.isOpen()) { try { handler.close(); } catch (IOHandler.BadDescriptorException e) { throw getRuntime().newErrnoEBADFError(); } catch (EOFException e) { return getRuntime().getNil(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } } // When we reopen, we want our fileno to be preserved even // though we have a new IOHandler. // Note: When we clone we get a new fileno...then we replace it. // This ends up incrementing our fileno index up, which makes the // fileno we choose different from ruby. Since this seems a bit // too implementation specific, I did not bother trying to get // these to agree (what scary code would depend on fileno generating // a particular way?) try { handler = ios.handler.cloneIOHandler(); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOHandler.PipeException e) { throw getRuntime().newErrnoESPIPEError(); } catch (FileNotFoundException e) { throw getRuntime().newErrnoENOENTError(); } catch (IOException e) { throw getRuntime().newIOError(e.getMessage()); } handler.setFileno(keepFileno); // Update fileno list with our new handler registerIOHandler(handler); } else if (args[0].isKindOf(getRuntime().getClass("String"))) { String path = ((RubyString) args[0]).toString(); String mode = "r"; if (args.length > 1) { if (!args[1].isKindOf(getRuntime().getClass("String"))) { throw getRuntime().newTypeError(args[1], getRuntime().getClass("String")); } mode = ((RubyString) args[1]).toString(); } try { if (handler != null) { close(); } modes = new IOModes(getRuntime(), mode); handler = new IOHandlerSeekable(getRuntime(), path, modes); registerIOHandler(handler); } catch (IOHandler.InvalidValueException e) { throw getRuntime().newErrnoEINVALError(); } catch (IOException e) { throw getRuntime().newIOError(e.toString()); } } // A potentially previously close IO is being 'reopened'. isOpen = true; return this; }
| 3,229,258
|
public static RubyStruct unmarshalFrom(UnmarshalStream input) throws java.io.IOException { Ruby ruby = input.getRuntime(); RubySymbol className = (RubySymbol) input.unmarshalObject(); RubyClass rbClass = pathToClass(ruby, className.toId()); if (rbClass == null) { throw new NameError(ruby, "uninitialized constant " + className); } int size = input.unmarshalInt(); IRubyObject[] values = new IRubyObject[size]; for (int i = 0; i < size; i++) { input.unmarshalObject(); // Read and discard a Symbol, which is the name values[i] = input.unmarshalObject(); } return newStruct(rbClass, values); }
|
public static RubyStruct unmarshalFrom(UnmarshalStream input) throws java.io.IOException { Ruby ruby = input.getRuntime(); RubySymbol className = (RubySymbol) input.unmarshalObject(); RubyClass rbClass = pathToClass(ruby, className.toId()); if (rbClass == null) { throw new NameError(ruby, "uninitialized constant " + className); } int size = input.unmarshalInt(); IRubyObject[] values = new IRubyObject[size]; for (int i = 0; i < size; i++) { input.unmarshalObject(); // Read and discard a Symbol, which is the name values[i] = input.unmarshalObject(); } RubyStruct result = newStruct(rbClass, values); input.register(result); return result; }
| 3,229,259
|
public final String toString () { return "constant-property:" + _vname; }
|
public final String toString () { return "constant-property:" + getVariableName(); }
| 3,229,260
|
Variable (Object names[]) { _vname = makeName(names).intern(); _names = names; }
|
Variable (Object names[]) { _names = names; }
| 3,229,261
|
public String getVariableName () { return _vname; }
|
public synchronized String getVariableName () { return _vname; }
| 3,229,262
|
public String getVariableName () { return _vname; }
|
public String getVariableName () { if (_vname == null) { _vname = makeName(_names).intern(); } return _vname; }
| 3,229,263
|
public List childNodes() { return Collections.EMPTY_LIST; }
|
public List childNodes() { return EMPTY_LIST; }
| 3,229,269
|
public void finishRenameNote(Event e) { if ((e.type == SWT.KeyDown && e.keyCode == SWT.CR) || e.type == SWT.FocusOut) { dd.getTree().disposeTreeEditor(); } }
|
public void finishRenameNote(Event e) { if ((e.type == SWT.KeyDown && e.keyCode == SWT.CR) || e.type == SWT.FocusOut) { dd.getTree().disposeTreeEditor(); } }
| 3,229,270
|
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNote(); dn.getNote().setName(newName); dn.setName(newName); }
|
public void renameNote(Event e) { String newName = dd.getTree().getTreeEditorText(); DisplayedNote dn = dd.getTree().getSelectedNote(); dn.getNote().setName(newName); dn.setName(newName); }
| 3,229,271
|
protected static String getMethodDescriptor(Class clazz, String methodName) { return clazz.getCanonicalName() + SEPARATOR + methodName; }
|
protected static String getMethodDescriptor(Class clazz, String methodName) { return clazz.getCanonicalName() + SEPARATOR + methodName; }
| 3,229,272
|
public testBothWays() throws Exception { DataObject dO = (DataObject) mapper.map( p ); Project test = (Project) reverse.map( dO ); }
|
public void testBothWays() throws Exception { DataObject dO = (DataObject) mapper.map( p ); Project test = (Project) reverse.map( dO ); }
| 3,229,274
|
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; }
|
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; }
| 3,229,275
|
public void testLongValues() throws Exception { Perms pp = new Perms(); assertEquals(pp.toLong(),-1); pp.revoke(GROUP, WRITE); pp.revoke(WORLD, WRITE); assertEquals(pp.toLong(),-37); }
|
public void testLongValues() throws Exception { Perms pp = new Perms(); assertEquals(pp.toLong(),-1); pp.revoke(GROUP, WRITE); pp.revoke(WORLD, WRITE); assertEquals(pp.toLong(),-37); }
| 3,229,276
|
protected Reader getReader() throws IOException { return new BufferedReader(new FileReader(myFile)); }
|
protected Reader getReader() throws IOException { return new BufferedReader(new InputStreamReader( new FileInputStream(myFile), myEncoding)); }
| 3,229,277
|
private void checkForEnter(KeyEvent e) { final KeyStroke keyStroke = KeyStroke.getKeyStroke(e.getKeyCode(), e.getModifiers()); if (!keyStroke.equals(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK)) && e.getKeyChar() == KeyEvent.VK_ENTER) { e.consume(); sendMessage(); getChatInputEditor().setText(""); getChatInputEditor().setCaretPosition(0); } else if (keyStroke.equals(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK))) { final Document document = getChatInputEditor().getDocument(); try { document.insertString(getChatInputEditor().getCaretPosition(), "\n", null); getChatInputEditor().requestFocusInWindow(); chatAreaButton.getButton().setEnabled(true); } catch (BadLocationException badLoc) { Log.error("Error when checking for enter:", badLoc); } } }
|
private void checkForEnter(KeyEvent e) { final KeyStroke keyStroke = KeyStroke.getKeyStroke(e.getKeyCode(), e.getModifiers()); if (!keyStroke.equals(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK)) && e.getKeyChar() == KeyEvent.VK_ENTER) { e.consume(); sendMessage(); getChatInputEditor().setText(""); getChatInputEditor().setCaretPosition(0); } else if (keyStroke.equals(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, KeyEvent.SHIFT_DOWN_MASK))) { final Document document = getChatInputEditor().getDocument(); try { document.insertString(getChatInputEditor().getCaretPosition(), "\n", null); getChatInputEditor().requestFocusInWindow(); chatAreaButton.getButton().setEnabled(true); } catch (BadLocationException badLoc) { Log.error("Error when checking for enter:", badLoc); } } }
| 3,229,278
|
private void init() { setLayout(new GridBagLayout()); add(splitPane, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); add(notificationLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 2, 5, 0), 0, 0)); // Remove Default Beveled Borders splitPane.setBorder(null); verticalSplit.setBorder(null); splitPane.setLeftComponent(verticalSplit); textScroller.setAutoscrolls(true); // Speed up scrolling. It was way too slow. textScroller.getVerticalScrollBar().setBlockIncrement(50); textScroller.getVerticalScrollBar().setUnitIncrement(20); chatWindowPanel = new JPanel(); chatWindowPanel.setLayout(new GridBagLayout()); chatWindowPanel.add(textScroller, new GridBagConstraints(0, 10, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); chatWindowPanel.setOpaque(false); // Layout Components chatPanel.add(chatWindowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // Add edit buttons to Chat Room editorBar.setOpaque(false); chatPanel.setOpaque(false); editorBar.add(new JSeparator(JSeparator.VERTICAL)); bottomPanel.setOpaque(false); splitPane.setOpaque(false); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(chatAreaButton, new GridBagConstraints(0, 1, 5, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 30)); bottomPanel.add(editorBar, new GridBagConstraints(0, 0, 5, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); verticalSplit.setOpaque(false); verticalSplit.setTopComponent(chatPanel); verticalSplit.setBottomComponent(bottomPanel); verticalSplit.setResizeWeight(1.0); verticalSplit.setDividerSize(2); // Add listener to send button chatAreaButton.getButton().addActionListener(this); // Add Key Listener to Send Field getChatInputEditor().getDocument().addDocumentListener(this); // Add Key Listener to Send Field getChatInputEditor().addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { checkForEnter(e); } }); getChatInputEditor().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ctrl F4"), "closeTheRoom"); getChatInputEditor().getActionMap().put("closeTheRoom", new AbstractAction("closeTheRoom") { public void actionPerformed(ActionEvent evt) { final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to close this chat?", "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { // Leave this chat. closeChatRoom(); } } }); }
|
private void init() { setLayout(new GridBagLayout()); add(splitPane, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); add(notificationLabel, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 2, 5, 0), 0, 0)); // Remove Default Beveled Borders splitPane.setBorder(null); verticalSplit.setBorder(null); splitPane.setLeftComponent(verticalSplit); textScroller.setAutoscrolls(true); // Speed up scrolling. It was way too slow. textScroller.getVerticalScrollBar().setBlockIncrement(50); textScroller.getVerticalScrollBar().setUnitIncrement(20); chatWindowPanel = new JPanel(); chatWindowPanel.setLayout(new GridBagLayout()); chatWindowPanel.add(textScroller, new GridBagConstraints(0, 10, 1, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); chatWindowPanel.setOpaque(false); // Layout Components chatPanel.add(chatWindowPanel, new GridBagConstraints(0, 1, 1, 1, 1.0, 1.0, GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0)); // Add edit buttons to Chat Room editorBar.setOpaque(false); chatPanel.setOpaque(false); editorBar.add(new JSeparator(JSeparator.VERTICAL)); bottomPanel.setOpaque(false); splitPane.setOpaque(false); bottomPanel.setLayout(new GridBagLayout()); bottomPanel.add(chatAreaButton, new GridBagConstraints(0, 1, 5, 1, 1.0, 1.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 30)); bottomPanel.add(editorBar, new GridBagConstraints(0, 0, 5, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0)); verticalSplit.setOpaque(false); verticalSplit.setTopComponent(chatPanel); verticalSplit.setBottomComponent(bottomPanel); verticalSplit.setResizeWeight(1.0); verticalSplit.setDividerSize(2); // Add listener to send button chatAreaButton.getButton().addActionListener(this); // Add Key Listener to Send Field getChatInputEditor().getDocument().addDocumentListener(this); // Add Key Listener to Send Field getChatInputEditor().addKeyListener(new KeyAdapter() { public void keyPressed(KeyEvent e) { checkForEnter(e); } }); getChatInputEditor().getInputMap(JComponent.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ctrl F4"), "closeTheRoom"); getChatInputEditor().getActionMap().put("closeTheRoom", new AbstractAction("closeTheRoom") { public void actionPerformed(ActionEvent evt) { final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to close this chat?", "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { // Leave this chat. closeChatRoom(); } } }); }
| 3,229,279
|
public void actionPerformed(ActionEvent evt) { final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to close this chat?", "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { // Leave this chat. closeChatRoom(); } }
|
public void actionPerformed(ActionEvent evt) { final int ok = JOptionPane.showConfirmDialog(SparkManager.getMainWindow(), "Would you like to close this chat?", "Confirmation", JOptionPane.YES_NO_OPTION); if (ok == JOptionPane.OK_OPTION) { // Leave this chat. closeChatRoom(); } }
| 3,229,280
|
public void scrollToBottom() { if (mousePressed) { return; } int chatLength = transcriptWindow.getDocument().getLength(); transcriptWindow.setCaretPosition(chatLength); JScrollBar sb = textScroller.getVerticalScrollBar(); sb.setValue(sb.getMaximum()); }
|
public void scrollToBottom() { if (mousePressed) { return; } int chatLength = transcriptWindow.getDocument().getLength(); transcriptWindow.setCaretPosition(chatLength); JScrollBar sb = textScroller.getVerticalScrollBar(); sb.setValue(sb.getMaximum()); }
| 3,229,281
|
private void initActions(BrowserModel targetModel) { // theoretically shouldn't happen if(targetModel == null) { return; } defaultTDownActions = new MouseDownActions(); defaultTOverActions = new MouseOverActions(); selectThumbnailAction = PiccoloActionFactory.getSelectThumbnailAction(targetModel); defaultTDownActions.setMouseClickAction(PiccoloModifiers.NORMAL, selectThumbnailAction); defaultTDownActions.setMouseClickAction(PiccoloModifiers.POPUP, PiccoloActions.POPUP_MENU_ACTION); semanticLayer = new SemanticLayer(); semanticHoverThumbnailAction = PiccoloActionFactory.getSemanticEnterAction(semanticLayer); semanticExitThumbnailAction = PiccoloActionFactory.getSemanticExitAction(semanticLayer); defaultTOverActions.setMouseEnterAction(PiccoloModifiers.NORMAL, semanticHoverThumbnailAction); defaultTOverActions.setMouseExitAction(PiccoloModifiers.NORMAL, semanticExitThumbnailAction); }
|
private void initActions(BrowserModel targetModel) { // theoretically shouldn't happen if(targetModel == null) { return; } defaultTDownActions = new MouseDownActions(); defaultTOverActions = new MouseOverActions(); selectThumbnailAction = PiccoloActionFactory.getSelectThumbnailAction(targetModel); defaultTDownActions.setMouseClickAction(PiccoloModifiers.NORMAL, selectThumbnailAction); defaultTDownActions.setMouseClickAction(PiccoloModifiers.POPUP, PiccoloActions.POPUP_MENU_ACTION); semanticLayer = new HoverManager(); semanticHoverThumbnailAction = PiccoloActionFactory.getSemanticEnterAction(semanticLayer); semanticExitThumbnailAction = PiccoloActionFactory.getSemanticExitAction(semanticLayer); defaultTOverActions.setMouseEnterAction(PiccoloModifiers.NORMAL, semanticHoverThumbnailAction); defaultTOverActions.setMouseExitAction(PiccoloModifiers.NORMAL, semanticExitThumbnailAction); }
| 3,229,282
|
private void initActions(BrowserModel targetModel) { // theoretically shouldn't happen if(targetModel == null) { return; } defaultTDownActions = new MouseDownActions(); defaultTOverActions = new MouseOverActions(); selectThumbnailAction = PiccoloActionFactory.getSelectThumbnailAction(targetModel); defaultTDownActions.setMouseClickAction(PiccoloModifiers.NORMAL, selectThumbnailAction); defaultTDownActions.setMouseClickAction(PiccoloModifiers.POPUP, PiccoloActions.POPUP_MENU_ACTION); semanticLayer = new SemanticLayer(); semanticHoverThumbnailAction = PiccoloActionFactory.getSemanticEnterAction(semanticLayer); semanticExitThumbnailAction = PiccoloActionFactory.getSemanticExitAction(semanticLayer); defaultTOverActions.setMouseEnterAction(PiccoloModifiers.NORMAL, semanticHoverThumbnailAction); defaultTOverActions.setMouseExitAction(PiccoloModifiers.NORMAL, semanticExitThumbnailAction); }
|
private void initActions(BrowserModel targetModel) { // theoretically shouldn't happen if(targetModel == null) { return; } defaultTDownActions = new MouseDownActions(); defaultTOverActions = new MouseOverActions(); selectThumbnailAction = PiccoloActionFactory.getSelectThumbnailAction(targetModel); defaultTDownActions.setMouseClickAction(PiccoloModifiers.NORMAL, selectThumbnailAction); defaultTDownActions.setMouseClickAction(PiccoloModifiers.POPUP, PiccoloActions.POPUP_MENU_ACTION); semanticLayer = new SemanticLayer(); semanticHoverThumbnailAction = PiccoloActionFactory.getSemanticEnterAction(semanticLayer); semanticExitThumbnailAction = PiccoloActionFactory.getOverlayExitAction(semanticLayer); defaultTOverActions.setMouseEnterAction(PiccoloModifiers.NORMAL, semanticHoverThumbnailAction); defaultTOverActions.setMouseExitAction(PiccoloModifiers.NORMAL, semanticExitThumbnailAction); }
| 3,229,283
|
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; }
|
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; }
| 3,229,284
|
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; }
|
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; }
| 3,229,285
|
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; }
|
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; }
| 3,229,286
|
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; }
|
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; }
| 3,229,287
|
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; }
|
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; }
| 3,229,288
|
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; }
|
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; }
| 3,229,289
|
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; }
|
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; }
| 3,229,290
|
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; }
|
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; }
| 3,229,291
|
public TopWindowGroup(String name, Icon icon, TaskBar tb) { if (tb == null) throw new NullPointerException("No reference to the TaskBar."); if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); taskBar = tb; winSubMenu = new JMenu(name); winSubMenu.setIcon(icon); winSubMenu.setEnabled(false); dropDownButton = new ToolBarButtonMenu(); taskBar.addToMenu(TaskBar.WINDOW_MENU, winSubMenu); taskBar.addToToolBar(TaskBar.QUICK_LAUNCH_TOOLBAR, dropDownButton); windows = new HashMap(); makeCloseAllButtons(); }
|
public TopWindowGroup(String name, Icon icon, TaskBar tb) { if (tb == null) throw new NullPointerException("No reference to the TaskBar."); if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); taskBar = tb; winSubMenu = new JMenu(name); winSubMenu.setIcon(icon); winSubMenu.setEnabled(false); dropDownButton = new ToolBarButtonMenu(); taskBar.addToMenu(TaskBar.WINDOW_MENU, winSubMenu); taskBar.addToToolBar(TaskBar.QUICK_LAUNCH_TOOLBAR, dropDownButton); windows = new HashMap(); makeCloseAllButtons(); }
| 3,229,293
|
public TopWindowGroup(String name, Icon icon, TaskBar tb) { if (tb == null) throw new NullPointerException("No reference to the TaskBar."); if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); taskBar = tb; winSubMenu = new JMenu(name); winSubMenu.setIcon(icon); winSubMenu.setEnabled(false); dropDownButton = new ToolBarButtonMenu(); taskBar.addToMenu(TaskBar.WINDOW_MENU, winSubMenu); taskBar.addToToolBar(TaskBar.QUICK_LAUNCH_TOOLBAR, dropDownButton); windows = new HashMap(); makeCloseAllButtons(); }
|
public TopWindowGroup(String name, Icon icon, TaskBar tb) { if (tb == null) throw new NullPointerException("No reference to the TaskBar."); if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); taskBar = tb; winSubMenu = new JMenu(name); winSubMenu.setIcon(icon); winSubMenu.setEnabled(false); dropDownButton = new ToolBarButtonMenu(); taskBar.addToMenu(TaskBar.WINDOW_MENU, winSubMenu); taskBar.addToToolBar(TaskBar.QUICK_LAUNCH_TOOLBAR, dropDownButton); windows = new HashMap(); makeCloseAllButtons(); }
| 3,229,294
|
public void add(TopWindow window, String name, Icon icon) { if (window == null) return; if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); WindowConfig cfg = (WindowConfig) windows.get(window); if (cfg == null) { cfg = makeConfigFor(window); windows.put(window, cfg); } cfg.winSubMenuEntry.setText(name); cfg.winSubMenuEntry.setIcon(icon); cfg.dropDownButtonEntry.setText(name); cfg.dropDownButtonEntry.setIcon(icon); //NOTE: If window has already a cfg, then we simply overwrite the //previous text and icon of the display buttons. if (windows.size() == 1) addCloseAllButtons(); winSubMenu.setEnabled(true); winSubMenu.add(cfg.winSubMenuEntry); dropDownButton.addToMenu(cfg.dropDownButtonEntry, true); }
|
public void add(TopWindow window, String name, Icon icon) { if (window == null) return; if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); WindowConfig cfg = (WindowConfig) windows.get(window); if (cfg == null) { cfg = makeConfigFor(window); windows.put(window, cfg); } cfg.winSubMenuEntry.setText(name); cfg.winSubMenuEntry.setIcon(icon); cfg.dropDownButtonEntry.setText(name); cfg.dropDownButtonEntry.setIcon(icon); //NOTE: If window has already a cfg, then we simply overwrite the //previous text and icon of the display buttons. if (windows.size() == 1) addCloseAllButtons(); winSubMenu.setEnabled(true); winSubMenu.add(cfg.winSubMenuEntry); dropDownButton.addToMenu(cfg.dropDownButtonEntry, true); }
| 3,229,295
|
public void add(TopWindow window, String name, Icon icon) { if (window == null) return; if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); WindowConfig cfg = (WindowConfig) windows.get(window); if (cfg == null) { cfg = makeConfigFor(window); windows.put(window, cfg); } cfg.winSubMenuEntry.setText(name); cfg.winSubMenuEntry.setIcon(icon); cfg.dropDownButtonEntry.setText(name); cfg.dropDownButtonEntry.setIcon(icon); //NOTE: If window has already a cfg, then we simply overwrite the //previous text and icon of the display buttons. if (windows.size() == 1) addCloseAllButtons(); winSubMenu.setEnabled(true); winSubMenu.add(cfg.winSubMenuEntry); dropDownButton.addToMenu(cfg.dropDownButtonEntry, true); }
|
public void add(TopWindow window, String name, Icon icon) { if (window == null) return; if (name == null || name.length() == 0) throw new IllegalArgumentException("Must provide a name."); WindowConfig cfg = (WindowConfig) windows.get(window); if (cfg == null) { cfg = makeConfigFor(window); windows.put(window, cfg); } cfg.winSubMenuEntry.setText(name); cfg.winSubMenuEntry.setIcon(icon); cfg.dropDownButtonEntry.setText(name); cfg.dropDownButtonEntry.setIcon(icon); //NOTE: If window has already a cfg, then we simply overwrite the //previous text and icon of the display buttons. if (windows.size() == 1) addCloseAllButtons(); winSubMenu.setEnabled(true); winSubMenu.add(cfg.winSubMenuEntry); dropDownButton.addToMenu(cfg.dropDownButtonEntry, true); }
| 3,229,296
|
public void remove(JFrame window, boolean dispose) { if (window == null) return; remove(window); if (dispose) window.dispose(); }
|
public void remove(JFrame window, boolean dispose) { if (window == null) return; remove(window); if (dispose) window.dispose(); }
| 3,229,297
|
public void remove(JFrame window, boolean dispose) { if (window == null) return; remove(window); if (dispose) window.dispose(); }
|
public void remove(JFrame window, boolean dispose) { if (window == null) return; remove(window); if (dispose) window.dispose(); }
| 3,229,298
|
private void initListener() { tabPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { int index = -1; switch (tabPane.getSelectedIndex()) { case SEARCH_TAB: index = ClipBoard.SEARCH_PANEL; break; case ANNOTATE_TAB: index = ClipBoard.ANNOTATION_PANEL; break; }; controller.setPaneIndex(index); } }); }
|
void initListener() { tabPane.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { int index = -1; switch (tabPane.getSelectedIndex()) { case SEARCH_TAB: index = ClipBoard.SEARCH_PANEL; break; case ANNOTATE_TAB: index = ClipBoard.ANNOTATION_PANEL; break; }; controller.setPaneIndex(index); } }); }
| 3,229,299
|
private void buildGUI() { setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); add(properties); add(annotate); add(classify); add(new JSeparator()); add(view); add(zoomIn); add(zoomOut); add(zoomFit); }
|
private void buildGUI() { setBorder(BorderFactory.createBevelBorder(BevelBorder.RAISED)); add(properties); add(annotate); add(classify); add(new JSeparator(SwingConstants.HORIZONTAL)); add(view); add(zoomIn); add(zoomOut); add(zoomFit); }
| 3,229,300
|
public void setAnnotations(Map map) { if (model.getState() != LOADING_ANNOTATION) throw new IllegalStateException("This method can only be invoked" + " in the LOADING_ANNOTATION state."); if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); }
|
public void setAnnotations(Map map) { if (model.getState() != LOADING_ANNOTATION) throw new IllegalStateException("This method can only be invoked" + " in the LOADING_ANNOTATION state."); if (map == null) throw new IllegalArgumentException("No annotations."); model.setAnnotations(map); view.showAnnotations(); if (model.hasThumbnail()) firePropertyChange(TreeViewer.THUMBNAIL_LOADING_PROPERTY, null, model.getHierarchyObject()); model.setState(READY); fireStateChange(); }
| 3,229,301
|
private void buildUI() { setLayout(new BorderLayout()); tabPane.add(searchView, SEARCH_TAB); tabPane.setTitleAt(SEARCH_TAB, SEARCH); tabPane.add(annotationView, ANNOTATE_TAB); tabPane.setTitleAt(ANNOTATE_TAB, ANNOTATIONS); add(tabPane, BorderLayout.CENTER); }
|
private void buildUI() { tabPane.add(searchView, SEARCH_TAB); tabPane.setTitleAt(SEARCH_TAB, SEARCH); tabPane.add(annotationView, ANNOTATE_TAB); tabPane.setTitleAt(ANNOTATE_TAB, ANNOTATIONS); add(tabPane, BorderLayout.CENTER); }
| 3,229,302
|
private void buildUI() { setLayout(new BorderLayout()); tabPane.add(searchView, SEARCH_TAB); tabPane.setTitleAt(SEARCH_TAB, SEARCH); tabPane.add(annotationView, ANNOTATE_TAB); tabPane.setTitleAt(ANNOTATE_TAB, ANNOTATIONS); add(tabPane, BorderLayout.CENTER); }
|
private void buildUI() { setLayout(new BorderLayout()); tabPane.add(searchView, SEARCH_TAB); tabPane.setTitleAt(SEARCH_TAB, SEARCH); tabPane.add(annotationView, ANNOTATE_TAB); tabPane.setTitleAt(ANNOTATE_TAB, ANNOTATIONS); setViewportView(tabPane); }
| 3,229,303
|
TreePopupMenu(ClipBoardUI clipBoard) { if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); initComponents(); buildUI(); new TreePopupMenuMng(this, clipBoard); }
|
TreePopupMenu(ClipBoardUI clipBoard, ClipBoardModel model) { if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); initComponents(); buildUI(); new TreePopupMenuMng(this, clipBoard); }
| 3,229,304
|
TreePopupMenu(ClipBoardUI clipBoard) { if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); initComponents(); buildUI(); new TreePopupMenuMng(this, clipBoard); }
|
TreePopupMenu(ClipBoardUI clipBoard) { if (clipBoard == null) throw new IllegalArgumentException("No clipBoard."); initComponents(); buildUI(); new TreePopupMenuMng(this, clipBoard, model); }
| 3,229,305
|
void setSearchResults(Set foundNodes) { pane = new SearchResultsPane(this, foundNodes); pane.addPropertyChangeListener(SearchResultsPane.LOCALIZE_IMAGE_DISPLAY, controller); treeHolder.removeAll(); treeHolder.add(new JScrollPane(pane), BorderLayout.CENTER); treeHolder.revalidate(); }
|
void setSearchResults(Set foundNodes) { pane = new SearchResultsPane(this, foundNodes); pane.addPropertyChangeListener(ClipBoard.LOCALIZE_IMAGE_DISPLAY, controller); treeHolder.removeAll(); treeHolder.add(new JScrollPane(pane), BorderLayout.CENTER); treeHolder.revalidate(); }
| 3,229,306
|
public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) { this.model = model; this.status = status; this.gradient = gradient; }
|
public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) { this.model = model; this.status = status; this.gradient = gradient; }
| 3,229,308
|
public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) { this.model = model; this.status = status; this.gradient = gradient; }
|
public HeatMapDispatcher(HeatMapModel model, HeatMapStatus status, HeatMapGradient gradient) { this.model = model; this.status = status; this.gradient = gradient; }
| 3,229,309
|
public synchronized RubyFixnum id() { if (id == 0) { id = getRuntime().getObjectSpace().createId(this); } return getRuntime().newFixnum(id); }
|
public synchronized RubyFixnum id() { if (id == 0) { id = getRuntime().getObjectSpace().createId(this); } return getRuntime().newFixnum(id); }
| 3,229,310
|
public long createId(IRubyObject object) { synchronized (identities) { cleanIdentities(); maxId += 2; // id must always be even identities.put(Long.valueOf(maxId), new IdReference(object, maxId, deadIdentityReferences)); return maxId; } }
|
public long createId(IRubyObject object) { synchronized (identities) { cleanIdentities(); maxId += 2; // id must always be even identities.put(Long.valueOf(maxId), new IdReference(object, maxId, deadIdentityReferences)); return maxId; } }
| 3,229,311
|
public final int hashCode() { return (int) RubyNumeric.fix2long(callMethod(getRuntime().getCurrentContext(), "hash")); }
|
public int hashCode() { return (int) RubyNumeric.fix2long(callMethod(getRuntime().getCurrentContext(), "hash")); }
| 3,229,312
|
public static Criteria buildDatasetCriteria(int id) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); //Specify which fields we want for the owner. c.addWantedField("owner", "FirstName"); c.addWantedField("owner", "LastName"); c.addWantedField("owner", "Email"); c.addWantedField("owner", "Institution"); c.addWantedField("owner", "Group"); //Specify which fields we want for the owner's group. c.addWantedField("owner.Group", "Name"); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Filter by ID. c.addFilter("id", new Integer(id)); return c; }
|
public static Criteria buildDatasetCriteria(int id) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); //Specify which fields we want for the owner. c.addWantedField("owner", "FirstName"); c.addWantedField("owner", "LastName"); c.addWantedField("owner", "Email"); c.addWantedField("owner", "Institution"); c.addWantedField("owner", "Group"); //Specify which fields we want for the owner's group. c.addWantedField("owner.Group", "Name"); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Filter by ID. c.addFilter("id", new Integer(id)); return c; }
| 3,229,313
|
public static Criteria buildDatasetsTree(List datasetIDs) { Criteria c = new Criteria(); c.addWantedField("name"); c.addWantedField("images"); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); if (datasetIDs != null) c.addFilter("id", "IN", datasetIDs); return c; }
|
public static Criteria buildDatasetsTree(List datasetIDs) { Criteria c = new Criteria(); c.addWantedField("name"); c.addWantedField("images"); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); if (datasetIDs != null) c.addFilter("id", "IN", datasetIDs); return c; }
| 3,229,314
|
public static Criteria buildFullUserDatasetsCriteria(int userID) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); UserMapper.objectOwnerCriteria(c); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Add filter c.addFilter("owner_id", new Integer(userID)); c.addFilter("name", "NOT LIKE", "ImportSet"); return c; }
|
publicstaticCriteriabuildFullUserDatasetsCriteria(intuserID) { Criteriac=newCriteria(); //Specifywhichfieldswewantforthedataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images");UserMapper.objectOwnerCriteria(c); //Specifywhichfieldswewantfortheimages. c.addWantedField("images","name");c.addWantedField("images","created"); c.addWantedField("images","default_pixels"); //Specifywhichfieldswewantforthepixels. c.addWantedField("images.default_pixels","ImageServerID"); c.addWantedField("images.default_pixels","Repository"); c.addWantedField("images.default_pixels.Repository","ImageServerURL"); //Addfilter c.addFilter("owner_id",newInteger(userID)); c.addFilter("name","NOTLIKE","ImportSet"); returnc; }
| 3,229,315
|
public static Criteria buildFullUserDatasetsCriteria(int userID) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); UserMapper.objectOwnerCriteria(c); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Add filter c.addFilter("owner_id", new Integer(userID)); c.addFilter("name", "NOT LIKE", "ImportSet"); return c; }
|
public static Criteria buildFullUserDatasetsCriteria(int userID) { Criteria c = new Criteria(); //Specify which fields we want for the dataset. c.addWantedField("name"); c.addWantedField("description"); c.addWantedField("owner"); c.addWantedField("images"); UserMapper.objectOwnerCriteria(c); //Specify which fields we want for the images. c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels. c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); //Add filter c.addFilter("owner_id", new Integer(userID)); c.addFilter("name", "NOT LIKE", "ImportSet"); return c; }
| 3,229,316
|
public static Criteria buildImagesCriteria(List datasetIDs, Map filters, Map complexFilters) { Criteria c = new Criteria(); //Specify which fields we want for the images. c.addWantedField("images"); c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); if (datasetIDs != null) c.addFilter("id", "IN", datasetIDs); UserMapper.setFilters(c, filters, complexFilters); return c; }
|
public static Criteria buildImagesCriteria(List datasetIDs, Map filters, Map complexFilters) { Criteria c = new Criteria(); //Specify which fields we want for the images. c.addWantedField("images"); c.addWantedField("images", "name"); c.addWantedField("images", "created"); c.addWantedField("images", "default_pixels"); //Specify which fields we want for the pixels c.addWantedField("images.default_pixels", "ImageServerID"); c.addWantedField("images.default_pixels", "Repository"); c.addWantedField("images.default_pixels.Repository", "ImageServerURL"); if (datasetIDs != null) c.addFilter("id", "IN", datasetIDs); UserMapper.setFilters(c, filters, complexFilters); return c; }
| 3,229,317
|
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill up the DataObject with the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill up the DataObject with data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill up the DataObject with data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); while (i.hasNext()) images.add(fillImageSummary((Image) i.next())); empty.setImages(images); }
|
public static void fillDataset(Dataset dataset, DatasetData empty) { //Fill up the DataObject with the data coming from Project. empty.setID(dataset.getID()); empty.setName(dataset.getName()); empty.setDescription(dataset.getDescription()); //Fill up the DataObject with data coming from Experimenter. Experimenter owner = dataset.getOwner(); empty.setOwnerID(owner.getID()); empty.setOwnerFirstName(owner.getFirstName()); empty.setOwnerLastName(owner.getLastName()); empty.setOwnerEmail(owner.getEmail()); empty.setOwnerInstitution(owner.getInstitution()); //Fill up the DataObject with data coming from Group. Group group = owner.getGroup(); empty.setOwnerGroupID(group.getID()); empty.setOwnerGroupName(group.getName()); //Create the image summary list. List images = new ArrayList(); Iterator i = dataset.getImages().iterator(); while (i.hasNext()) images.add(fillImageSummary((Image) i.next())); empty.setImages(images); }
| 3,229,318
|
public static void fillDatasetsTree(List datasets, List results, List datasetIDs) { Iterator i = datasets.iterator(), k; Map imagesMap = new HashMap(); DatasetSummaryLinked ds; Dataset d; Image img; ImageSummary is; List images; Integer id; while (i.hasNext()) { d = (Dataset) i.next(); if (datasetIDs.contains(new Integer(d.getID()))) { ds = new DatasetSummaryLinked(); ds.setID((d.getID())); ds.setName(d.getName()); k = d.getImages().iterator(); //Add images to the dataset. images = new ArrayList(); k = d.getImages().iterator(); while (k.hasNext()) { img = (Image) k.next(); id = new Integer(img.getID()); is = (ImageSummary) imagesMap.get(id); if (is == null) { is = fillImageSummary(img); imagesMap.put(id, is); } images.add(is); } ds.setImages(images); results.add(ds); } } }
|
public static void fillDatasetsTree(List datasets, List results, List datasetIDs) { Iterator i = datasets.iterator(), k; Map imagesMap = new HashMap(); DatasetSummaryLinked ds; Dataset d; Image img; ImageSummary is; List images; Integer id; while (i.hasNext()) { d = (Dataset) i.next(); if (datasetIDs.contains(new Integer(d.getID()))) { ds = new DatasetSummaryLinked(); ds.setID((d.getID())); ds.setName(d.getName()); k = d.getImages().iterator(); //Add images to the dataset. images = new ArrayList(); k = d.getImages().iterator(); while (k.hasNext()) { img = (Image) k.next(); id = new Integer(img.getID()); is = (ImageSummary) imagesMap.get(id); if (is == null) { is = ImageMapper.buildImageSummary(img, null); imagesMap.put(id, is); } images.add(is); } ds.setImages(images); results.add(ds); } } }
| 3,229,319
|
public static List fillImagesInUserDatasets(List datasets, ImageSummary iProto, List datasetIDs) { List images = new ArrayList(); HashMap map = new HashMap(); Iterator d = datasets.iterator(); Iterator i; Image image; ImageSummary is; Integer imageID; Dataset dDTO; while (d.hasNext()) { dDTO = (Dataset) d.next(); if (datasetIDs.contains(new Integer(dDTO.getID()))) { i = dDTO.getImages().iterator(); while (i.hasNext()) { image = (Image) i.next(); imageID = new Integer(image.getID()); is = (ImageSummary) map.get(imageID); if (is == null) { //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); fillImageSummary(image, is); //Add the image summary object to the list. images.add(is); map.put(imageID, is); } } } } return images; }
|
public static List fillImagesInUserDatasets(List datasets, ImageSummary iProto, List datasetIDs) { List images = new ArrayList(); HashMap map = new HashMap(); Iterator d = datasets.iterator(); Iterator i; Image image; ImageSummary is; Integer imageID; Dataset dDTO; while (d.hasNext()) { dDTO = (Dataset) d.next(); if (datasetIDs.contains(new Integer(dDTO.getID()))) { i = dDTO.getImages().iterator(); while (i.hasNext()) { image = (Image) i.next(); imageID = new Integer(image.getID()); is = (ImageSummary) map.get(imageID); if (is == null) { //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); ImageMapper.buildImageSummary(image, is); //Add the image summary object to the list. images.add(is); map.put(imageID, is); } } } } return images; }
| 3,229,320
|
public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); fillImageSummary(image, is); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); //Add the image summary object to the list. images.add(is); } return images; }
|
public static List fillListAnnotatedImages(Dataset dataset, ImageSummary iProto, List annotations, List images) { Iterator i = dataset.getImages().iterator(); Image image; ImageSummary is; int id; Map ids = AnnotationMapper.reverseListImageAnnotations(annotations); while (i.hasNext()) { image = (Image) i.next(); //Make a new DataObject and fill it up. is = (ImageSummary) iProto.makeNew(); ImageMapper.buildImageSummary(image, is); id = image.getID(); is.setAnnotation(AnnotationMapper.fillImageAnnotation( (ImageAnnotation) ids.get(new Integer(id)))); //Add the image summary object to the list. images.add(is); } return images; }
| 3,229,321
|
public static Map reverseListImageAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); ImageAnnotation annotation; while (i.hasNext()) { annotation = (ImageAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); } return map; }
|
public static Map reverseListImageAnnotations(List annotations) { Map map = new HashMap(); Iterator i = annotations.iterator(); ImageAnnotation annotation; while (i.hasNext()) { annotation = (ImageAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); } return map; }
| 3,229,322
|
public static Map reverseListImageAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); ImageAnnotation annotation; while (i.hasNext()) { annotation = (ImageAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); } return map; }
|
public static Map reverseListImageAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); ImageAnnotation annotation; while (i.hasNext()) { annotation = (ImageAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getImage().getID()), annotation); } return map; }
| 3,229,323
|
public static Map reverseListDatasetAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); DatasetAnnotation annotation; while (i.hasNext()) { annotation = (DatasetAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), annotation); } return map; }
|
public static Map reverseListDatasetAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); DatasetAnnotation annotation; while (i.hasNext()) { annotation = (DatasetAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), annotation); } return map; }
| 3,229,324
|
public static Map reverseListDatasetAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); DatasetAnnotation annotation; while (i.hasNext()) { annotation = (DatasetAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), annotation); } return map; }
|
public static Map reverseListDatasetAnnotations(List annotations, int userID) { Map map = new HashMap(); Iterator i = annotations.iterator(); DatasetAnnotation annotation; while (i.hasNext()) { annotation = (DatasetAnnotation) i.next(); if (userID == annotation.getModuleExecution().getExperimenter().getID()) map.put(new Integer(annotation.getDataset().getID()), annotation); } return map; }
| 3,229,325
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.