Java Code Examples for org.apache.wicket.markup.html.link.Link

The following are top voted examples for showing how to use org.apache.wicket.markup.html.link.Link. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: gitplex-mit   File: RequestOverviewPage.java   View source code 7 votes vote down vote up
private WebMarkupContainer newManageContainer() {
	WebMarkupContainer container = new WebMarkupContainer("manage");
	container.setVisible(SecurityUtils.canModify(getPullRequest()));
	container.add(new Link<Void>("synchronize") {

		@Override
		public void onClick() {
			GitPlex.getInstance(PullRequestManager.class).check(getPullRequest());
			Session.get().success("Pull request is synchronized");
		}
		
	});
	container.add(new Link<Void>("delete") {

		@Override
		public void onClick() {
			PullRequest request = getPullRequest();
			GitPlex.getInstance(PullRequestManager.class).delete(request);
			Session.get().success("Pull request #" + request.getNumber() + " is deleted");
			setResponsePage(RequestListPage.class, RequestListPage.paramsOf(getProject()));
		}
		
	}.add(new ConfirmOnClick("Do you really want to delete this pull request?")));
	return container;
}
 
Example 2
Project: gitplex-mit   File: NewRequestPage.java   View source code 6 votes vote down vote up
private Fragment newAcceptedFrag() {
	Fragment fragment = new Fragment("status", "mergedFrag", this);
	fragment.add(new BranchLink("sourceBranch", getPullRequest().getSource(), null));
	fragment.add(new BranchLink("targetBranch", getPullRequest().getTarget(), null));
	fragment.add(new Link<Void>("swapBranches") {

		@Override
		public void onClick() {
			setResponsePage(
					NewRequestPage.class, 
					paramsOf(getProject(), getPullRequest().getSource(), getPullRequest().getTarget()));
		}
		
	});
	return fragment;
}
 
Example 3
Project: openNaEF   File: LinkEditPage.java   View source code 6 votes vote down vote up
private Link<Void> createEditor(String id, final PortDto port,
                                final PortDto neighbor) {
    Link<Void> link = new Link<Void>(id) {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            port.renew();
            String nodeName = NodeUtil.getNodeName(neighbor);
            LinkNeighborPortSelectionPage page = new LinkNeighborPortSelectionPage(
                    LinkEditPage.this, getBackPage(), port, nodeName);
            setResponsePage(page);
        }
    };
    return link;
}
 
Example 4
Project: openNaEF   File: LocationViewPage.java   View source code 6 votes vote down vote up
private void createHeader() {
    ExternalLink topLink = UrlUtil.getTopLink("top");
    add(topLink);
    Link<Void> reloadLink = new BookmarkablePageLink<Void>("refresh",
            LocationViewPage.class, LocationUtil.getParameters(current));
    add(reloadLink);

    Label categoryLabel = new Label("category", Model.of(LocationRenderer.getLocationType(current)));
    add(categoryLabel);

    String buildingCode = LocationRenderer.getBuildingCode(current);
    if (buildingCode != null) {
        buildingCode = "Building Code: " + buildingCode;
    }
    Label addressLabel = new Label("buildingCode", Model.of(buildingCode));
    add(addressLabel);

    String popName = LocationRenderer.getPopName(current);
    if (popName != null) {
        popName = "POP Name: " + popName;
    }
    Label popNameLabel = new Label("popName", Model.of(popName));
    add(popNameLabel);
}
 
Example 5
Project: openNaEF   File: LocationViewPage.java   View source code 6 votes vote down vote up
private void createAddLocationLink() {
    Link<Void> link = new Link<Void>("addLocation") {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            LocationAddPage page = new LocationAddPage(LocationViewPage.this, current);
            setResponsePage(page);
        }
    };
    if (LocationUtil.isTrash(current)) {
        link.setEnabled(false);
        link.setVisible(false);
    }

    LocationType type = LocationType.getByCaption(LocationRenderer.getLocationType(current));
    if (LocationType.RACK.equals(type)) {
        link.add(new Label("label", ""));
    } else {
        link.add(new Label("label", "Add child location"));
    }
    add(link);
}
 
Example 6
Project: openNaEF   File: LocationViewPage.java   View source code 6 votes vote down vote up
private void createEditLocationLink() {
    Link<Void> link = new Link<Void>("editLocation") {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            LocationEditPage page = new LocationEditPage(LocationViewPage.this, current);
            setResponsePage(page);
        }
    };
    if (!LocationUtil.isEditable(current)) {
        link.setEnabled(false);
        link.setVisible(false);
    }
    add(link);
}
 
Example 7
Project: openNaEF   File: LocationViewPage.java   View source code 6 votes vote down vote up
private void createDeleteLocationLink() {
    Link<Void> link = new Link<Void>("deleteLocation") {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            LocationDeletePage page = new LocationDeletePage(LocationViewPage.this, current);
            setResponsePage(page);
        }
    };
    if (!LocationUtil.isEditable(current)) {
        link.setEnabled(false);
        link.setVisible(false);
    }
    add(link);
}
 
Example 8
Project: openNaEF   File: LocationViewPage.java   View source code 6 votes vote down vote up
private void createAddNodeLink() {
    final WebPage page;
    if (LocationUtil.isNodeAssignable(current)) {
        page = new NodeEditPage(LocationViewPage.this, null, current);
    } else {
        page = null;
    }
    Link<Void> link = new Link<Void>("addNode") {
        private static final long serialVersionUID = 1L;

        @Override
        public void onClick() {
            setResponsePage(page);
        }
    };
    boolean editable = LocationUtil.isNodeAssignable(current);
    link.setEnabled(editable);
    link.setVisible(editable);
    add(link);
}
 
Example 9
Project: openNaEF   File: VportEditPage.java   View source code 6 votes vote down vote up
public VportEditPage(final WebPage backPage) {
    try {
        AAAWebUtil.checkAAA(this, OPERATION_NAME);
        this.backPage = backPage;

        Link<Void> backLink = new Link<Void>("back") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onClick() {
                setResponsePage(getBackPage());
            }
        };
        add(backLink);
    } catch (Exception e) {
        throw ExceptionUtils.throwAsRuntime(e);
    }
}
 
Example 10
Project: openNaEF   File: NodePageUtil.java   View source code 6 votes vote down vote up
public static Link<Void> createNodeLink(final String id, final PortDto port) {
    final PageParameters param;
    final String nodeName;
    if (port != null) {
        param = NodeUtil.getParameters(port.getNode());
        nodeName = port.getNode().getName();
    } else {
        param = null;
        nodeName = null;
    }
    BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>(id, SimpleNodeDetailPage.class, param);
    link.setEnabled(port != null);
    Label label = new Label("nodeName", nodeName);
    link.add(label);
    return link;
}
 
Example 11
Project: GeoCrawler   File: CrawlsPage.java   View source code 6 votes vote down vote up
private void populateCrawlRow(Item<Crawl> item) {
  item.add(new AjaxLink<Crawl>("edit", item.getModel()) {
    @Override
    public void onClick(AjaxRequestTarget target) {
      editCrawl(target, getModel());
    }
  }.add(new Label("crawlName")));
  item.add(new Label("seedList.name"));

  item.add(new Label("progress"));
  item.add(createStatusLabel());
  item.add(new Link<Crawl>("start", item.getModel()) {
    @Override
    public void onClick() {
      crawlService.startCrawl(getModelObject().getId(), getCurrentInstance());
    }
  });

  item.add(new Link<Crawl>("delete", item.getModel()) {
    @Override
    public void onClick() {
      crawlService.deleteCrawl(getModelObject().getId());
    }
  });
}
 
Example 12
Project: vlo-curation   File: FacetValuesPanel.java   View source code 6 votes vote down vote up
/**
 * Adds an individual facet value selection link to a dataview item
 *
 * @param item item to add link to
 */
private void addFacetValue(String id, final ListItem<Count> item) {
    item.setDefaultModel(new CompoundPropertyModel<>(item.getModel()));

    // link to select an individual facet value
    final Link selectLink = new IndicatingAjaxFallbackLink(id) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            // reset filter
            ((NameAndCountFieldValuesFilter) filterModel.getObject()).setName(null);

            // call callback
            onValuesSelected(
                    // for now only single values can be selected
                    Collections.singleton(item.getModelObject().getName()),
                    target);
        }
    };
    item.add(selectLink);

    // 'name' field from Count (name of value)
    selectLink.add(new FieldValueLabel("name", fieldNameModel));
    // 'count' field from Count (document count for value)
    selectLink.add(new Label("count"));
}
 
Example 13
Project: vlo-curation   File: FacetValuesPanel.java   View source code 6 votes vote down vote up
/**
 * Creates a link that leads to the 'all facet values' view, either as a
 * modal window (if JavaScript is enabled, see {@link #createAllValuesWindow(java.lang.String)
 * }) or by redirecting to {@link AllFacetValuesPage}
 *
 * @param id component id
 * @return 'show all values' link
 */
private Link createAllValuesLink(String id) {
    final Link link = new IndicatingAjaxFallbackLink<FacetField>(id, getModel()) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            if (target == null) {
                // no JavaScript, open a new page with values
                setResponsePage(new AllFacetValuesPage(getModel(), selectionModel));
            } else {
                // JavaScript enabled, show values in a modal popup
                valuesWindow.show(target);
            }
        }

        @Override
        protected void onConfigure() {
            super.onConfigure();
            // only show if there actually are more values!
            setVisible(getModelObject().getValueCount() > MAX_NUMBER_OF_FACETS_TO_SHOW);
        }

    };
    return link;
}
 
Example 14
Project: vlo-curation   File: FieldsTablePanel.java   View source code 6 votes vote down vote up
private Link createFacetSelectLink(String id, final IModel<String> facetNameModel, final IModel valueModel) {
    return new Link(id) {

        @Override
        public void onClick() {
            final FacetSelection facetSelection = new FacetSelection(Collections.singleton(valueModel.getObject().toString()));
            final QueryFacetsSelection selection = new QueryFacetsSelection(Collections.singletonMap(facetNameModel.getObject(), facetSelection));
            setResponsePage(FacetedSearchPage.class, paramsConverter.toParameters(selection));
        }

        @Override
        protected void onConfigure() {
            super.onConfigure();
            // only show for facet fields
            setVisible(isShowFacetSelectLinks()
                    && vloConfig.getFacetsInSearch().contains(facetNameModel.getObject()));
        }

    };
}
 
Example 15
Project: vlo-curation   File: AjaxFallbackLinkLabel.java   View source code 6 votes vote down vote up
public AjaxFallbackLinkLabel(String id, IModel<T> linkModel, IModel<?> contentModel, boolean indicator) {
    super(id);
    final Link link;
    if (indicator) {
        link = new IndicatingAjaxFallbackLink<T>("link", linkModel) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                AjaxFallbackLinkLabel.this.onClick(target);
            }
        };
    } else {
        link = new AjaxFallbackLink<T>("link", linkModel) {

            @Override
            public void onClick(AjaxRequestTarget target) {
                AjaxFallbackLinkLabel.this.onClick(target);
            }
        };
    }
    add(link);

    link.add(new Label("content", contentModel));
}
 
Example 16
Project: singular-server   File: DiffLink.java   View source code 6 votes vote down vote up
public DiffLink(String id, IModel<String> labelModel, ActionContext context) {
    super(id);
    Link<String> link = new Link<String>("diffLink") {
        @Override
        protected void onConfigure() {
            super.onConfigure();
            Optional<Long> requirementId = context.getRequirementId();
            if(requirementId.isPresent()){
                this.add($b.attr("target", String.format("diff%s", requirementId.get())));
                this.add($b.attr("href", DispatcherPageUtil.buildFullURL(context)));
                this.setBody(labelModel);
            }
        }

        @Override
        public void onClick() {
        }
    };
    this.add(link);
}
 
Example 17
Project: singular-server   File: NewRequirementLink.java   View source code 6 votes vote down vote up
private Link<String> buildLink(String id, IModel<String> labelModel, RequirementData requirement) {
    Link botao = new Link(id) {
        @Override
        protected void onConfigure() {
            super.onConfigure();
            this.add($b.attr("href", NewRequirementLink.this.buildURL(requirement)));
            this.add($b.attr("target", "_blank"));
            this.setBody(labelModel);
        }

        @Override
        public void onClick() {
        }
    };
    return botao;
}
 
Example 18
Project: singular-server   File: ViewVersionLink.java   View source code 6 votes vote down vote up
public ViewVersionLink(String id, IModel<String> labelModel, ActionContext context) {
    super(id);
    this.context = new ActionContext(context);
    this.context.setDiffEnabled(false);
    this.context.setFormAction(FormAction.FORM_ANALYSIS_VIEW);
    Link<String> link = new Link<String>("oldVersionLink") {
        @Override
        protected void onConfigure() {
            super.onConfigure();
            
            Optional<Long> formVersionId = ViewVersionLink.this.context.getFormVersionId();
            if (formVersionId.isPresent()) {
                this.add($b.attr("target", String.format("version%s", formVersionId.get())));
                this.add($b.attr("href", DispatcherPageUtil.buildFullURL(ViewVersionLink.this.context)));
                this.setBody(labelModel);
            }
        }

        @Override
        public void onClick() {
        }
    };
    this.add(link);
}
 
Example 19
Project: Intercloud   File: LinkResponsePanel.java   View source code 6 votes vote down vote up
public LinkResponsePanel(String id, IModel<LinkModel> linkModel) {
    super(id, linkModel);

    LinkModel link = linkModel.getObject();
    this.add(new Link("target") {
        @Override
        public void onClick() {
            try {
                XmppURI uri = new XmppURI(link.getTarget());
                setResponsePage(new BrowserPage(Model.of(uri)));
            } catch (URISyntaxException e) {
                logger.error("Failed to redirect.", e);
            }
        }
    }.setBody(Model.of(link.getTarget())));
}
 
Example 20
Project: owsi-core-parent   File: LinkBreadCrumbElementPanel.java   View source code 6 votes vote down vote up
public LinkBreadCrumbElementPanel(String id, BreadCrumbElement breadCrumbElement, BreadCrumbMarkupTagRenderingBehavior renderingBehavior) {
	super(id, breadCrumbElement.getLabelModel());
	
	Link<Void> breadCrumbLink = new BookmarkablePageLink<Void>("breadCrumbElementLink", breadCrumbElement.getPageClass(),
			breadCrumbElement.getPageParameters()) {
		private static final long serialVersionUID = 1L;

		@Override
		protected void onConfigure() {
			super.onConfigure();
			
			setVisible(Session.get().getAuthorizationStrategy().isInstantiationAuthorized(getPageClass()));
		}
	};
	breadCrumbLink.setBody(getModel());
	breadCrumbLink.add(renderingBehavior);
	add(breadCrumbLink);
	
	add(
			Condition.componentVisible(breadCrumbLink).thenShowInternal()
	);
}
 
Example 21
Project: relax-dms   File: DocumentWorkflow.java   View source code 6 votes vote down vote up
private void createExportButton(boolean visible) {
    exportLink = new Link("export") {
        @Override
        public void onClick() {

            JsonNode doc = documentService.getDocumentById(docId);
            String filename = doc.get("data").get("Title").asText() + ".pdf";
            final ByteArrayOutputStream baos = documentService.convertToPdf(doc);
            AbstractResourceStreamWriter rstream = new AbstractResourceStreamWriter() {

                @Override
                public void write(OutputStream output) throws IOException {
                    output.write(baos.toByteArray());
                    baos.close();
                    output.close();
                }
            };

            ResourceStreamRequestHandler handler = new ResourceStreamRequestHandler(rstream, filename);        
            getRequestCycle().scheduleRequestHandlerAfterCurrent(handler);
        }
    };
    addComponent(exportLink, visible);
}
 
Example 22
Project: artifactory   File: ArchiveSearchPanel.java   View source code 6 votes vote down vote up
@SuppressWarnings({"unchecked"})
@Override
public void populateItem(final Item cellItem, String componentId, IModel model) {
    final ActionableArchiveSearchResult result =
            (ActionableArchiveSearchResult) cellItem.getParent().getParent().getDefaultModelObject();
    final String relDirPath = result.getSearchResult().getRelDirPath();
    Link linkToTreeView = new Link<String>(componentId, Model.of(relDirPath)) {
        @Override
        public void onComponentTagBody(MarkupStream markupStream, ComponentTag openTag) {
            replaceComponentTagBody(markupStream, openTag, relDirPath);
        }

        @Override
        public void onClick() {
            RequestCycle.get().setResponsePage(new BrowseRepoPage(result.getArchiveRepoPath()));
        }
    };
    linkToTreeView.add(new CssClass("item-link"));
    cellItem.add(linkToTreeView);
}
 
Example 23
Project: superfly   File: SuperflyPagingNavigator.java   View source code 6 votes vote down vote up
private void addLink(final LinkInfo aInfo) {
    String id = aInfo.getId();

    Link<String> link = new Link<String>(id) {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return aInfo.isVisible();
        }

        public void onClick() {
            thePageable.setCurrentPage(aInfo.getPage());
        }
    };
    add(link);

}
 
Example 24
Project: role-engineering-sample   File: AuthZErrorPage.java   View source code 6 votes vote down vote up
/**
 * Constructor
 */
public AuthZErrorPage(PageParameters pageParameters)
{
    String value = pageParameters.get( "errorValue" ).toString();
    add( new Label( "errorValue", value ) );
    final Link actionLink = new Link( "home.link" )
    {
        @Override
        public void onClick()
        {
            setResponsePage( HomePage.class );
        }
    };
    add( actionLink );

}
 
Example 25
Project: u-qasar.platform   File: ProductAddEditPage.java   View source code 6 votes vote down vote up
/**
 * 
 * @return
 */
private Link<ProductManagementPage> newCancelLink() {
	return new Link<ProductManagementPage>("cancel") {
		private static final long serialVersionUID = -310533532532643267L;

		@Override
		public void onClick() {
			setResponsePage(ProductManagementPage.class,
					new PageParameters().set(
							MESSAGE_PARAM,
							new StringResourceModel("canceled.message", this, Model
									.of(product)).getString()).set(LEVEL_PARAM,
											FeedbackMessage.WARNING));
		}
	};
}
 
Example 26
Project: u-qasar.platform   File: InfoPage.java   View source code 6 votes vote down vote up
public ResendRegistrationLinkFragment(
		final MarkupContainer markupProvider, final String email) {
	super("info", "resendRegistrationInfo", markupProvider);

	// add register link
	PageParameters parameters = new PageParameters();
	parameters.add("email", email);
	add(new Link<Void>("resendRegistrationLink") {

		private static final long serialVersionUID = -5958845052833917370L;

		@Override
		public void onClick() {
			resendRegistrationConfirmationEmail(email);
		}

	});
}
 
Example 27
Project: u-qasar.platform   File: AdapterAddEditPage.java   View source code 6 votes vote down vote up
/**
 * 
 * @return
 */
private Link<AdapterManagementPage> newCancelLink() {
	return new Link<AdapterManagementPage>("cancel") {

		/**
		 * 
		 */
		private static final long serialVersionUID = 6433075921789830757L;

		@Override
		public void onClick() {
			// redirect to adapter list page
			setResponsePage(
					AdapterManagementPage.class,
					new PageParameters().set(
							MESSAGE_PARAM,
							new StringResourceModel("canceled.message", this, Model
									.of(adapterSettings)).getString()).set(LEVEL_PARAM,
											FeedbackMessage.WARNING));
		}
	};
}
 
Example 28
Project: u-qasar.platform   File: ProcessAddEditPage.java   View source code 6 votes vote down vote up
/**
 * 
 * @return
 */
private Link<ProcessManagementPage> newCancelLink() {
	return new Link<ProcessManagementPage>("cancel") {

		private static final long serialVersionUID = -3695465420798817598L;

		@Override
		public void onClick() {
			setResponsePage(ProcessManagementPage.class,
					new PageParameters().set(
							MESSAGE_PARAM,
							new StringResourceModel("canceled.message", this, Model
									.of(process)).getString()).set(LEVEL_PARAM,
											FeedbackMessage.WARNING));
		}
	};
}
 
Example 29
Project: AppStash   File: ProductItemPanel.java   View source code 6 votes vote down vote up
private Component productDetailImageLink() {
    Link<Void> detailPageLink = new Link<Void>("productDetailLink") {
        @Override
        public void onClick() {
            PageParameters pageParameters = new PageParameters();
            pageParameters.set("urlname", productUrlModel.getObject());
            setResponsePage(new ProductDetailPage(pageParameters));
        }
    };
    WebMarkupContainer image = new WebMarkupContainer("image");
    image.add(new AttributeModifier("src", new ImageLinkModel(productInfoModel, this)));
    image.add(new AttributeModifier("title", new PropertyModel<String>(productInfoModel, "description")));
    image.add(new AttributeModifier("alt", new PropertyModel<String>(productInfoModel, "name")));
    image.setOutputMarkupId(true);

    detailPageLink.add(image);
    return detailPageLink;
}
 
Example 30
Project: pm-wicket-archetype   File: TemplatePage.java   View source code 6 votes vote down vote up
@Override
protected void onInitialize() {
	super.onInitialize();
	
	add(new DebugBar("debug"));
	add(new BookmarkablePageLink<WebPage>("home", HomePage.class));
	
	add(new Menu("sample", SamplePage.class));
	Menu menu = new Menu("usersMenu");
	menu.add(new Menu("createUsers", CreateUserPage.class));
	menu.add(new Menu("listUsers", ListUsersPage.class));
	add(menu);
	
	// change password
	add(new BookmarkablePageLink<ChangePasswordPage>("user.change-password", ChangePasswordPage.class));
	// logout link
	add(new Link<Void>("user.logout") {

		@Override
		public void onClick() {
			getSession().invalidate();
		}
	});
}
 
Example 31
Project: wicket-spring-jpa-bootstrap-boilerplate   File: AbstractListPage.java   View source code 6 votes vote down vote up
public AbstractListPage() {
	
	add(createPageTitleTag("list.title"));
	add(createPageHeading("list.heading"));
	add(createPageMessage("list.message"));

	columns = new ArrayList<IColumn<T, String>>();
	columns.add(new PropertyColumn<T, String>(new Model<String>("ID"), "id"));
	
	add(new Link<T>("new") {
		private static final long serialVersionUID = 1L;
		@Override
		public void onClick() {
			setEditResponsePage(null);
		}
	});
}
 
Example 32
Project: nocket   File: DefaultLoginStatusBar.java   View source code 6 votes vote down vote up
/**
 * Instantiates a new login status bar.
 *
 * @param id the id
 */
public DefaultLoginStatusBar(String id) {
	super(id);
	final Label userStatus = new Label("loggedin", new AbstractReadOnlyModel<String>() {
		@Override
		public String getObject() {
			final DefaultLoginStatusBar bar = DefaultLoginStatusBar.this;
			return isLoggedIn() ? getLoggedInUserName() : bar.getString("notloggedin");
		}
	});
	add(userStatus);
	final Link<WebPage> actionLink = new Link<WebPage>("actionlink") {
		@Override
		public void onClick() {
			Class<? extends WebPage> resp =	(isLoggedIn() ? doLogout() : getLoginPage());
			if(resp != null)
				setResponsePage(resp);
		}
	};
	final Label loginactionlabel = new MyLabel("loginactionlabel", new ResourceModel("login"), false);
	final Label logoutactionlabel = new MyLabel("logoutactionlabel", new ResourceModel("logout"), true);
	actionLink.add(loginactionlabel);
	actionLink.add(logoutactionlabel);
	add(actionLink);
}
 
Example 33
Project: nocket   File: ActionColumn.java   View source code 6 votes vote down vote up
/**
 * Instantiates a new link panel.
 *
 * @param id the id
 * @param column the column
 * @param rowModel the row model
 */
public LinkPanel(String id, final ActionColumn<T> column, IModel<T> rowModel) {
    super(id);
    Link<T> link = new Link<T>("link", rowModel) {
        @Override
        public void onClick() {
            column.onClick(getModel());
        }

        @Override
        public boolean isEnabled() {
            return column.isEnabled(getModel());
        }

        @Override
        public boolean isVisible() {
            return column.isVisible(getModel());
        }

    };
    add(link);
    link.add(new Label("label", column.getCellLabel(rowModel)));
}
 
Example 34
Project: oodt   File: WorkflowInstanceViewerPage.java   View source code 6 votes vote down vote up
public WorkflowInstanceViewerPage(PageParameters params){
  add(new Link("home_link"){
    /* (non-Javadoc)
    * @see org.apache.wicket.markup.html.link.Link#onClick()
    */
   @Override
   public void onClick() {
     setResponsePage(getApplication().getHomePage());
   }
});
  
  add(new WorkflowInstancesViewer("instance_viewer", ((WMMonitorApp)getApplication()).getWorkflowUrl(), 
      params.getString("status", "ALL"), params.getInt("pageNum", 1), ((WMMonitorApp)getApplication()).getStatuses(), 
      ((WMMonitorApp)getApplication()).getLifecycleFilePath(), ((WMMonitorApp)getApplication()).getInstMetFieldsFilePath(),
      WorkflowViewerPage.class, WorkflowTaskViewerPage.class, WorkflowInstanceViewerPage.class));
}
 
Example 35
Project: oodt   File: WorkflowsViewerPage.java   View source code 6 votes vote down vote up
public WorkflowsViewerPage() {
  add(new Link("home_link") {
    /*
     * (non-Javadoc)
     * 
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
      setResponsePage(getApplication().getHomePage());
    }
  });

  add(new WorkflowsViewer("workflows_viewer",
      ((WMMonitorApp) getApplication()).getWorkflowUrl(),
      WorkflowViewerPage.class));
}
 
Example 36
Project: oodt   File: WorkflowViewerPage.java   View source code 6 votes vote down vote up
public WorkflowViewerPage(PageParameters params) {
  add(new Link("home_link"){
    /* (non-Javadoc)
    * @see org.apache.wicket.markup.html.link.Link#onClick()
    */
   @Override
   public void onClick() {
     setResponsePage(getApplication().getHomePage());
   }
});
  add(new Link("workflows_viewer_link"){
     /* (non-Javadoc)
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
      setResponsePage(WorkflowsViewerPage.class);
    }
  });
  add(new Label("workflow_id", params.getString("id")));
  add(new WorkflowViewer("workflow_viewer", ((WMMonitorApp) getApplication())
      .getWorkflowUrl(), params.getString("id"), WorkflowTaskViewerPage.class));
}
 
Example 37
Project: oodt   File: WorkflowTaskViewerPage.java   View source code 6 votes vote down vote up
public WorkflowTaskViewerPage(PageParameters params) {
  add(new Link("home_link"){
    /* (non-Javadoc)
    * @see org.apache.wicket.markup.html.link.Link#onClick()
    */
   @Override
   public void onClick() {
     setResponsePage(getApplication().getHomePage());
   }
});    
  add(new Label("task_id", params.getString("id")));
  WorkflowTaskViewer viewerComponent = new WorkflowTaskViewer("task_viewer",
      ((WMMonitorAppBase) getApplication()).getWorkflowUrl(), params
          .getString("id"), WorkflowConditionViewerPage.class);
  add(viewerComponent);
}
 
Example 38
Project: oodt   File: WorkflowViewerPage.java   View source code 6 votes vote down vote up
/**
 * @param parameters
 */
public WorkflowViewerPage(PageParameters parameters) {
  super(parameters);
  add(new WorkflowViewer("workflow_viewer", app.getWmUrlStr(),
      parameters.getString("id"), WorkflowTaskViewerPage.class));
  add(new Link("workflows_viewer_link"){
      /* (non-Javadoc)
       * @see org.apache.wicket.markup.html.link.Link#onClick()
       */
      @Override
      public void onClick() {
        setResponsePage(WorkflowsViewerPage.class);          
      }
  });
  
  add(new Label("workflow_id", parameters.getString("id")));
}
 
Example 39
Project: gitblit   File: LinkPanel.java   View source code 6 votes vote down vote up
public LinkPanel(String wicketId, String bootstrapIcon, String linkCssClass, IModel<String> model,
		Class<? extends WebPage> clazz, PageParameters parameters, boolean newWindow) {
	super(wicketId);
	this.labelModel = model;
	Link<Void> link = null;
	if (parameters == null) {
		link = new BookmarkablePageLink<Void>("link", clazz);
	} else {
		link = new BookmarkablePageLink<Void>("link", clazz, parameters);
	}
	if (newWindow) {
		link.add(new SimpleAttributeModifier("target", "_blank"));
	}
	if (linkCssClass != null) {
		link.add(new SimpleAttributeModifier("class", linkCssClass));
	}
	Label icon = new Label("icon");
	if (StringUtils.isEmpty(bootstrapIcon)) {
		link.add(icon.setVisible(false));
	} else {
		WicketUtils.setCssClass(icon, bootstrapIcon);
		link.add(icon);
	}
	link.add(new Label("label", labelModel).setRenderBodyOnly(true));
	add(link);
}
 
Example 40
Project: projectforge-webapp   File: AdminPage.java   View source code 6 votes vote down vote up
@SuppressWarnings("serial")
protected void addCachesMenu()
{
  // Caches
  final ContentMenuEntryPanel cachesMenu = new ContentMenuEntryPanel(getNewContentMenuChildId(),
      getString("system.admin.group.title.systemChecksAndFunctionality.caches"));
  addContentMenuEntry(cachesMenu);
  // Refresh caches.
  final Link<Void> refreshCachesLink = new Link<Void>(ContentMenuEntryPanel.LINK_ID) {
    @Override
    public void onClick()
    {
      refreshCaches();
    }
  };
  final ContentMenuEntryPanel refreshCachesLinkMenuItem = new ContentMenuEntryPanel(cachesMenu.newSubMenuChildId(), refreshCachesLink,
      getString("system.admin.button.refreshCaches")).setTooltip(getString("system.admin.button.refreshCaches.tooltip"));
  cachesMenu.addSubMenuEntry(refreshCachesLinkMenuItem);
}