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


Java Renderer类代码示例

本文整理汇总了Java中com.google.gwt.text.shared.Renderer的典型用法代码示例。如果您正苦于以下问题:Java Renderer类的具体用法?Java Renderer怎么用?Java Renderer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: NumberBox

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
protected NumberBox(AvroUiStyle style, Element element, String promptText,
        final Renderer<T> renderer, final Parser<T> parser) {
    super(element, renderer, parser);
    sinkEvents(Event.ONPASTE);
    this.style = style;
    this.promptText = promptText;
    this.renderer = renderer;
    
    if (Utils.isNotBlank(promptText)) {
        this.addFocusHandler(this);
        this.addClickHandler(this);
        setPrompts();
    }
    
    this.addKeyDownHandler(this);
    this.addBlurHandler(this);
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:18,代码来源:NumberBox.java

示例2: reset

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
protected void reset() {
	if (this.type == null) {
		this.type = NumberType.LONG;
	}

	this.setRenderer((Renderer<N>) this.type.renderer);
	this.setParser((Parser<N>) this.type.parser);

	this.maskHelper.reset();
	if (this.signed) {
		this.maskHelper.addTokenHelper(new StaticStringTokenHelper(InputNumber.NUMBER_CONSTANTS.minusSign(), true));
	}
	this.maskHelper.addTokenHelper(new IntegerTokenHelper(0, Integer.MIN_VALUE, Integer.MAX_VALUE, -1, "0"));

	switch (this.type) {
		case FLOAT:
		case DOUBLE:
		case BIG_DECIMAL:
			this.maskHelper.addTokenHelper(new StaticStringTokenHelper(InputNumber.NUMBER_CONSTANTS.decimalSeparator(),
				true, ',', '.'));
			this.maskHelper.addTokenHelper(new IntegerTokenHelper(0, Integer.MIN_VALUE, Integer.MAX_VALUE, -1, "0"));
			break;
		default:
			break;
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:27,代码来源:InputNumber.java

示例3: MultiValueListBox

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
/**
 * Instantiates a new MultiValueListBox.
 */
public MultiValueListBox(Renderer<T> renderer, ProvidesKey<T> keyProvider) {
  this.keyProvider = keyProvider;
  this.renderer = renderer;
  ListBox listBox = new ListBox();
  listBox.setMultipleSelect(true);
  initWidget(listBox);
  getListBox().addChangeHandler(new ChangeHandler() {
    public void onChange(ChangeEvent event) {
      List<T> newValue = new ArrayList<>();
      for (int i = 0; i < values.size(); i++) {
        if (getListBox().isItemSelected(i)) {
          newValue.add(values.get(i));
        }
      }
      setValue(newValue, true);
    }
  });
}
 
开发者ID:kaaproject,项目名称:kaa,代码行数:22,代码来源:MultiValueListBox.java

示例4: ValueMultiListBox

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
public ValueMultiListBox(Renderer<T> renderer2, ProvidesKey<T> keyProvider2) {
    this.keyProvider = keyProvider2;
    this.renderer = renderer2;
    initWidget(new ListBox(true));
    getListBox().setVisibleItemCount(2);

    getListBox().addChangeHandler(new ChangeHandler() {
        @Override
        public void onChange(ChangeEvent event) {
            ListBox lb = getListBox();
            Collection<T> newValue = new ArrayList<T>();
            for (int i = 0; i < values.size(); i++) {
                if (lb.isItemSelected(i)) {
                    newValue.add(values.get(i));
                }
            }

            setValue(newValue, true);
        }
    });
}
 
开发者ID:salk31,项目名称:RedQueryBuilder,代码行数:22,代码来源:ValueMultiListBox.java

示例5: initPersonalTitle

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
private void initPersonalTitle() {
    personalTitleListBox = new ValueListBox<PersonalTitle>(new Renderer<PersonalTitle>() {

        @Override
        public String render(PersonalTitle object) {
            return object != null ? object.toString() : "";
        }

        @Override
        public void render(PersonalTitle object, Appendable appendable)
                throws IOException {
            appendable.append(render(object));
        }
    });
    List<PersonalTitle> titles = new ArrayList<PersonalTitle>();
    titles.add(null);
    titles.addAll(Arrays.asList(PersonalTitle.values()));
    personalTitleListBox.setAcceptableValues(titles);
}
 
开发者ID:apetrelli,项目名称:samplegwt,代码行数:20,代码来源:PersonEditor.java

示例6: ExplicitValueBox

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
protected ExplicitValueBox(Element aElement, Renderer<T> aRenderer, Parser<T> aParser) {
	super(aElement, aRenderer, aParser);
	renderer = aRenderer;
	parser = aParser;
	addChangeHandler(new ChangeHandler() {
		public void onChange(ChangeEvent event) {
			if (!settingValue) {
				String text = ExplicitValueBox.super.getText();
				setText(text);
			}
		}
	});
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:14,代码来源:ExplicitValueBox.java

示例7: ExtendedValueListBox

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
public ExtendedValueListBox(Renderer<T> renderer,
        ProvidesKey<T> keyProvider, AvroUiStyle style, String promptText) {
    super(renderer, keyProvider);
    
    this.style = style;
    this.promptText = promptText;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:8,代码来源:ExtendedValueListBox.java

示例8: AbstractSelectionCell

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
public AbstractSelectionCell(Renderer<T> renderer) {
    super(BrowserEvents.CHANGE);
    if (template == null) {
        template = GWT.create(Template.class);
    }
    this.renderer = renderer;
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:8,代码来源:AbstractSelectionCell.java

示例9: ValueSelectionCell

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
/**
 * Construct a new {@link ValueSelectionCell} with the specified options.
 *
 * @param options the options in the cell
 * @param renderer the renderer to render options in the cell
 */
public ValueSelectionCell(List<T> options, Renderer<T> renderer) {
  super(BrowserEvents.CHANGE);
  if (template == null) {
    template = GWT.create(Template.class);
  }
  this.options = new ArrayList<T>(options);
  this.renderer = renderer;
  int index = 0;
  for (T option : options) {
    indexForOption.put(option, index++);
  }
}
 
开发者ID:kaaproject,项目名称:avro-ui,代码行数:19,代码来源:ValueSelectionCell.java

示例10: visit

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
@Override
public <A, B extends Editor> boolean visit(Context<B> context) {
	Editor editor = context.getEditor();
	if (editor instanceof AbstractInputChoice) {
		ModelDriver<?> driver = context.getDriver();
		MessageHelper messageHelper = driver.getMessageHelper();
		Class<A> propertyType = null;
		Path path = context.getPath();
		Model<?> model = ModelUtils.resolveModel(driver.getModel(), path);
		if (model instanceof ModelCollection) {
			propertyType = (Class<A>) model.getLeafType();
		} else {
			propertyType = ModelUtils.resolveType(driver.getModel(), path);
		}

		if (ModelUtils.isEnumType(propertyType)) {
			AbstractInputChoice inputChoice = (AbstractInputChoice) editor;
			Renderer<?> renderer = new EnumRenderer<>(messageHelper);
			inputChoice.setItemRenderer(renderer);
			inputChoice.setItems(Lists.newArrayList(propertyType.getEnumConstants()));
			if (inputChoice instanceof AbstractInputSelect) {
				((AbstractInputSelect) inputChoice).setSelectionRenderer(renderer);
			}
		}
	}
	return true;
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:28,代码来源:EnumValuesVisitor.java

示例11: render

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
protected <V> String render(V value, Renderer<V> renderer) {
	if (value == null) {
		return this.renderNull();
	}
	if (renderer != null) {
		return renderer.render(value);
	}
	return value.toString();
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:10,代码来源:AbstractInputChoice.java

示例12: setRenderer

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
@Override
public void setRenderer(Renderer<T> renderer) {
	super.setRenderer(renderer);
	if (oracle.getDelegate() instanceof SimpleOracle) {
		SimpleOracle<T> simpleOracle = (SimpleOracle<T>) oracle.getDelegate();
		simpleOracle.setRenderer(renderer);
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:9,代码来源:InputSuggest.java

示例13: setRenderer

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
public void setRenderer(Renderer<T> renderer) {
	this.renderer = renderer;
	if (renderer != null) {
		this.setText(renderer.render(this.getValue()));
	}
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:7,代码来源:AbstractTextOutput.java

示例14: getItemRenderer

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
@Override
public Renderer<T> getItemRenderer() {
	return this.itemRenderer;
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:5,代码来源:AbstractInputChoice.java

示例15: setItemRenderer

import com.google.gwt.text.shared.Renderer; //导入依赖的package包/类
@Override
public void setItemRenderer(Renderer<T> renderer) {
	this.itemRenderer = renderer;
}
 
开发者ID:Putnami,项目名称:putnami-web-toolkit,代码行数:5,代码来源:AbstractInputChoice.java


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