Examples of Layout


Examples of net.sf.jabref.export.layout.Layout

    if (ss == null)
        ss = getSaveSession(encoding, outFile);
       
    VerifyingWriter ps = ss.getWriter();

        Layout beginLayout = null;
    Reader reader = null;

        // Check if this export filter has bundled name formatters:
        HashMap<String,String> customNameFormatters = readFormatterFile(lfFileName);
        // Set a global field, so all layouts have access to the custom name formatters:
        Globals.prefs.customExportNameFormatters = customNameFormatters;

        ArrayList<String> missingFormatters = new ArrayList<String>(1);

        // Print header
        try {
      reader = getReader(lfFileName + ".begin.layout");
      LayoutHelper layoutHelper = new LayoutHelper(reader);
      beginLayout = layoutHelper
        .getLayoutFromText(Globals.FORMATTER_PACKAGE);
            reader.close();
    } catch (IOException ex) {
      // If an exception was cast, export filter doesn't have a begin
      // file.
    }
    // Write the header
    if (beginLayout != null) {
      ps.write(beginLayout.doLayout(database, encoding));
            missingFormatters.addAll(beginLayout.getMissingFormatters());
    }

    /*
     * Write database entries; entries will be sorted as they appear on the
     * screen, or sorted by author, depending on Preferences. We also supply
     * the Set entries - if we are to export only certain entries, it will
     * be non-null, and be used to choose entries. Otherwise, it will be
     * null, and be ignored.
     */
    List<BibtexEntry> sorted = FileActions.getSortedEntries(database,
      entryIds, false);

    // Load default layout
    reader = getReader(lfFileName + ".layout");

    LayoutHelper layoutHelper = new LayoutHelper(reader);
    Layout defLayout = layoutHelper
      .getLayoutFromText(Globals.FORMATTER_PACKAGE);
    reader.close();
        if (defLayout != null) {
            missingFormatters.addAll(defLayout.getMissingFormatters());
            System.out.println(defLayout.getMissingFormatters());
        }
    HashMap<String, Layout> layouts = new HashMap<String, Layout>();
    Layout layout;

        ExportFormats.entryNumber = 0;
    for (BibtexEntry entry : sorted) {
            ExportFormats.entryNumber++; // Increment entry counter.
      // Get the layout
      String type = entry.getType().getName().toLowerCase();
      if (layouts.containsKey(type))
        layout = layouts.get(type);
      else {
        try {
          // We try to get a type-specific layout for this entry.
          reader = getReader(lfFileName + "." + type + ".layout");
          layoutHelper = new LayoutHelper(reader);
          layout = layoutHelper
            .getLayoutFromText(Globals.FORMATTER_PACKAGE);
          layouts.put(type, layout);
          reader.close();
                    if (layout != null)
                        missingFormatters.addAll(layout.getMissingFormatters());

        } catch (IOException ex) {
          // The exception indicates that no type-specific layout
          // exists, so we
          // go with the default one.
          layout = defLayout;
        }
      }

      // Write the entry
      ps.write(layout.doLayout(entry, database));
    }

    // Print footer

    // changed section - begin (arudert)
    Layout endLayout = null;
    try {
      reader = getReader(lfFileName + ".end.layout");
      layoutHelper = new LayoutHelper(reader);
      endLayout = layoutHelper
        .getLayoutFromText(Globals.FORMATTER_PACKAGE);
      reader.close();
    } catch (IOException ex) {
      // If an exception was thrown, export filter doesn't have an end
      // file.
    }

    // Write footer
    if (endLayout != null) {
      ps.write(endLayout.doLayout(database, encoding));
            missingFormatters.addAll(endLayout.getMissingFormatters());
    }

        // Clear custom name formatters:
        Globals.prefs.customExportNameFormatters = null;

View Full Code Here

Examples of org.apache.cocoon.portal.layout.Layout

    throws SAXException {
        PortalService service = null;
        try {
            service = (PortalService)this.manager.lookup(PortalService.ROLE);
            // first check for a full screen layout
            Layout portalLayout = service.getEntryLayout(null);
            if ( portalLayout == null ) {
                portalLayout = service.getComponentManager().getProfileManager().getPortalLayout(null, null);
            }

            Renderer portalLayoutRenderer = service.getComponentManager().getRenderer( portalLayout.getRendererName());      

            contentHandler.startDocument();
            portalLayoutRenderer.toSAX(portalLayout, service, contentHandler);
            contentHandler.endDocument();
        } catch (ServiceException ce) {
View Full Code Here

Examples of org.apache.cxf.ws.security.policy.model.Layout

    protected WSSecTimestamp handleLayout(WSSecTimestamp timestamp) {
        Collection<AssertionInfo> ais;
        ais = aim.get(SP12Constants.LAYOUT);
        if (ais != null) {
            for (AssertionInfo ai : ais) {
                Layout layout = (Layout)ai.getAssertion();
                ai.setAsserted(true);
                if (SPConstants.Layout.LaxTsLast == layout.getValue()) {
                    if (timestamp == null) {
                        ai.setNotAsserted(SPConstants.Layout.LaxTsLast + " requires a timestamp");
                    } else {
                        ai.setAsserted(true);
                        Element el = timestamp.getElement();
                        secHeader.getSecurityHeader().appendChild(el);
                        if (bottomUpElement == null) {
                            bottomUpElement = el;
                        }
                    }
                } else if (SPConstants.Layout.LaxTsFirst == layout.getValue()) {
                    if (timestamp == null) {
                        ai.setNotAsserted(SPConstants.Layout.LaxTsFirst + " requires a timestamp");
                    } else {
                        addTopDownElement(timestampEl.getElement());
                    }
View Full Code Here

Examples of org.apache.cxf.ws.security.policy.model.Layout

    protected WSSecTimestamp handleLayout(WSSecTimestamp timestamp) {
        Collection<AssertionInfo> ais;
        ais = aim.get(SP12Constants.LAYOUT);
        if (ais != null) {
            for (AssertionInfo ai : ais) {
                Layout layout = (Layout)ai.getAssertion();
                ai.setAsserted(true);
                if (SPConstants.Layout.LaxTsLast == layout.getValue()) {
                    if (timestamp == null) {
                        ai.setNotAsserted(SPConstants.Layout.LaxTsLast + " requires a timestamp");
                    } else {
                        ai.setAsserted(true);
                        Element el = timestamp.getElement();
                        secHeader.getSecurityHeader().appendChild(el);
                        if (bottomUpElement == null) {
                            bottomUpElement = el;
                        }
                    }
                } else if (SPConstants.Layout.LaxTsFirst == layout.getValue()) {
                    if (timestamp == null) {
                        ai.setNotAsserted(SPConstants.Layout.LaxTsFirst + " requires a timestamp");
                    } else {
                        addTopDownElement(timestampEl.getElement());
                    }
View Full Code Here

Examples of org.apache.cxf.ws.security.policy.model.Layout

            return false;
        }
        assertPolicy(aim, SP12Constants.INCLUDE_TIMESTAMP);
       
        // Check the Layout
        Layout layout = binding.getLayout();
        boolean timestampFirst = layout.getValue() == SPConstants.Layout.LaxTsFirst;
        boolean timestampLast = layout.getValue() == SPConstants.Layout.LaxTsLast;
        if (!validateLayout(timestampFirst, timestampLast, results)) {
            String error = "Layout does not match the requirements";
            notAssertPolicy(aim, layout, error);
            ai.setNotAsserted(error);
            return false;
View Full Code Here

Examples of org.apache.geronimo.gshell.layout.model.Layout

  private String shell = "";
 
    public void register(final Command command, Map<String, ?> properties) {
      String shellName = (String) properties.get("shell");
      if( shellName!=null ) {
          Layout layout = getLayoutForShell(shellName);
       
          String id = command.getId();
          String alias = (String) properties.get("alias");
          if( alias == null ) {
            alias = id;
            int p;
            if( (p=alias.lastIndexOf(":")) >= 0 ) {
              alias = alias.substring(p+1);
            }
            layout.add(new CommandNode(alias, id));       
          } else {
            String[] aliases = alias.split(",");
            for (String a : aliases) {
              a = a.trim();
          if( a.length()> 0 ) {
                layout.add(new CommandNode(a, id));       
          }
        }
          }
         
      }
View Full Code Here

Examples of org.apache.isis.viewer.dnd.view.base.Layout

    public final View createView(final Content content, final Axes axes, final int sequence) {
        resolveObject(content);

        createAxes(content, axes);
        builder.createAxes(axes, content);
        final Layout layout = createLayout(content, axes);
        if (layout instanceof ViewAxis) {
            axes.add((ViewAxis) layout);
        }

        final CompositeViewUsingBuilder view = new CompositeViewUsingBuilder(content, this, axes, layout, builder);
View Full Code Here

Examples of org.apache.jetspeed.om.profile.Layout

        throws java.lang.IndexOutOfBoundsException
    {
        portlets.addElement(p);
        // STW make sure layout gets set
        int end = getEntryCount();
        Layout layout = p.getLayout();
        if(layout != null)
        {
            layout.setPosition(end);
            layout.setSize(-1);
        }
    }
View Full Code Here

Examples of org.apache.log4j.Layout

      PropertyConfigurator.configure(logConfigFileName);
    } else {
      ApplicationFiles appFiles = new ApplicationFiles();
     
      String logMessagePattern = "%-4r [%t] %-5p %c %x - %m%n";
      Layout layout = new PatternLayout(logMessagePattern);
     
      File logsDir = new File(appFiles.getUserSettingsDirectory(), "logs");
      File updateLogFile = new File(logsDir, "updater.log");
     
      FileAppender appender = new FileAppender(layout, updateLogFile.getAbsolutePath());
View Full Code Here

Examples of org.apache.log4j.Layout

    logViewerVC = createVelocityContainer("logviewer");
    logViewerVC.contextPut("loggingPackage", loggingPackage);
    // Create logger for requested package and add a string writer appender
    log4JLogger = Logger.getLogger(loggingPackage);
    writer = new StringWriter();
    Layout layout = new PatternLayout("%d{HH:mm:ss} %-5p [%t]: %m%n");
    writerAppender = new WriterAppender(layout, writer);
    writerAppender.setThreshold(level);
    log4JLogger.addAppender(writerAppender);
    updateLogViewFromWriter();
    // Add job to read from the string writer every second
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.