Examples of ActionLink


Examples of com.intellij.ui.components.labels.ActionLink

    return false;
  }

  private void createUIComponents() {
    myLinkContainer = new JPanel(new BorderLayout());
    ActionLink link = new ActionLink("Download the latest Rebar version", new AnAction() {
      @Override
      public void actionPerformed(AnActionEvent e) {
        DownloadableFileService service = DownloadableFileService.getInstance();
        DownloadableFileDescription rebar = service.createFileDescription("https://github.com/rebar/rebar/wiki/rebar", "rebar");
        FileDownloader downloader = service.createDownloader(ContainerUtil.list(rebar), "rebar");
View Full Code Here

Examples of org.apache.cayenne.swing.control.ActionLink

        this.pairs = new JCheckBox();
        this.generatorVersion = new JComboBox();
        this.overwrite = new JCheckBox();
        this.usePackagePath = new JCheckBox();
        this.outputPattern = new JTextField();
        this.manageTemplatesLink = new ActionLink("Customize Templates...");
        manageTemplatesLink.setFont(manageTemplatesLink.getFont().deriveFont(10f));

        pairs.addChangeListener(new ChangeListener() {

            public void stateChanged(ChangeEvent e) {
View Full Code Here

Examples of org.apache.click.control.ActionLink

    private ActionLink link;
    private Field field;

    public PageHeadDemo() {
        // When this link is clicked it will toggle the Field's disabled attribute
        link = new ActionLink("link", "Hide");
        link.setId("link-id");

         // Create a new TextField and add it the Page controls
        field = new TextField("field");
View Full Code Here

Examples of org.apache.click.control.ActionLink

    @Override
    public void onInit() {
        super.onInit();

        ActionLink link = new ActionLink("export");
        link.setActionListener(new ActionListener() {
            public boolean onAction(Control source) {
                export();
                return false;
            }
        });
View Full Code Here

Examples of org.apache.click.control.ActionLink

     * @see Table#onProcess()
     *
     * @return true if further processing should continue or false otherwise
     */
    public boolean onProcess() {
        ActionLink controlLink = getControlLink();

        boolean continueProcessing = super.onProcess();

        if (!controlLink.isClicked() && getForm().isFormSubmission()) {
            Field pageField = getForm().getField(PAGE);
            pageField.onProcess();
            if (StringUtils.isNotBlank(pageField.getValue())) {
                setPageNumber(Integer.parseInt(pageField.getValue()));
            }

            Field columnField = getForm().getField(COLUMN);
            columnField.onProcess();
            setSortedColumn(columnField.getValue());

            Field ascendingField = getForm().getField(ASCENDING);
            ascendingField.onProcess();
            setSortedAscending("true".equals(ascendingField.getValue()));

            // Range sanity check
            int pageNumber = Math.min(getPageNumber(), getRowList().size() - 1);
            pageNumber = Math.max(pageNumber, 0);
            setPageNumber(pageNumber);

            //Have to sort list here before we process each field. Otherwise if
            //sortRowList() is only called in Table.toString(), the fields values set here
            //will not correspond to their rows in the rowList.
            sortRowList();

            int firstRow = getFirstRow();
            int lastRow = getLastRow();

            List rowList = getRowList();
            List columnList = getColumnList();

            for (int i = firstRow; i < lastRow; i++) {
                Object row = rowList.get(i);

                for (int j = 0; j < columnList.size(); j++) {

                    Column column = (Column) columnList.get(j);

                    if (column instanceof FieldColumn) {
                        FieldColumn fieldColumn = (FieldColumn) column;
                        Field field = fieldColumn.getField();

                        field.setName(column.getName() + "_" + i);

                        field.onProcess();

                        if (field.isValid()) {
                            fieldColumn.setProperty(row, column.getName(),
                                field.getValueObject());
                        } else {
                            getForm().setError(getMessage("formtable-error"));
                        }
                    }
                }
            }
        } else {
            String page = controlLink.getParameter(PAGE);
            getForm().getField(PAGE).setValue(page);

            String column = controlLink.getParameter(COLUMN);
            getForm().getField(COLUMN).setValue(column);

            String ascending =  controlLink.getParameter(ASCENDING);
            getForm().getField(ASCENDING).setValue(ascending);

            // Table.onProcess() flips the sort order, so to ensure the ASCENDING
            // Field value is in sync with the Table, we flip the field value as
            // well.
            String sort = controlLink.getParameter(SORT);
            if ("true".equals(sort) || ascending == null) {
                getForm().getField(ASCENDING).setValue("true".equals(ascending) ? "false" : "true");
            }
        }

View Full Code Here

Examples of org.apache.click.control.ActionLink

            //Loop over all links and check if any was clicked
            if (linksArray != null) {
                for (int i = 0; i < linksArray.length; i++) {
                    AbstractLink link = linksArray[i];
                    if (link instanceof ActionLink) {
                        ActionLink actionLink = (ActionLink) link;

                        String name = actionLink.getName();
                        if (name != null) {
                            clicked = name.equals(context.getRequestParameter(ActionLink.ACTION_LINK));
                        } else {
                            throw new IllegalStateException("ActionLink name not defined");
                        }
View Full Code Here

Examples of org.apache.click.control.ActionLink

        if (table == null) {
            throw new IllegalStateException("No parent table defined."
                + " Ensure a parent Table is set using #setTable(Table).");
        }

        final ActionLink controlLink = table.getControlLink();

        if (table.getSortedColumn() != null) {
            controlLink.setParameter(Table.SORT, null);
            controlLink.setParameter(Table.COLUMN, table.getSortedColumn());
            controlLink.setParameter(Table.ASCENDING, String.valueOf(table.isSortedAscending()));
        } else {
            controlLink.setParameter(Table.SORT, null);
            controlLink.setParameter(Table.COLUMN, null);
            controlLink.setParameter(Table.ASCENDING, null);
        }

        String firstLabel = "";
        String previousLabel = "";

        if (table.getPageNumber() > 0) {
            controlLink.setDisabled(false);
            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-first-image"));
            controlLink.setParameter(Table.PAGE, String.valueOf(0));
            controlLink.setTitle(table.getMessage("table-first-title"));
            firstLabel = controlLink.toString();

            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-previous-image"));
            controlLink.setParameter(Table.PAGE, String.valueOf(table.getPageNumber() - 1));
            controlLink.setTitle(table.getMessage("table-previous-title"));
            previousLabel = controlLink.toString();

        } else {
            controlLink.setDisabled(true);

            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-first-disabled-image"));
            controlLink.setParameter(Table.PAGE, null);
            controlLink.setTitle(null);
            firstLabel = controlLink.toString();

            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-previous-disabled-image"));
            controlLink.setParameter(Table.PAGE, null);
            controlLink.setTitle(null);
            previousLabel = controlLink.toString();
        }

        HtmlStringBuffer pagesBuffer =
            new HtmlStringBuffer(table.getNumberPages() * 70);

        // Create sliding window of paging links
        int lowerBound = Math.max(0, table.getPageNumber() - 5);
        int upperBound = Math.min(lowerBound + 10, table.getNumberPages());
        if (upperBound - lowerBound < 10) {
            lowerBound = Math.max(upperBound - 10, 0);
        }

        controlLink.setImageSrc(null);
        controlLink.setDisabled(false);
        String gotoTitle = table.getMessage("table-goto-title");

        for (int i = lowerBound; i < upperBound; i++) {
            String pageNumber = String.valueOf(i + 1);
            if (i == table.getPageNumber()) {
                pagesBuffer.append("<strong>" + pageNumber + "</strong>");

            } else {
                controlLink.setLabel(pageNumber);
                controlLink.setParameter(Table.PAGE, String.valueOf(i));
                controlLink.setTitle(gotoTitle + " " + pageNumber);
                pagesBuffer.append(controlLink.toString());
            }

            if (i < upperBound - 1) {
                pagesBuffer.append("&#160; ");
            }
        }

        String nextLabel = "";
        String lastLabel = "";

        if (table.getPageNumber() < table.getNumberPages() - 1) {
            controlLink.setDisabled(false);
            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-next-image"));
            controlLink.setParameter(Table.PAGE, String.valueOf(table.getPageNumber() + 1));
            controlLink.setTitle(table.getMessage("table-next-title"));
            nextLabel = controlLink.toString();

            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-last-image"));
            controlLink.setParameter(Table.PAGE, String.valueOf(table.getNumberPages() - 1));
            controlLink.setTitle(table.getMessage("table-last-title"));
            lastLabel = controlLink.toString();

        } else {
            controlLink.setDisabled(true);

            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-next-disabled-image"));
            controlLink.setParameter(Table.PAGE, null);
            controlLink.setTitle(null);
            nextLabel = controlLink.toString();

            controlLink.setImageSrc(paginatorMessages.getMessage("table-inline-last-disabled-image"));
            controlLink.setParameter(Table.PAGE, null);
            controlLink.setTitle(null);
            lastLabel = controlLink.toString();
        }

        controlLink.setDisabled(false);
        controlLink.setImageSrc(null);
        controlLink.setTitle(null);

        final String pageLinks = pagesBuffer.toString();

        final String[] args =
            { firstLabel, previousLabel, pageLinks, nextLabel, lastLabel };
View Full Code Here

Examples of org.apache.click.control.ActionLink

        }
    }

    public AbstractLink getExportLink() {
        if (exportLink == null) {
            exportLink = new ActionLink();
            exportLink.setLabel(getLabel());
            exportLink.setImageSrc(getImageSrc());

            if (StringUtils.isNotBlank(getLabel()) && StringUtils.isNotBlank(
                getImageSrc())) {
View Full Code Here

Examples of org.apache.click.control.ActionLink

                }
            }
        } else {
            // Explicitly bind the link to the request and check if the
            // link was clicked
            ActionLink link = getTabLink();
            link.bindRequestValue();
            if (link.isClicked()) {

                // Check which panel user selected and set that Panel as active
                for (int i = 0; i < getPanels().size(); i++) {
                    Panel panel = getPanels().get(i);

                    // Deactivate panel
                    panel.setActive(false);

                    if (link.getValue().equals(panel.getName())
                        && !panel.isDisabled()) {

                        setActivePanel(panel);
                    }
                }
View Full Code Here

Examples of org.apache.click.control.ActionLink

    @Override
    public void onInit() {
        super.onInit();

        ActionLink link = new ActionLink("export");
        link.setActionListener(new ActionListener() {
            private static final long serialVersionUID = 1L;

            public boolean onAction(Control source) {
                export();
                return false;
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.