當前位置: 首頁>>代碼示例>>Java>>正文


Java Link.setVisible方法代碼示例

本文整理匯總了Java中org.apache.wicket.markup.html.link.Link.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.setVisible方法的具體用法?Java Link.setVisible怎麽用?Java Link.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.wicket.markup.html.link.Link的用法示例。


在下文中一共展示了Link.setVisible方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createAddLocationLink

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
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);
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:24,代碼來源:LocationViewPage.java

示例2: createEditLocationLink

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
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);
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:17,代碼來源:LocationViewPage.java

示例3: createDeleteLocationLink

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
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);
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:17,代碼來源:LocationViewPage.java

示例4: createAddNodeLink

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
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);
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:21,代碼來源:LocationViewPage.java

示例5: TreeIconsActionPanel

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
/**
 * Without click support (neither for selection nor for editing).
 * @param id component id
 * @param model model for contact
 * @param label The label to show (additional to the row_pointer.png). The id of the label should be LABEL_ID.
 */
public TreeIconsActionPanel(final String id, final IModel< ? > model, final Label label, final TreeTable< ? > treeTable)
{
  super(id, model);
  this.treeTable = treeTable;
  final Link<Void> selectLink = new Link<Void>("select") {
    @Override
    public void onClick()
    {
      // Do nothing
    };
  };
  selectLink.setVisible(false);
  this.link = selectLink;
  add(selectLink);
  add(label);
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:23,代碼來源:TreeIconsActionPanel.java

示例6: onRenderPosition

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
@SuppressWarnings("serial")
@Override
protected void onRenderPosition(final WebMarkupContainer item, final RechnungsPositionDO position)
{
  // item.add(new AuftragsPositionFormComponent("orderPosition", new PropertyModel<AuftragsPositionDO>(position, "auftragsPosition"),
  // false));

  final Link<String> orderLink = new Link<String>("orderLink") {
    @Override
    public void onClick()
    {
      if (position.getAuftragsPosition() != null) {
        final PageParameters parameters = new PageParameters();
        parameters.add(AbstractEditPage.PARAMETER_KEY_ID, position.getAuftragsPosition().getAuftrag().getId());
        final AuftragEditPage auftragEditPage = new AuftragEditPage(parameters);
        auftragEditPage.setReturnToPage(getParentPage());
        setResponsePage(auftragEditPage);
      }
    }
  };
  item.add(orderLink);
  if (position.getAuftragsPosition() == null) {
    orderLink.setVisible(false);
  }
  orderLink.add(new PresizedImage("linkImage", WebConstants.IMAGE_FIND));
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:27,代碼來源:RechnungEditForm.java

示例7: HRListEntryPanel

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
public HRListEntryPanel(final String id, final HRFilter filter, final BigDecimal plannedDays, final BigDecimal actualDays,
    final Link< ? > link)
{
  super(id);
  final BigDecimal planned = filter.isShowPlanning() == true ? plannedDays : null;
  final BigDecimal actual = filter.isShowBookedTimesheets() == true ? actualDays : null;
  final Label plannedDaysLabel = new Label("plannedDays", NumberFormatter.format(planned, 2));
  add(plannedDaysLabel.setRenderBodyOnly(true));
  if (NumberHelper.isNotZero(plannedDays) == false) {
    plannedDaysLabel.setVisible(false);
  }
  add(link);
  final Label actualDaysLabel = new Label("actualDays", "(" + NumberFormatter.format(actual, 2) + ")");
  link.add(actualDaysLabel.setRenderBodyOnly(true));
  if (NumberHelper.isNotZero(actualDays) == false) {
    link.setVisible(false);
  }
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:19,代碼來源:HRListEntryPanel.java

示例8: onBeforeRender

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
protected void onBeforeRender() {
	super.onBeforeRender();

	Link firstLink = (Link) get("first");
	firstLink.setVisible(pageable.getPageCount() > 2
			&& pageable.getCurrentPage() > 0);

	Link prevLink = (Link) get("prev");
	prevLink.setVisible(pageable.getCurrentPage() > 0);

	Link nextLink = (Link) get("next");
	nextLink
			.setVisible(pageable.getCurrentPage() < pageable.getPageCount() - 1);

	Link lastLink = (Link) get("last");
	lastLink.setVisible(pageable.getPageCount() > 2
			&& pageable.getCurrentPage() < pageable.getPageCount() - 1);
}
 
開發者ID:BassJel,項目名稱:Jouve-Project,代碼行數:19,代碼來源:AutoHidePagingNavigator.java

示例9: TransactionExecutionResultPage

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
public TransactionExecutionResultPage(final CustomTransaction transaction) {
    try {
        AAAWebUtil.checkAAA(this, OPERATION_NAME);
        add(UrlUtil.getTopLink("top"));
        Label titleLabel = new Label("title", transaction.getTitle());
        add(titleLabel);
        Label headLabel = new Label("head", transaction.getHead());
        add(headLabel);

        final String msg;
        final WebPage nextPage;
        if (transaction.isSuccess()) {
            msg = transaction.getSuccessResultMessage();
            nextPage = transaction.getForwardPage();
        } else {
            msg = transaction.getFailResultMessage();
            nextPage = transaction.getBackPage();
        }
        Label messageLabel = new Label("resultMessage", msg);
        add(messageLabel);
        Link<Void> backLink = new Link<Void>("back") {
            private static final long serialVersionUID = 1L;

            public void onClick() {
                setResponsePage(nextPage);
            }
        };
        backLink.setEnabled(nextPage != null);
        backLink.setVisible(nextPage != null);
        add(backLink);
    } catch (Exception e) {
        throw ExceptionUtils.throwAsRuntime(e);
    }
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:35,代碼來源:TransactionExecutionResultPage.java

示例10: LinkEditPage

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
public LinkEditPage(WebPage backPage, PortDto basePort) {
    try {
        this.editorName = AAAWebUtil.checkAAA(this, OPERATION_NAME);
        if (backPage == null) {
            throw new IllegalArgumentException();
        }
        this.backPage = backPage;
        if (basePort == null) {
            throw new IllegalArgumentException();
        }
        basePort.renew();
        this.basePort = basePort;
        this.l2Neighbor = NodeUtil.getLayer2Neighbor(basePort);
        this.model = new NeighborModel(basePort);

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

            @Override
            public void onClick() {
                setResponsePage(getBackPage());
            }
        };
        add(backLink);
        add(new FeedbackPanel("feedback"));

        Label baseLabel = new Label("baseName", new PropertyModel<String>(this.model, "baseName"));
        add(baseLabel);
        Label nodeLabel1 = new Label("node", new PropertyModel<String>(this.model, "hereNodeName"));
        add(nodeLabel1);
        Label ifNameLabel1 = new Label("ifName", new PropertyModel<String>(this.model, "hereIfName"));
        add(ifNameLabel1);
        BookmarkablePageLink<Void> neighborLink =
                new BookmarkablePageLink<Void>("neighborNode",
                        SimpleNodeDetailPage.class,
                        NodeUtil.getNodeParameters(this.model.getThere()));
        add(neighborLink);
        Label nodeLabel2 = new Label("nodeName", new PropertyModel<String>(this.model, "thereNodeName"));
        neighborLink.add(nodeLabel2);
        Label ifNameLabel2 = new Label("neighborIfName", new PropertyModel<String>(this.model, "thereIfName"));
        add(ifNameLabel2);

        linkL2Node = createLink("layer2NeighborNode", l2Neighbor);
        add(linkL2Node);
        Label linkL2Label = new Label("layer2NeighborIfName", new PropertyModel<String>(this, "l2NeighborIfName"));
        add(linkL2Label);
        Link<Void> editLayer2 = createEditor("createLink", basePort, l2Neighbor);
        editLayer2.setEnabled(l2Neighbor == null);
        editLayer2.setVisible(l2Neighbor == null);
        add(editLayer2);
        Link<Void> deleteLayer2 = createDeleteButton("deleteLink", false, basePort);
        deleteLayer2.setEnabled(l2Neighbor != null);
        deleteLayer2.setVisible(l2Neighbor != null);
        add(deleteLayer2);

    } catch (Exception e) {
        throw ExceptionUtils.throwAsRuntime(e);
    }
}
 
開發者ID:openNaEF,項目名稱:openNaEF,代碼行數:60,代碼來源:LinkEditPage.java

示例11: downloadHtopTable

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
private void downloadHtopTable(Item<UIUserForList> item, final UIUserForList user) {
    Link<Void> downloadHotpTableLink = new Link<Void>("download-hotp-table") {
        @Override
        public void onClick() {
            ByteArrayOutputStream os = new ByteArrayOutputStream();
            try {
                hotpProvider.outputSequenceForDownload(user.getUsername(), os);
            } catch (IOException e) {
                throw new IllegalStateException(e);
            }
            final byte[] bytes = os.toByteArray();
            IResourceStream resourceStream = new AbstractResourceStream() {
                @Override
                public Time lastModifiedTime() {
                    return Time.now();
                }

                @Override
                public Bytes length() {
                    return Bytes.bytes(bytes.length);
                }

                @Override
                public InputStream getInputStream() throws ResourceStreamNotFoundException {
                    return new ByteArrayInputStream(bytes);
                }

                @Override
                public String getContentType() {
                    return "application/vnd.ms-excel";
                }

                @Override
                public void close() throws IOException {
                }
            };
            getRequestCycle().replaceAllRequestHandlers(new ResourceStreamRequestHandler(resourceStream,
                    hotpProvider.getSequenceForDownloadFileName(user.getUsername())));
        }
    };
    downloadHotpTableLink.setVisible(hotpProvider.outputsSequenceForDownload());
    item.add(downloadHotpTableLink);
}
 
開發者ID:payneteasy,項目名稱:superfly,代碼行數:44,代碼來源:ListUsersPage.java

示例12: VisibilityAndSortToggler

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
/**
 * @param id
 */
public VisibilityAndSortToggler(String id, String showLinkId,
    String hideLinkId, String sortLinkId, String unsortLinkId, String moreId,
    final ListModel model) {
  super(id, showLinkId, hideLinkId, moreId, model);

  Link<Link> sortLink;
  Link<Link> unsortLink = null;

  sortLink = new Link<Link>(sortLinkId, new Model<Link>(null)) {
    /*
     * (non-Javadoc)
     * 
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
      Vector obj = (Vector) model.getObject();
      sortByStatus(obj);
      model.setObject(obj);
      getModelObject().setVisible(true);
      setVisible(false);
    }
  };

  unsortLink = new Link<Link>(unsortLinkId, new Model<Link>(sortLink)) {
    /*
     * (non-Javadoc)
     * 
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
      Vector obj = (Vector) model.getObject();
      sortByName(obj);
      model.setObject(obj);
      getModelObject().setVisible(true);
      setVisible(false);
    }
  };

  unsortLink.setVisible(false);
  sortLink.setModelObject(unsortLink);
  unsortLink.setModelObject(sortLink);

  add(sortLink);
  add(unsortLink);

}
 
開發者ID:apache,項目名稱:oodt,代碼行數:52,代碼來源:VisibilityAndSortToggler.java

示例13: VisibilityToggler

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
/**
 * @param id
 */
public VisibilityToggler(String id, String showLinkId, String hideLinkId,
    String moreId, final ListModel model) {
  super(id, model);

  Link<Link> showLink;
  Link<Link> hideLink = null;
  final Vector allStatusList = (Vector) ((Vector) model.getObject()).clone();

  // subset the model
  model.setObject(subsetModelObject(model.getObject()));
  final WebMarkupContainer moreComponent = new WebMarkupContainer(moreId);
  add(moreComponent);

  showLink = new Link<Link>(showLinkId, new Model<Link>(null)) {
    /*
     * (non-Javadoc)
     * 
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
      Vector obj = (Vector) model.getObject();
      obj.clear();
      obj.addAll(allStatusList);
      model.setObject(obj);
      moreComponent.setVisible(false);
      getModelObject().setVisible(true);
      setVisible(false);
    }
  };

  hideLink = new Link<Link>(hideLinkId, new Model<Link>(showLink)) {
    /*
     * (non-Javadoc)
     * 
     * @see org.apache.wicket.markup.html.link.Link#onClick()
     */
    @Override
    public void onClick() {
      Vector obj = (Vector) model.getObject();
      obj.clear();
      obj.addAll(getTopN(allStatusList, 3));
      model.setObject(obj);
      getModelObject().setVisible(true);
      setVisible(false);
      moreComponent.setVisible(true);
    }
  };

  hideLink.setVisible(false);
  showLink.setModelObject(hideLink);
  hideLink.setModelObject(showLink);

  add(showLink);
  add(hideLink);
}
 
開發者ID:apache,項目名稱:oodt,代碼行數:60,代碼來源:VisibilityToggler.java

示例14: AddressListPhoneNumberPanel

import org.apache.wicket.markup.html.link.Link; //導入方法依賴的package包/類
@SuppressWarnings("serial")
public AddressListPhoneNumberPanel(final String id, final AddressListPage parentPage, final Integer addressId, final PhoneType phoneType,
    final String phoneNumber, final boolean favoriteNumber, final boolean sendSms, final IconType icon, final boolean first)
{
  super(id);
  final WebMarkupContainer linkOrSpan;
  if (parentPage.phoneCallSupported == true) {
    linkOrSpan = new Link<String>("directCallLink") {
      @Override
      public void onClick()
      {
        final PageParameters params = new PageParameters();
        params.add(PhoneCallPage.PARAMETER_KEY_ADDRESS_ID, addressId);
        params.add(PhoneCallPage.PARAMETER_KEY_NUMBER, phoneNumber);
        setResponsePage(new PhoneCallPage(params));
      }
    };
    add(WicketUtils.getInvisibleComponent("phoneNumber"));
  } else {
    linkOrSpan = new WebMarkupContainer("phoneNumber");
    add(WicketUtils.getInvisibleComponent("directCallLink"));
  }
  linkOrSpan.add(AttributeModifier.replace("onmouseover", "zoom('" + phoneNumber + "'); return false;"));
  final String tooltip = parentPage.getString(phoneType.getI18nKey());
  add(linkOrSpan);
  WicketUtils.addTooltip(linkOrSpan, tooltip);
  final Label numberLabel = new Label("number", phoneNumber);
  if (favoriteNumber == true) {
    numberLabel.add(AttributeModifier.replace("style", "color:red; font-weight:bold;"));
  } else {
    numberLabel.setRenderBodyOnly(true);
  }
  linkOrSpan.add(numberLabel);
  linkOrSpan.add(new IconPanel("phoneImage", icon));
  final Link<String> sendMessage = new Link<String>("sendMessageLink") {
    @Override
    public void onClick()
    {
      final PageParameters params = new PageParameters();
      params.add(SendSmsPage.PARAMETER_KEY_ADDRESS_ID, addressId);
      params.add(SendSmsPage.PARAMETER_KEY_PHONE_TYPE, phoneType.toString());
      setResponsePage(SendSmsPage.class, params);
    }
  };
  if (sendSms == false || parentPage.messagingSupported == false) {
    sendMessage.setVisible(false);
  }
  add(sendMessage);
}
 
開發者ID:micromata,項目名稱:projectforge-webapp,代碼行數:50,代碼來源:AddressListPhoneNumberPanel.java


注:本文中的org.apache.wicket.markup.html.link.Link.setVisible方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。