本文整理匯總了Java中com.google.gwt.user.client.ui.Anchor.setStylePrimaryName方法的典型用法代碼示例。如果您正苦於以下問題:Java Anchor.setStylePrimaryName方法的具體用法?Java Anchor.setStylePrimaryName怎麽用?Java Anchor.setStylePrimaryName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.gwt.user.client.ui.Anchor
的用法示例。
在下文中一共展示了Anchor.setStylePrimaryName方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDownloadImage
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
private void createDownloadImage(boolean withBg) {
if(selection==null){
return;
}
downloadArea.clear();
updateCanvas(withBg);//anway bg
blob=Blob.createBase64Blob(canvas.toDataUrl(),"image/png");//for IE keep blob
Anchor a=null;
if(GWTUtils.isIE()){
a=HTML5Download.get().generateDownloadLink(blob, "image/png","gridPaint.png", textConstants.RightClickAndSaveAs(),false);
//a.setTitle("to download right mouse button to show contextmenu and select save as by yourself");
}else{
//TODO support ios
a=HTML5Download.get().generateDownloadLink(blob, "image/png","transparent.png", textConstants.Download_Image(),true);
}
a.setStylePrimaryName("bt");
downloadArea.add(a);
updateCanvas(false);//clear invalid
}
示例2: generateImage
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
protected void generateImage() {
int clipSX=(canvasWidth-imageWidth)/2;
int clipSY=(canvasHeight-imageHeight)/2;
int clipEX=clipSX+imageWidth;
int clipEY=clipSY+imageHeight;
ImageData data=canvas.getContext2d().getImageData(clipSX, clipSY, clipEX-clipSX, clipEY-clipSY);
CanvasUtils.createCanvas(drawCanvas, data);
String type=typeBox.getValue();
String dataUrl=drawCanvas.toDataUrl("image/"+type);
String extension=type.equals("jpeg")?"jpg":type;
String name=titleBox.getText().isEmpty()?"logo":titleBox.getText();
Anchor anchor=HTML5Download.get().generateBase64DownloadLink(dataUrl, "image/"+type, name+"."+extension, textConstants.Download(), true);
anchor.setStylePrimaryName("bt");
downloadArea.clear();
downloadArea.add(anchor);
}
示例3: initExtensionPanel
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
private void initExtensionPanel() {
Anchor addComponentAnchor = new Anchor(MESSAGES.importExtensionMenuItem());
addComponentAnchor.setStylePrimaryName("ode-ExtensionAnchor");
addComponentAnchor.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
new ComponentImportWizard().center();
}
});
categoryPanels.get(ComponentCategory.EXTENSION).add(addComponentAnchor);
categoryPanels.get(ComponentCategory.EXTENSION).setCellHorizontalAlignment(
addComponentAnchor, HasHorizontalAlignment.ALIGN_CENTER);
}
示例4: createDownloadLink
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
private void createDownloadLink(){
linkFolder.clear();
if(GWTUtils.isIOS()){
//iOS not support download
linkFolder.add(new Label("long press to below image to download"));
}else if(GWTUtils.isIE()){
//IE is horrible to support it
linkFolder.add(new Label("right-click context menu and select save as"));
}else{
Anchor anchor=CanvasUtils.generateDownloadImageLink(mixedCanvas, true, "mixed.png", "Push here to download image", true);
anchor.setStylePrimaryName("bt");
linkFolder.add(anchor);
}
}
示例5: get
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
@Override
public Anchor get() {
LogUtils.log("generate:"+getFileName());
Anchor a=HTML5Download.get().generateBase64DownloadLink(this.getDataUrl(), "image/"+type, this.getFileName(), textConstants.Download(), false);
a.setStylePrimaryName("bt");
return a;
}
示例6: createDownloadImage
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
private void createDownloadImage() {
if(selection==null){
return;
}
downloadArea.clear();
String type=exportImageType.getValue().toLowerCase();
String mime="image/"+type;
String extension=type.equals("jpeg")?"jpg":type;
blob=Blob.createBase64Blob(canvas.toDataUrl(mime),mime);//for IE keep blob
Anchor a=null;
if(GWTUtils.isIE()){
a=HTML5Download.get().generateDownloadLink(blob, mime,"gridPaint."+extension, textConstants.RightClickAndSaveAs(),false);
a.setTitle("to download right mouse button to show contextmenu and select save as by yourself");
}else{
//TODO support ios
a=HTML5Download.get().generateDownloadLink(blob, "image/"+mime,"gridPaint."+extension, textConstants.Download_Image(),true);
}
a.setStylePrimaryName("bt");
downloadArea.add(a);
gifUrl="";//clear
}
示例7: addPassword
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
@Override
public void addPassword(PasswordCard password, List<PasswordField> fields, boolean open) {
HTMLPanel li = new HTMLPanel("li", "");
if (open)
li.getElement().setAttribute("class", "active");
HTMLPanel header = new HTMLPanel("div", "<i class='mdi-action-turned-in-not'></i>"+password.getTitre());
header.setStyleName("collapsible-header");
HTMLPanel body = new HTMLPanel("div", "");
HTMLPanel bodyP = new HTMLPanel("p", "");
body.setStyleName("collapsible-body");
body.add(bodyP);
for (PasswordField lField : fields)
{
PasswordWidget.TypePassword type = "PASSWD".equals(lField.getType()) ? PasswordWidget.TypePassword.PASSWD : PasswordWidget.TypePassword.TEXT;
PasswordWidget wField = new PasswordWidget(type);
wField.setTitleText(lField.getLibelle());
wField.setValueText(lField.getValue());
wField.setType(type);
bodyP.add(wField);
}
HTMLPanel actionBar = new HTMLPanel("div", "");
actionBar.setStylePrimaryName("row");
HTMLPanel actionButtonDel = new HTMLPanel("div", "");
actionButtonDel.setStylePrimaryName("col s2 left-align");
Anchor deleteButton = new Anchor("<i class='mdi-content-remove'></i>",true);
deleteButton.addClickHandler(this.removeHandler);
deleteButton.setStylePrimaryName("btn-floating tooltipped waves-effect waves-light");
deleteButton.getElement().setAttribute("data-position", "top");
deleteButton.getElement().setAttribute("data-delay", "5");
deleteButton.getElement().setAttribute("data-tooltip", "Supprimer");
actionButtonDel.add(deleteButton);
actionBar.add(actionButtonDel);
HTMLPanel actionButtonEdit = new HTMLPanel("div", "");
actionButtonEdit.setStylePrimaryName("col s2 left-align");
Anchor editButton = new Anchor("<i class='mdi-editor-mode-edit'></i>",true);
editButton.addClickHandler(this.updateHandler);
editButton.setStylePrimaryName("btn-floating tooltipped waves-effect waves-light");
editButton.getElement().setAttribute("data-position", "top");
editButton.getElement().setAttribute("data-delay", "5");
editButton.getElement().setAttribute("data-tooltip", "Modifier");
actionButtonEdit.add(editButton);
actionBar.add(actionButtonEdit);
bodyP.add(actionBar);
li.add(header);
li.add(body);
li.getElement().setAttribute("id", password.getId()+"");
data.add(li);
wPasswords.put(password.getId(), li);
}
示例8: createTitleWidget
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
public Widget createTitleWidget(){
Anchor label=new Anchor("akjava.com "+getAppName()+" "+getAppVersion(),getAppUrl());
label.setStylePrimaryName("title");
return label;
}
示例9: getCompactGodiva3Layout
import com.google.gwt.user.client.ui.Anchor; //導入方法依賴的package包/類
public static Widget getCompactGodiva3Layout(LayerSelectorIF layerSelector,
UnitsInfoIF unitsInfo, TimeSelectorIF timeSelector,
ElevationSelectorIF elevationSelector, PaletteSelectorIF paletteSelector,
Anchor kmzLink, Anchor permalink, Anchor email, Anchor screenshot, Image rescLogo,
MapArea mapArea, Image loadingImage, AnimationButton anim, PushButton infoButton) {
kmzLink.setStylePrimaryName("linkStyle");
permalink.setStylePrimaryName("linkStyle");
email.setStylePrimaryName("linkStyle");
screenshot.setStylePrimaryName("linkStyle");
VerticalPanel selectors = new VerticalPanel();
selectors.add(layerSelector);
selectors.add(unitsInfo);
selectors.add(timeSelector);
selectors.add(elevationSelector);
/*
* The image height is hardcoded here, because when running with IE8,
* rescLogo.getHeight() returns 0 instead of the actual height...
*/
int logoHeight = rescLogo.getHeight();
if (logoHeight == 0)
logoHeight = 52;
selectors.setHeight(logoHeight + "px");
HorizontalPanel bottomPanel = new HorizontalPanel();
bottomPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
anim.setWidth("16px");
bottomPanel.add(anim);
bottomPanel.setWidth("100%");
bottomPanel.add(kmzLink);
bottomPanel.add(permalink);
bottomPanel.add(email);
bottomPanel.add(screenshot);
infoButton.setWidth("16px");
bottomPanel.add(infoButton);
HorizontalPanel topPanel = new HorizontalPanel();
topPanel.add(rescLogo);
topPanel.add(selectors);
topPanel.setCellVerticalAlignment(rescLogo, HasVerticalAlignment.ALIGN_MIDDLE);
HorizontalPanel mapPalettePanel = new HorizontalPanel();
mapPalettePanel.add(mapArea);
mapPalettePanel.add(paletteSelector);
/*
* We introduce an AbsolutePanel here. Generally I like to avoid them,
* but it allows us to overlay a loading image. It's introduced at the
* last possible moment to avoid any ugliness related to absolute
* positioning
*/
AbsolutePanel mapPaletteLoaderPanel = new AbsolutePanel();
mapPaletteLoaderPanel.add(mapPalettePanel);
int loaderHeight = loadingImage.getHeight();
int loaderWidth = loadingImage.getWidth();
if (loaderHeight == 0)
loaderHeight = 19;
if (loaderWidth == 0)
loaderWidth = 220;
mapPaletteLoaderPanel.add(loadingImage,
(int) (mapArea.getMap().getSize().getWidth() - loaderWidth) / 2, (int) (mapArea
.getMap().getSize().getHeight() - loaderHeight) / 2);
VerticalPanel vPanel = new VerticalPanel();
vPanel.add(topPanel);
vPanel.setCellHeight(topPanel, logoHeight + "px");
vPanel.setCellWidth(topPanel, ((int) mapArea.getMap().getSize().getWidth() + 100) + "px");
vPanel.add(mapPaletteLoaderPanel);
vPanel.add(bottomPanel);
vPanel.setCellHeight(bottomPanel, "100%");
vPanel.setCellVerticalAlignment(bottomPanel, HasVerticalAlignment.ALIGN_MIDDLE);
ScrollPanel scrollPanel = new ScrollPanel(vPanel);
return scrollPanel;
}