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


Java Anchor.setStylePrimaryName方法代码示例

本文整理汇总了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
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:26,代码来源:TransparentIt.java

示例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);
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:22,代码来源:SimpleLogo.java

示例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);
}
 
开发者ID:mit-cml,项目名称:appinventor-extensions,代码行数:15,代码来源:YoungAndroidPalettePanel.java

示例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);
	}
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:16,代码来源:ImageMix.java

示例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;
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:8,代码来源:SimpleResize.java

示例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
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:28,代码来源:GridPaint.java

示例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);
}
 
开发者ID:guiguib,项目名称:yaph,代码行数:59,代码来源:PasswordView.java

示例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;
}
 
开发者ID:akjava,项目名称:gwthtml5apps,代码行数:7,代码来源:Html5DemoEntryPoint.java

示例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;
}
 
开发者ID:Reading-eScience-Centre,项目名称:edal-java,代码行数:82,代码来源:LayoutManager.java


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