Java Code Examples for com.google.gwt.user.client.ui.TextBox#setStyleName()

The following examples show how to use com.google.gwt.user.client.ui.TextBox#setStyleName() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SqlETLGrid.java    From EasyML with Apache License 2.0 6 votes vote down vote up
protected void init(){

		//Panel information
		this.setWidget(0,0,url);
		urlTB = new TextBox();
		urlTB.setStyleName("bda-etlpanel-textbox");
		this.setWidget(0,1,urlTB);

		this.setWidget(1,0,user);
		userTB = new TextBox();
		userTB.setStyleName("bda-etlpanel-textbox");
		this.setWidget(1,1,userTB);

		this.setWidget(2,0,password);
		passwordTB = new TextBox();
		passwordTB.setStyleName("bda-etlpanel-textbox");
		this.setWidget(2,1,passwordTB);


	}
 
Example 2
Source File: CustomTextBox.java    From lumongo with Apache License 2.0 6 votes vote down vote up
public CustomTextBox(boolean hasButton) {
	addStyleName(MainResources.GSS.searchBox());

	textBox = new TextBox();
	textBox.setStyleName(MainResources.GSS.searchBoxInput());

	add(textBox);

	if (hasButton) {
		button = new MaterialLink();
		button.setIconType(IconType.SEARCH);
		button.setIconColor(Color.WHITE);
		add(button);
	}

}
 
Example 3
Source File: FilterQueryWidget.java    From lumongo with Apache License 2.0 6 votes vote down vote up
public FilterQueryWidget() {
	addStyleName(MainResources.GSS.searchBox());

	textBox = new TextBox();
	textBox.setStyleName(MainResources.GSS.searchBoxInput());

	add(textBox);

	plusButton = new MaterialLink();
	plusButton.setIconType(IconType.ADD);
	plusButton.setIconColor(Color.WHITE);
	add(plusButton);

	minusButton = new MaterialLink();
	minusButton.setIconType(IconType.REMOVE);
	minusButton.setIconColor(Color.WHITE);

	add(minusButton);

}
 
Example 4
Source File: ScriptParameterPanel.java    From EasyML with Apache License 2.0 5 votes vote down vote up
/**
 * Init UI
 * @param editable Wheather is editable
 */
protected void init(boolean editable){

	initGridHead( 3 );
	inCountBox = new TextBox();
	outCountBox = new TextBox();
	inCountBox.setText( "" +widget.getInNodeShapes().size() );
	outCountBox.setText( "" + widget.getOutNodeShapes().size());

	paramsGrid.setVisible(true);
	paramsGrid.setWidget( 1 , 0, new Label("Input File Number"));
	paramsGrid.setWidget( 1, 1, new Label("Int"));
	paramsGrid.setWidget( 1, 2, inCountBox );
	inCountBox.setSize("95%", "100%");
	inCountBox.setStyleName("okTextbox");
	inCountBox.setEnabled(editable);
	inCountBox.setTabIndex(0);

	paramsGrid.setWidget( 2 , 0, new Label("Output File Number"));
	paramsGrid.setWidget( 2,  1, new Label("Int"));
	paramsGrid.setWidget( 2 , 2, outCountBox );
	outCountBox.setSize("95%", "100%");
	outCountBox.setStyleName("okTextbox");
	outCountBox.setEnabled(editable);
	outCountBox.setTabIndex(1);
	scriptArea = new TextArea();
	scriptArea.setText( widget.getProgramConf().getScriptContent());
	this.add( paramsGrid );
	this.add( new Label("Script"));
	this.add( scriptArea );
}
 
Example 5
Source File: FileTextBox.java    From document-management-system with GNU General Public License v2.0 5 votes vote down vote up
/**
 * File textBox
 */
public FileTextBox() {
	textBox = new TextBox();
	textBox.addKeyUpHandler(new KeyUpHandler() {
		@Override
		public void onKeyUp(KeyUpEvent event) {
			switch (event.getNativeKeyCode()) {
				case (char) KeyCodes.KEY_ENTER:
					switch (action) {
						case ACTION_RENAME:
							if (textBox.getText().length() > 0) {
								Main.get().mainPanel.desktop.browser.fileBrowser.rename(textBox.getText());
							} else {
								Main.get().mainPanel.desktop.browser.fileBrowser.hideRename();
							}
							break;
					}
					Main.get().mainPanel.enableKeyShorcuts(); // Enables general keys applications
					break;

				case (char) KeyCodes.KEY_ESCAPE:
					switch (action) {
						case ACTION_RENAME:
							Main.get().mainPanel.desktop.browser.fileBrowser.hideRename();
							break;
					}
					Main.get().mainPanel.enableKeyShorcuts(); // Enables general keys applications
					break;
			}
		}
	});
	textBox.setVisibleLength(20);
	textBox.setStyleName("okm-FileBrowser-TextBox");
	initWidget(textBox);
}
 
Example 6
Source File: GpsEmulator.java    From android-gps-emulator with Apache License 2.0 5 votes vote down vote up
/**
 * Initialize the Emulator UI
 */
private void initializeUI() {
   // Create textboxes and set default hostname and port
   _hostname = new TextBox();
   _hostname.setText(DEFAULT_HOST);
   _hostname.getElement().setPropertyString("placeholder", "hostname");
   _port = new TextBox();
   _port.setText(String.valueOf(DEFAULT_PORT));
   _port.getElement().setPropertyString("placeholder", "port");

   // Create button to connect
   _button = new Button("Connect");
   // Create the info/status label, initially not visible
   _info = new InlineLabel();
   _info.setVisible(false);

   // register the button action
   _button.addClickHandler(new ClickHandler() {
      public void onClick(final ClickEvent event) {
         final String hostname = _hostname.getText();
         final int port = Integer.valueOf(_port.getText());
         new PortAsyncCallback(hostname, port).execute();
      }
   });
   
   // Create panel for textbox, button and info label
   final FlowPanel div = new FlowPanel();
   div.setStylePrimaryName("emulator-controls");
   _hostname.setStyleName("emulator-hostname");
   _port.setStyleName("emulator-port");
   _button.setStyleName("emulator-connect");
   _info.setStyleName("emulator-info");
   div.add(_hostname);
   div.add(_port);
   div.add(_button);
   div.add(_info);

   // add the controls before the map so that the div doesn't cover the map
   RootLayoutPanel.get().add(div);
}
 
Example 7
Source File: LogFilePanel.java    From core with GNU Lesser General Public License v2.1 4 votes vote down vote up
private TextBox hiddenTextBox(String styleName) {
    TextBox textBox = new TextBox();
    textBox.setStyleName(styleName);
    textBox.setVisible(false);
    return textBox;
}