Examples of Expander


Examples of com.admc.util.Expander

                    .getAbsolutePath());
            tmpDir = tmpDir.getParentFile();
        }

        JCreole jCreole = new JCreole(IOUtil.toString(bpStream));
        Expander htmlExpander = jCreole.getHtmlExpander();
        Date now = new Date();
        htmlExpander.put(
                "isoDateTime", isoDateTimeFormatter.format(now), false);
        htmlExpander.put("isoDate", isoDateFormatter.format(now), false);
        htmlExpander.put("contextPath", contextPath, false);
        htmlExpander.put("pageBaseName", pageBaseName, false);
        htmlExpander.put("pageDirPath", absUrlDirPath, false);
        htmlExpander.put("pageTitle", absUrlBasePath, false);
        if (readmeSb == null) {
            htmlExpander.put("readmeContent", "");
        } else {
            JCreole readmeJCreole = new JCreole();
            readmeJCreole.setHtmlExpander(htmlExpander);
            readmeJCreole.setInterWikiMapper(this);
            readmeJCreole.setPrivileges(jcreolePrivs);
            htmlExpander.put("readmeContent", readmeJCreole.postProcess(
                    readmeJCreole.parseCreole(readmeSb), "\n"), false);
        }
        if (fsDirFile != null) {
            FileComparator.SortBy sortBy = FileComparator.SortBy.NAME;
            boolean ascending = true;
            String sortStr = req.getParameter("sort");
            if (sortStr != null) {
                Matcher m = sortParamPattern.matcher(sortStr);
                if (!m.matches())
                    throw new ServletException(
                            "Malformatted sort value: " + sortStr);
                ascending = m.group(1).equals("+");
                try {
                    sortBy = Enum.valueOf(
                            FileComparator.SortBy.class, m.group(2));
                } catch (Exception e) {
                    throw new ServletException(
                            "Malformatted sort string: " + sortStr);
                }
            }
            htmlExpander.put("index", "\n"
                    + indexer.generateTable(fsDirFile, absUrlDirPath, true,
                    sortBy, ascending), false);
            // An alternative for using the Tomcat-like Indexer in a
            // htmlExpander would be to write a Creole table to a
            // creoleExpander.
View Full Code Here

Examples of org.apache.hadoop.gateway.util.urltemplate.Expander

    return "rewrite";
  }

  @Override
  public void initialize( UrlRewriteEnvironment environment, UrlRewriteActionRewriteDescriptorExt descriptor ) throws Exception {
    this.expander = new Expander();
    this.template = Parser.parse( descriptor.parameter() );
  }
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

    @Override
    public void install(Component component) {
        super.install(component);

        Expander expander = (Expander)component;
        expander.add(titleBarTablePane);

        Image buttonData = expander.isExpanded() ? collapseImage : expandImage;
        shadeButton = new ShadeButton(buttonData);
        buttonBoxPane.add(shadeButton);

        shadeButton.getButtonPressListeners().add(this);
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

        enabledChanged(expander);
    }

    @Override
    public int getPreferredWidth(int height) {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        int preferredWidth = titleBarTablePane.getPreferredWidth(-1);

        if (content != null) {
            int contentHeight = -1;

            if (height >= 0) {
                int reservedHeight = 2 + padding.top + padding.bottom
                    + titleBarTablePane.getPreferredHeight(-1);

                if (expander.isExpanded()) {
                    // Title bar border is only drawn when expander is expanded
                    reservedHeight += 1;
                }

                contentHeight = Math.max(height - reservedHeight, 0);
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

        return preferredWidth;
    }

    @Override
    public int getPreferredHeight(int width) {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        int preferredHeight = titleBarTablePane.getPreferredHeight(-1);

        if (content != null
            && (expander.isExpanded()
                || expandTransition != null)) {
            // Title bar border is only drawn when content is non-null and
            // expander is expanded or expanding
            preferredHeight += 1;
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

        return preferredHeight;
    }

    @Override
    public Dimensions getPreferredSize() {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        Dimensions titleBarSize = titleBarTablePane.getPreferredSize();

        int preferredWidth = titleBarSize.width;
        int preferredHeight = titleBarSize.height;

        if (content != null) {
            Dimensions contentSize = content.getPreferredSize();

            preferredWidth = Math.max(contentSize.width + (padding.left + padding.right),
                preferredWidth);

            if (expander.isExpanded()
                || expandTransition != null) {
                // Title bar border is only drawn when expander is expanded
                // or expanding
                preferredHeight += 1;
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

        return new Dimensions(preferredWidth, preferredHeight);
    }

    @Override
    public int getBaseline(int width, int height) {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        int baseline = -1;

        if (content != null) {
            int titleBarWidth = Math.max(width - 2, 0);
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

        return baseline;
    }

    @Override
    public void layout() {
        Expander expander = (Expander)getComponent();
        Component content = expander.getContent();

        int width = getWidth();
        int height = getHeight();

        int titleBarHeight = titleBarTablePane.getPreferredHeight(-1);
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

     * @param button
     *     The source of the button event.
     */
    @Override
    public void buttonPressed(Button button) {
        Expander expander = (Expander)getComponent();

        if (expander.isCollapsible()) {
            expander.setExpanded(!expander.isExpanded());
        }
    }
View Full Code Here

Examples of org.apache.pivot.wtk.Expander

            return scale;
        }

        @Override
        public void start(TransitionListener transitionListener) {
            Expander expander = (Expander)getComponent();
            Component content = expander.getContent();
            content.getDecorators().add(clipDecorator);

            expander.setEnabled(false);

            super.start(transitionListener);
        }
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.