当前位置: 首页>>代码示例>>Java>>正文


Java Anchor.setStyleName方法代码示例

本文整理汇总了Java中com.google.gwt.user.client.ui.Anchor.setStyleName方法的典型用法代码示例。如果您正苦于以下问题:Java Anchor.setStyleName方法的具体用法?Java Anchor.setStyleName怎么用?Java Anchor.setStyleName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.google.gwt.user.client.ui.Anchor的用法示例。


在下文中一共展示了Anchor.setStyleName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: UniTimeDialogBox

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public UniTimeDialogBox(boolean autoHide, boolean modal) {
      super(autoHide, modal);
      
setAnimationEnabled(true);
setGlassEnabled(true);
	
      iContainer = new FlowPanel();
      iContainer.addStyleName("dialogContainer");
      
      iClose = new Anchor();
  	iClose.setTitle(MESSAGES.hintCloseDialog());
      iClose.setStyleName("close");
      iClose.addClickHandler(new ClickHandler() {
      	@Override
          public void onClick(ClickEvent event) {
              onCloseClick(event);
          }
      });
      iClose.setVisible(autoHide);

      iControls = new FlowPanel();
      iControls.setStyleName("dialogControls");        
      iControls.add(iClose);
  }
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:25,代码来源:UniTimeDialogBox.java

示例2: appendChilds

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
	for (int i = 0; i < children.size(); ++i) {
		nextEntityName = children.get(i).isString().stringValue();
		Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
		a.setWidth("100%");
		a.setStyleName("font");
		a.addClickHandler(new ClickHandler() {
			String name = nextEntityName;
			@Override
			public void onClick(ClickEvent event) {
				module.setSelectedEntity(name);
			}
		});
		HorizontalPanel cPanel = new HorizontalPanel();
		cPanel.setStyleName("tree");
		cPanel.setWidth("100%");
		cPanel.add(a);
		TreeWidget c = new TreeWidget(cPanel);
		rootEnt.addChild(c);
		if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
	}
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:23,代码来源:EntitiesListBox.java

示例3: generateTree

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void generateTree(TreeWidget c, JSONValue entity) {
	nextEntityName = entity.isObject().get("entity").isString().stringValue();
	Anchor a = new Anchor(nextEntityName);
	a.setWidth("100%");
	a.setStyleName("font");
	a.addClickHandler(new ClickHandler() {
		String name = nextEntityName;
		@Override
		public void onClick(ClickEvent event) {
			setSelectedEntity(name);
		}
	});
	HorizontalPanel cPanel = new HorizontalPanel();
	cPanel.setStyleName("tree");
	cPanel.setWidth("100%");
	cPanel.add(a);
	TreeWidget cc = new TreeWidget(cPanel);
	c.addChild(cc);
	results.put(nextEntityName, entity.isObject().get("results").isArray());
	entities.add(nextEntityName);
	for (int i = 0; i < entity.isObject().get("children").isArray().size(); ++i) {
		generateTree(cc, entity.isObject().get("children").isArray().get(i));
	}
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:25,代码来源:RiskAnalysisResults.java

示例4: appendChilds

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private void appendChilds(TreeWidget rootEnt, JSONArray children) {
	for (int i = 0; i < children.size(); ++i) {
		nextEntityName = children.get(i).isString().stringValue();
		Anchor a = new Anchor(nextEntityName + " (" + entities.get(nextEntityName).getLeft() + ")");
		a.setWidth("100%");
		a.setStyleName("font");
		a.addClickHandler(new ClickHandler() {
			String name = nextEntityName;
			@Override
			public void onClick(ClickEvent event) {
				setSelectedEntity(name);
			}
		});
		HorizontalPanel cPanel = new HorizontalPanel();
		cPanel.setStyleName("tree");
		cPanel.setWidth("100%");
		cPanel.add(a);
		TreeWidget c = new TreeWidget(cPanel);
		rootEnt.addChild(c);
		if (children.size() > 0) appendChilds(c, entities.get(nextEntityName).getRight());
	}
}
 
开发者ID:RISCOSS,项目名称:riscoss-corporate,代码行数:23,代码来源:RiskAnalysisWizard.java

示例5: setValue

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * @see com.google.gwt.user.client.ui.HasValue#setValue(java.lang.Object, boolean)
 *
 *      <div class="sitwatch-event">
 *        <div class="icon icon-severity-critical"></div>
 *        <a class="title" href="#">Rate Limit Exceeded</a>
 *        <span class="timestamp">9:16 AM</span>
 *        <span class="subject">{urn:namespace}ImportantService|VeryImportantOperation</span>
 *      </div>
 */
@Override
public void setValue(SituationEventBean value, boolean fireEvents) {
    clear();
    FlowPanel icon = new FlowPanel();
    icon.setStyleName("icon"); //$NON-NLS-1$
    icon.addStyleName("icon-severity-" + value.getSeverity()); //$NON-NLS-1$
    Anchor type = toDetailsPageLinkFactory.get("id", value.getSituationId()); //$NON-NLS-1$
    type.setText(value.getType());
    type.setStyleName("title"); //$NON-NLS-1$
    InlineLabel timestamp = new InlineLabel(ClientMessages.getTimeFormat().format(value.getTimestamp()));
    timestamp.setStyleName("timestamp"); //$NON-NLS-1$
    InlineLabel subject = new InlineLabel(value.getSubject());
    subject.setStyleName("subject"); //$NON-NLS-1$

    add(icon);
    add(type);
    add(timestamp);
    add(subject);
}
 
开发者ID:Governance,项目名称:rtgov-ui,代码行数:30,代码来源:SituationWatcherEvent.java

示例6: TractionDialogBox

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public TractionDialogBox(boolean autoHide, boolean modal, boolean showCloseIcon) {
super(autoHide, modal, new TractionCaption());

container = new SimplePanel();
container.addStyleName("dialogContainer");

close = new Anchor();
close.setStyleName("x");
close.addClickHandler(new ClickHandler() {
           @Override
           public void onClick(ClickEvent event) {
               onCloseClick(event);
           }
});
setCloseIconVisible(showCloseIcon);

controls = new FlowPanel();
controls.setStyleName("dialogControls");
controls.add(close);

// add the controls to the end of the caption
TractionCaption caption = (TractionCaption) getCaption();
caption.add(controls);
   }
 
开发者ID:tractionsoftware,项目名称:gwt-traction,代码行数:25,代码来源:TractionDialogBox.java

示例7: InstructorCell

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
public InstructorCell(ArrayList<String> names, ArrayList<String> emails, String separator) {
	super(null, separator);
	if (names != null && !names.isEmpty()) {
		separator = separator.replace(" ", "&nbsp;");
		for (int i = 0; i < names.size(); i++) {
			String text = names.get(i) + (i + 1 < names.size() ? separator : "");
			String email = (emails != null && i < emails.size() ? emails.get(i) : null);
			if (email != null && !email.isEmpty()) {
				iText += text;
				HorizontalPanel p = new HorizontalPanel();
				p.setStyleName("instructor");
				Anchor a = new Anchor();
				a.setHref("mailto:" + email);
				a.setHTML(new Image(RESOURCES.email()).getElement().getString());
				a.setTitle(MESSAGES.sendEmail(names.get(i)));
				a.setStyleName("unitime-SimpleLink");
				a.addClickHandler(new ClickHandler() {
					public void onClick(ClickEvent event) {
						event.stopPropagation();
					}
				});
				p.add(a);
				p.setCellVerticalAlignment(a, HasVerticalAlignment.ALIGN_MIDDLE);
				HTML h = new HTML(text, false);
				h.getElement().getStyle().setMarginLeft(2, Unit.PX);
				p.add(h);
				iPanel.add(p);
				iContent.add(h);
			} else
				add(text);
		}
	} else {
		add("&nbsp;");
	}
}
 
开发者ID:Jenner4S,项目名称:unitimes,代码行数:36,代码来源:WebTable.java

示例8: refreshProposedQueryRow

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * Refresh proposed query row
 *
 * @param propose
 */
private void refreshProposedQueryRow(final GWTProposedQueryReceived propose, int row) {
	boolean seen = (propose.getSeenDate() == null);
	// Sets folder object
	data.put(new Integer(dataTable.getHTML(row, 5)), propose);

	if (propose.isAccepted()) {
		dataTable.setWidget(row, 0, new Image(OKMBundleResources.INSTANCE.yes()));
	} else {
		dataTable.setHTML(row, 0, "");
	}

	dataTable.setHTML(row, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
	String queryType = "";

	if (!propose.getParams().isDashboard()) {
		queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.query");
	} else {
		queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.user.query");
	}

	dataTable.setHTML(row, 2, UtilComunicator.getTextAsBoldHTML(queryType, seen));
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
	dataTable.setHTML(row, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
	Anchor anchor = new Anchor();
	String queryName = propose.getParams().getQueryName();
	anchor.setHTML(UtilComunicator.getTextAsBoldHTML(queryName, seen));
	anchor.setTitle(queryName);
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.SEARCH);
			SearchComunicator.setSavedSearch(propose.getParams());
		}
	});

	anchor.setStyleName("okm-KeyMap-ImageHover");
	dataTable.setWidget(row, 4, anchor);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:44,代码来源:ExtendedScrollTable.java

示例9: populateBottomMenu

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
private static void populateBottomMenu(RootPanel btmmenu, HostPageData hpd) {
  String vs = hpd.version;
  if (vs == null || vs.isEmpty()) {
    vs = "dev";
  }

  btmmenu.add(new InlineHTML(M.poweredBy(vs)));

  if (info().gerrit().webUis().contains(UiType.POLYGERRIT)) {
    btmmenu.add(new InlineLabel(" | "));
    uiSwitcherLink = new Anchor(C.newUi(), getUiSwitcherUrl(History.getToken()));
    uiSwitcherLink.setStyleName("");
    btmmenu.add(uiSwitcherLink);
  }

  String reportBugUrl = info().gerrit().reportBugUrl();
  if (reportBugUrl != null) {
    String reportBugText = info().gerrit().reportBugText();
    Anchor a = new Anchor(reportBugText == null ? C.reportBug() : reportBugText, reportBugUrl);
    a.setTarget("_blank");
    a.setStyleName("");
    btmmenu.add(new InlineLabel(" | "));
    btmmenu.add(a);
  }
  btmmenu.add(new InlineLabel(" | "));
  btmmenu.add(new InlineLabel(C.keyHelp()));
}
 
开发者ID:gerrit-review,项目名称:gerrit,代码行数:28,代码来源:Gerrit.java

示例10: addDocument

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * addDocument
 */
public static void addDocument(FlexTable table, final GWTStaple staple, final String uuid, boolean enableDelete) {
	int row = table.getRowCount();
	final GWTDocument doc = staple.getDoc();

	if (doc.isCheckedOut()) {
		table.setHTML(row, 0, Util.imageItemHTML("img/icon/edit.png"));
	} else if (doc.isLocked()) {
		table.setHTML(row, 0, Util.imageItemHTML("img/icon/lock.gif"));
	} else {
		table.setHTML(row, 0, "&nbsp;");
	}

	// Subscribed is a special case, must add icon with others
	if (doc.isSubscribed()) {
		table.setHTML(row, 0, table.getHTML(row, 0) + Util.imageItemHTML("img/icon/subscribed.gif"));
	}

	if (doc.isHasNotes()) {
		table.setHTML(row, 0, table.getHTML(row, 0) + Util.imageItemHTML("img/icon/note.gif"));
	}

	table.setHTML(row, 1, Util.mimeImageHTML(doc.getMimeType()));
	Anchor anchor = new Anchor();
	anchor.setHTML(doc.getName());
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			String docPath = doc.getPath();
			String path = docPath.substring(0, docPath.lastIndexOf("/"));
			GeneralComunicator.openPath(path, doc.getPath());
		}
	});
	anchor.setStyleName("okm-KeyMap-ImageHover");
	table.setWidget(row, 2, anchor);
	table.setHTML(row, 3, Util.formatSize(doc.getActualVersion().getSize()));

	if (enableDelete) {
		Image delete = new Image(OKMBundleResources.INSTANCE.deleteIcon());
		delete.setStyleName("okm-KeyMap-ImageHover");
		delete.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				staplingService.removeStaple(String.valueOf(staple.getId()), new AsyncCallback<Object>() {
					@Override
					public void onSuccess(Object result) {
						if (staple.getType().equals(GWTStaple.STAPLE_FOLDER)) {
							Stapling.get().refreshFolder(uuid);
						} else if (staple.getType().equals(GWTStaple.STAPLE_DOCUMENT)) {
							Stapling.get().refreshDocument(uuid);
						} else if (staple.getType().equals(GWTStaple.STAPLE_MAIL)) {
							Stapling.get().refreshMail(uuid);
						}
					}

					@Override
					public void onFailure(Throwable caught) {
						GeneralComunicator.showError("remove", caught);
					}
				});
			}
		});

		table.setWidget(row, 4, delete);
	} else {
		table.setHTML(row, 4, "");
	}

	table.getCellFormatter().setWidth(row, 0, "60px");
	table.getCellFormatter().setWidth(row, 1, "25px");
	table.getCellFormatter().setWidth(row, 4, "25px");

	table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
	table.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_CENTER);
	table.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_LEFT);
	table.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);
	table.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:81,代码来源:StapleTableManager.java

示例11: addMail

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * addMail
 */
public static void addMail(FlexTable table, final GWTStaple staple, final String uuid, boolean enableDelete) {
	int row = table.getRowCount();
	final GWTMail mail = staple.getMail();

	// Mail is never checkout or subscribed ( because can not be changed )
	table.setHTML(row, 0, "&nbsp;");

	if (mail.getAttachments().size() > 0) {
		table.setHTML(row, 1, Util.imageItemHTML("img/email_attach.gif"));
	} else {
		table.setHTML(row, 1, Util.imageItemHTML("img/email.gif"));
	}

	Anchor anchor = new Anchor();
	anchor.setHTML(mail.getSubject());
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			String docPath = mail.getPath();
			String path = docPath.substring(0, docPath.lastIndexOf("/"));
			GeneralComunicator.openPath(path, docPath);
		}
	});
	anchor.setStyleName("okm-KeyMap-ImageHover");
	table.setWidget(row, 2, anchor);
	table.setHTML(row, 3, Util.formatSize(mail.getSize()));


	if (enableDelete) {
		Image delete = new Image(OKMBundleResources.INSTANCE.deleteIcon());
		delete.setStyleName("okm-KeyMap-ImageHover");
		delete.addClickHandler(new ClickHandler() {
			@Override
			public void onClick(ClickEvent event) {
				staplingService.removeStaple(String.valueOf(staple.getId()), new AsyncCallback<Object>() {
					@Override
					public void onSuccess(Object result) {
						if (staple.getType().equals(GWTStaple.STAPLE_FOLDER)) {
							Stapling.get().refreshFolder(uuid);
						} else if (staple.getType().equals(GWTStaple.STAPLE_DOCUMENT)) {
							Stapling.get().refreshDocument(uuid);
						} else if (staple.getType().equals(GWTStaple.STAPLE_MAIL)) {
							Stapling.get().refreshMail(uuid);
						}
					}

					@Override
					public void onFailure(Throwable caught) {
						GeneralComunicator.showError("remove", caught);
					}
				});
			}
		});

		table.setWidget(row, 4, delete);
	} else {
		table.setHTML(row, 4, "");
	}

	table.getCellFormatter().setWidth(row, 0, "60px");
	table.getCellFormatter().setWidth(row, 1, "25px");
	table.getCellFormatter().setWidth(row, 4, "25px");

	table.getCellFormatter().setHorizontalAlignment(row, 0, HasHorizontalAlignment.ALIGN_RIGHT);
	table.getCellFormatter().setHorizontalAlignment(row, 1, HasHorizontalAlignment.ALIGN_CENTER);
	table.getCellFormatter().setHorizontalAlignment(row, 2, HasHorizontalAlignment.ALIGN_LEFT);
	table.getCellFormatter().setHorizontalAlignment(row, 3, HasHorizontalAlignment.ALIGN_CENTER);
	table.getCellFormatter().setHorizontalAlignment(row, 4, HasHorizontalAlignment.ALIGN_CENTER);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:73,代码来源:StapleTableManager.java

示例12: addProposedSubscriptionReceivedRow

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * Adding proposed subscription received row
 *
 * @param propose
 */
private void addProposedSubscriptionReceivedRow(final GWTProposedSubscriptionReceived propose) {
	int rows = dataTable.getRowCount();
	boolean seen = (propose.getSeenDate() == null);
	dataTable.insertRow(rows);

	// Sets folder object
	data.put(new Integer(dataIndexValue), propose);

	if (propose.isAccepted()) {
		dataTable.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.yes()));
	} else {
		dataTable.setHTML(rows, 0, "");
	}

	dataTable.setHTML(rows, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
	String docType = "";
	if (propose.getType().equals(GWTFolder.TYPE)) {

		docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.folder");
	} else {
		docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.document");
	}
	dataTable.setHTML(rows, 2, UtilComunicator.getTextAsBoldHTML(docType, seen));
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
	dataTable.setHTML(rows, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));

	Anchor anchor = new Anchor();
	String path = propose.getPath().substring(propose.getPath().lastIndexOf("/") + 1);
	anchor.setHTML(UtilComunicator.getTextAsBoldHTML(path, seen));
	anchor.setTitle(propose.getPath());
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			if (propose.getType().equals(GWTFolder.TYPE)) {
				GeneralComunicator.openPath(propose.getPath(), null);
			} else if (propose.getType().equals(GWTDocument.TYPE)) {
				String fldPath = propose.getPath().substring(0, propose.getPath().lastIndexOf("/"));
				GeneralComunicator.openPath(fldPath, propose.getPath());
			}
		}
	});

	anchor.setStyleName("okm-KeyMap-ImageHover");
	dataTable.setWidget(rows, 4, anchor);
	dataTable.setHTML(rows, 5, "" + (dataIndexValue++));

	// Format
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setVisible(rows, 5, false);

	for (int i = 0; i < 5; i++) {
		dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:64,代码来源:ExtendedScrollTable.java

示例13: addProposedSubscriptionSentRow

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * Adding proposed subscription sent row
 *
 * @param propose
 */
private void addProposedSubscriptionSentRow(final GWTProposedSubscriptionSent propose) {
	int rows = dataTable.getRowCount();
	dataTable.insertRow(rows);
	// Sets folder object
	data.put(new Integer(dataIndexValue), propose);

	dataTable.setHTML(rows, 0, "");
	dataTable.setHTML(rows, 1, propose.getFrom());
	String docType = "";

	if (propose.getType().equals(GWTFolder.TYPE)) {
		docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.folder");
	} else {
		docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.document");
	}

	dataTable.setHTML(rows, 2, docType);
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
	dataTable.setHTML(rows, 3, dtf.format(propose.getSentDate()));

	Anchor anchor = new Anchor();
	String path = propose.getPath().substring(propose.getPath().lastIndexOf("/") + 1);
	anchor.setHTML(path);
	anchor.setTitle(propose.getPath());
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			if (propose.getType().equals(GWTFolder.TYPE)) {
				GeneralComunicator.openPath(propose.getPath(), null);
			} else if (propose.getType().equals(GWTDocument.TYPE)) {
				String fldPath = propose.getPath().substring(0, propose.getPath().lastIndexOf("/"));
				GeneralComunicator.openPath(fldPath, propose.getPath());
			}
		}
	});

	anchor.setStyleName("okm-KeyMap-ImageHover");
	dataTable.setWidget(rows, 4, anchor);
	dataTable.setHTML(rows, 5, "" + (dataIndexValue++));

	// Format
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setVisible(rows, 5, false);

	for (int i = 0; i < 5; i++) {
		dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:58,代码来源:ExtendedScrollTable.java

示例14: refreshProposedSubscriptionRow

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * Refresh proposed subscription row
 *
 * @param propose
 */
private void refreshProposedSubscriptionRow(final GWTProposedSubscriptionReceived propose, int row) {
	boolean seen = (propose.getSeenDate() == null);
	// Sets folder object
	data.put(new Integer(dataTable.getHTML(row, 5)), propose);

	if (propose.isAccepted()) {
		dataTable.setWidget(row, 0, new Image(OKMBundleResources.INSTANCE.yes()));
	} else {
		dataTable.setHTML(row, 0, "");
	}

	dataTable.setHTML(row, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
	String docType = "";

	if (propose.getType().equals(GWTFolder.TYPE)) {
		docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.folder");
	} else {
		docType = GeneralComunicator.i18nExtension("messaging.message.type.propose.document");
	}

	dataTable.setHTML(row, 2, UtilComunicator.getTextAsBoldHTML(docType, seen));
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
	dataTable.setHTML(row, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
	Anchor anchor = new Anchor();
	String path = propose.getPath().substring(propose.getPath().lastIndexOf("/") + 1);
	anchor.setHTML(UtilComunicator.getTextAsBoldHTML(path, seen));
	anchor.setTitle(propose.getPath());
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			if (propose.getType().equals(GWTFolder.TYPE)) {
				GeneralComunicator.openPath(propose.getPath(), null);
			} else if (propose.getType().equals(GWTDocument.TYPE)) {
				String fldPath = propose.getPath().substring(0, propose.getPath().lastIndexOf("/"));
				GeneralComunicator.openPath(fldPath, propose.getPath());
			}
		}
	});

	anchor.setStyleName("okm-KeyMap-ImageHover");
	dataTable.setWidget(row, 4, anchor);
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:48,代码来源:ExtendedScrollTable.java

示例15: addProposedQueryReceivedRow

import com.google.gwt.user.client.ui.Anchor; //导入方法依赖的package包/类
/**
 * Adding proposed query row
 *
 * @param propose
 */
private void addProposedQueryReceivedRow(final GWTProposedQueryReceived propose) {
	int rows = dataTable.getRowCount();
	boolean seen = (propose.getSeenDate() == null);
	dataTable.insertRow(rows);
	// Sets folder object
	data.put(new Integer(dataIndexValue), propose);

	if (propose.isAccepted()) {
		dataTable.setWidget(rows, 0, new Image(OKMBundleResources.INSTANCE.yes()));
	} else {
		dataTable.setHTML(rows, 0, "");
	}

	dataTable.setHTML(rows, 1, UtilComunicator.getTextAsBoldHTML(propose.getFrom(), seen));
	String queryType = "";

	if (!propose.getParams().isDashboard()) {
		queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.query");
	} else {
		queryType = GeneralComunicator.i18nExtension("messaging.message.type.propose.user.query");
	}

	dataTable.setHTML(rows, 2, UtilComunicator.getTextAsBoldHTML(queryType, seen));
	DateTimeFormat dtf = DateTimeFormat.getFormat(GeneralComunicator.i18nExtension("general.date.pattern"));
	dataTable.setHTML(rows, 3, UtilComunicator.getTextAsBoldHTML(dtf.format(propose.getSentDate()), seen));
	Anchor anchor = new Anchor();
	String queryName = propose.getParams().getQueryName();
	anchor.setHTML(UtilComunicator.getTextAsBoldHTML(queryName, seen));
	anchor.setTitle(queryName);
	anchor.addClickHandler(new ClickHandler() {
		@Override
		public void onClick(ClickEvent arg0) {
			WorkspaceComunicator.changeSelectedTab(UIDockPanelConstants.SEARCH);
			SearchComunicator.setSavedSearch(propose.getParams());
		}
	});

	anchor.setStyleName("okm-KeyMap-ImageHover");
	dataTable.setWidget(rows, 4, anchor);
	dataTable.setHTML(rows, 5, "" + (dataIndexValue++));

	// Format
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 0, HasHorizontalAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 1, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 2, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 3, HasHorizontalAlignment.ALIGN_CENTER);
	dataTable.getCellFormatter().setHorizontalAlignment(rows, 4, HasHorizontalAlignment.ALIGN_LEFT);
	dataTable.getCellFormatter().setVisible(rows, 5, false);

	for (int i = 0; i < 5; i++) {
		dataTable.getCellFormatter().addStyleName(rows, i, "okm-DisableSelect");
	}
}
 
开发者ID:openkm,项目名称:document-management-system,代码行数:59,代码来源:ExtendedScrollTable.java


注:本文中的com.google.gwt.user.client.ui.Anchor.setStyleName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。