Esempio n. 1
0
  public static EditableTableComponent instance(
      RequestContext context, String id, TableComponent table) {
    Locale locale = context.getLocale();
    ResourceBundle resb = ResourceBundle.getBundle("com.tonbeller.wcf.table.resources", locale);
    String path = PluginUtils.getPluginDir() + "/ui/resources/wcf/tableproperties.xml";

    /*
    URL url = null;
    try {
    //	url = ResourceLocator.getResource(context.getServletContext(),
    			//locale, path);
    	url = context.getServletContext().getResource(path);
    } catch (Exception e) {
    	e.printStackTrace();
    	throw new SoftException(e);
    }
    */
    // Document doc = XmlUtils.parse(url);
    Document doc = null;
    try {
      doc = XmlUtils.parse(new File(path).toURL());
    } catch (MalformedURLException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    // In replaceI18n(...) wird geprüft, ob "bundle"-Attribut vorhanden
    FormDocument.replaceI18n(context, doc, null);

    TablePropertiesFormComponent formComp =
        new TablePropertiesFormComponent(id + ".form", null, doc, table);
    formComp.setVisible(false);
    formComp.setCloseable(true);
    return new EditableTableComponent(id, null, table, formComp);
  }
Esempio n. 2
0
 public void request(RequestContext context) throws Exception {
   tableComp.validate(context);
   formComp.setVisible(true);
 }