當前位置: 首頁>>代碼示例>>Java>>正文


Java TextArea.setVisibleLines方法代碼示例

本文整理匯總了Java中com.google.gwt.user.client.ui.TextArea.setVisibleLines方法的典型用法代碼示例。如果您正苦於以下問題:Java TextArea.setVisibleLines方法的具體用法?Java TextArea.setVisibleLines怎麽用?Java TextArea.setVisibleLines使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.google.gwt.user.client.ui.TextArea的用法示例。


在下文中一共展示了TextArea.setVisibleLines方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: showDebugMsgBox

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
public static void showDebugMsgBox(final String msg) {
    if (_debugMsgBoxPopup == null) {
        _debugMsgBox = new TextArea();
        ScrollPanel wrapper = new ScrollPanel(_debugMsgBox);
        wrapper.setSize("300px", "200px");
        _debugMsgBoxPopup = new PopupPane("Debug", wrapper, false, false);
        _debugMsgBox.setCharacterWidth(2000);
        _debugMsgBox.setVisibleLines(10);
    }
    _debugMsgBox.setText(_debugMsgBox.getText() + "\n" + msg);
    if (!_debugMsgBoxPopup.isVisible()) _debugMsgBoxPopup.show();
    _debugMsgBox.getElement().setScrollTop(_debugMsgBox.getElement().getScrollHeight());
}
 
開發者ID:lsst,項目名稱:firefly,代碼行數:14,代碼來源:GwtUtil.java

示例2: onModuleLoad

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
public void onModuleLoad() {
    // create the widgets
    final Button analyseButton = new Button(messages.sendButton());
    final Button configureButton = new Button(messages.configureButton());
    final TextArea mainTextArea = new TextArea();
    mainTextArea.setCharacterWidth(80);
    mainTextArea.setVisibleLines(15);
    final Label errorLabel = new Label();
    final CellTable<SnomedConcept> resultsTable = new CellTable<>();

    // add them to the root panel
    RootPanel.get("mainTextArea").add(mainTextArea);
    RootPanel.get("analyseButton").add(analyseButton);
    RootPanel.get("configureButton").add(configureButton);
    RootPanel.get("status").add(errorLabel);
    RootPanel.get("snomedCodes").add(resultsTable);

    // set the focus to the text area
    mainTextArea.setFocus(true);

    // initialise the SNOMED code results table
    final List<SnomedConcept> conceptList = configSnomedTable(resultsTable);

    // add the handlers
    final List<SemanticType> types = new ArrayList<>();
    final Map<String, String> typeCodeToDescription = new HashMap<>();
    analyseButton.addClickHandler(
            new AnalyseHandler(mainTextArea, errorLabel, conceptList, types, typeCodeToDescription));
    configureButton.addClickHandler(new ConfigureHandler(types, typeCodeToDescription));
}
 
開發者ID:NICTA,項目名稱:t3as-snomedct-service,代碼行數:31,代碼來源:SnomedCoderUi.java

示例3: onModuleLoad

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
/**
 * This is the entry point method.
 */
@Override
public void onModuleLoad() {
    final TextArea log = new TextArea();
    RootPanel.get("log-div").add(log);
    log.addStyleName("logBox");
    log.setVisibleLines(10);
    log.setReadOnly(true);
    System.setOut(new TextAreaPrintStream(log));
    System.setErr(System.out);

    final Button runButton = new Button("Run!");
    RootPanel.get("btn-div").add(runButton);
    runButton.addStyleName("runButton");

    runButton.addClickHandler(new ClickHandler() {
        @Override
        public void onClick(ClickEvent event) {
            log.setValue("");
            String code = getSourceCode();
            String className = Javac.getClassName(code);

            boolean ok = Javac.compile(className + ".java", code);
            if (ok) {
                System.out.println("Compiled!");
                printMagic(fs.readFile(fs.cwd() + className + ".class"));
                System.out.println("Output:");

                JVM.setClassLoader(new JibClassLoader());
                JVM.run(className);
            }
        }
    });
}
 
開發者ID:ctalau,項目名稱:javainthebrowser,代碼行數:37,代碼來源:Jib.java

示例4: TextAreaExample

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
public TextAreaExample() {
  super("Text Area");

  TextArea text = new TextArea();
  text.setCharacterWidth(30);
  text.setVisibleLines(5);
  add(text);

  RichTextArea rich = new RichTextArea();
  rich.setHTML("Rich <i>text</i> <b>area</b>");
  add(rich);
}
 
開發者ID:DavidWhitlock,項目名稱:PortlandStateJava,代碼行數:13,代碼來源:TextAreaExample.java

示例5: initTextArea

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
/**
 * Initialisation code for the TextAreas
 *
 * @param area text area to initialise
 */
private void initTextArea(TextArea area) {
  area.setReadOnly(true);
  area.setVisibleLines(40);
  area.setCharacterWidth(80);
}
 
開發者ID:jorkey,項目名稱:Wiab.pro,代碼行數:11,代碼來源:DebugDialog.java

示例6: addFieldLabel

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
/**
 * Add a field name/field value label to the bodyGrid
 * @param text the text to insert
 * @param isName true if the text is the name of the field
 * @partam isAlognNameTop true if we need to align the name to the top of the cell
 * this parameter only works if isName == true
 * @param isLongValue true if it is a long value, then is it
 * inserted into TextArea.of width 16 characters
 * @param listener the click listener for the hyperlink (user name)
 * @return the created widget that is the name of value field
 */
private Widget addFieldLabel(final String text, final boolean isName,
							final boolean isAlognNameTop,
							final boolean isLongValue,
							final ClickHandler listener) {
	Widget element = null;
	if( isName ){
		bodyGrid.insertRow( row );
		bodyGrid.insertCell( row, column );
		Label lab  = new Label( text + FIELD_NAME_VS_VALUE_DELIMITER );
		lab.setWordWrap(false);
		lab.setStyleName( CommonResourcesContainer.INFO_POPUP_FIELD_NAME_STYLE_NAME );
		bodyGrid.setWidget( row, column, lab );
		if( isAlognNameTop ) {
			bodyGrid.getCellFormatter().setVerticalAlignment( row, column, HasVerticalAlignment.ALIGN_TOP);
		}
		column += 1;
		//Assign the return value
		element = lab;
	} else {
		//The long value is placed into a disabled textarea
		if( isLongValue ){
			//We will insert the long data on the new row, but place an empty cell for the old position
			bodyGrid.insertCell( row, column );
			bodyGrid.insertRow( ++row ); column = 0;
			bodyGrid.insertCell( row, column++ );
			bodyGrid.insertCell( row, column ); column = 0;
			TextArea area = new TextArea();
			//Set the line length in characters
			area.setCharacterWidth( MAX_DESCRIPTION_AREA_WIDTH_SYMB );
			area.setReadOnly( true );
			final String roomDescText = StringUtils.formatTextWidth( MAX_DESCRIPTION_AREA_WIDTH_SYMB, text, true );
			area.setText( roomDescText );
			//Set the number of visible lines
			area.setVisibleLines( StringUtils.countLines( roomDescText ) );
			element = area;
			bodyGrid.getFlexCellFormatter().setColSpan( row , column, 2);
		} else {
			bodyGrid.insertCell( row, column );
			element = new Label( text );
		}
		bodyGrid.getCellFormatter().setHorizontalAlignment( row, column, HasHorizontalAlignment.ALIGN_RIGHT);
		if( (listener != null) && ( element instanceof Label ) ){
			Label label = (Label) element;
			label.setWordWrap(false);
			label.addClickHandler( listener );
			label.setStyleName( CommonResourcesContainer.INFO_POPUP_VALUE_LINK_STYLE_NAME );
		} else {
			element.setStyleName( CommonResourcesContainer.INFO_POPUP_VALUE_STYLE_NAME );
		}
		bodyGrid.setWidget( row, column, element );
		row +=1;
		column = 0;
	}
	return element;
}
 
開發者ID:ivan-zapreev,項目名稱:x-cure-chat,代碼行數:67,代碼來源:RoomInfoPopupPanel.java

示例7: onInitialize

import com.google.gwt.user.client.ui.TextArea; //導入方法依賴的package包/類
/**
 * Initialize this example.
 */
@ShowcaseSource
@Override
public Widget onInitialize() {
  // Create a panel to layout the widgets
  VerticalPanel vpanel = new VerticalPanel();
  vpanel.setSpacing(5);

  // Add a normal and disabled text box
  TextBox normalText = new TextBox();
  normalText.ensureDebugId("cwBasicText-textbox");
  // Set the normal text box to automatically adjust its direction according
  // to the input text. Use the Any-RTL heuristic, which sets an RTL direction
  // iff the text contains at least one RTL character.
  normalText.setDirectionEstimator(AnyRtlDirectionEstimator.get());
  TextBox disabledText = new TextBox();
  disabledText.ensureDebugId("cwBasicText-textbox-disabled");
  disabledText.setText(constants.cwBasicTextReadOnly());
  disabledText.setEnabled(false);
  vpanel.add(new HTML(constants.cwBasicTextNormalLabel()));
  vpanel.add(createTextExample(normalText, true));
  vpanel.add(createTextExample(disabledText, false));

  // Add a normal and disabled password text box
  PasswordTextBox normalPassword = new PasswordTextBox();
  normalPassword.ensureDebugId("cwBasicText-password");
  PasswordTextBox disabledPassword = new PasswordTextBox();
  disabledPassword.ensureDebugId("cwBasicText-password-disabled");
  disabledPassword.setText(constants.cwBasicTextReadOnly());
  disabledPassword.setEnabled(false);
  vpanel.add(new HTML("<br><br>" + constants.cwBasicTextPasswordLabel()));
  vpanel.add(createTextExample(normalPassword, true));
  vpanel.add(createTextExample(disabledPassword, false));

  // Add a text area
  TextArea textArea = new TextArea();
  textArea.ensureDebugId("cwBasicText-textarea");
  textArea.setVisibleLines(5);
  vpanel.add(new HTML("<br><br>" + constants.cwBasicTextAreaLabel()));
  vpanel.add(createTextExample(textArea, true));

  // Return the panel
  return vpanel;
}
 
開發者ID:Peergos,項目名稱:Peergos,代碼行數:47,代碼來源:CwBasicText.java


注:本文中的com.google.gwt.user.client.ui.TextArea.setVisibleLines方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。