private void validateInput() { String value = ""; switch (inputType) { case TEXTBOX: value = ((TextBox)input).getValue(); break; case TEXTAREA: value = ((TextArea)input).getValue(); break; case PASSWORD: value = ((PasswordTextBox)input).getValue(); break; } if (isOptional && value.length() == 0) { setInputValid(true); } else { if (validationStr != null) { setInputValid(value.matches(validationStr)); } else { setInputValid(true); } } }
public DocFieldWidget(String parentDocumentIdentifier, Label fieldLabel, Field field, ValidatableWidget<SuggestionBox> widget, ValidatableWidget<ListBox> lWidget, ValidatableWidget<TextArea> textAreaWidget, boolean isReadOnly) { this.parentDocumentIdentifier = parentDocumentIdentifier; this.fieldLabel = fieldLabel; this.field = field; this.textAreaWidget = textAreaWidget; this.widget = widget; this.lWidget = lWidget; this.isReadOnly = isReadOnly; // enabling or disabling the widgets based on 'readonly' flag if (lWidget != null) { this.lWidget.getWidget().setEnabled(!isReadOnly); } if (widget != null) { this.widget.getWidget().getTextBox().setEnabled(!isReadOnly); } if (textAreaWidget != null) { this.textAreaWidget.getWidget().setReadOnly(isReadOnly); } setForceReviewOfValidatableWidget(); }
/** * */ private void addCssStyle() { editDependencyPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); editDependencyPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); andButton.setSize(CustomWorkflowConstants._50PX, CustomWorkflowConstants._25PX); orButton.setSize(CustomWorkflowConstants._50PX, CustomWorkflowConstants._25PX); buttonsPanel.setSpacing(CustomWorkflowConstants.SPACING_15); dependenciesList.setVisibleItemCount(CustomWorkflowConstants.VISIBLE_ITEM_10); dependenciesListHorizontalPanel.add(dependenciesList); dependenciesTextArea.setSize(CustomWorkflowConstants._280PX, CustomWorkflowConstants._147PX); dependenciesTextArea.setTextAlignment(TextArea.ALIGN_JUSTIFY); editDependencyDockLayoutPanel.addStyleName(CustomWorkflowConstants.CUSTOM_WORKFLOW_PANEL); editDependencyDockLayoutPanel.addStyleName(CustomWorkflowConstants.MAIN_PANEL_LAYOUT); pluginLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL); dependencyTypeLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL); dependenciesLabel.addStyleName(CustomWorkflowConstants.STRONG_LABEL); pluginNamesList.addStyleName(CustomWorkflowConstants.STRONG_LABEL); }
public void addToDependenciesList(String dependencyType) { String selectedDependency = getSelectedValueFromList(getEditDependencyPresenter().getView().getDependenciesList()); if (selectedDependency != null && !selectedDependency.isEmpty()) { StringBuffer selectedDependencies = new StringBuffer(getEditDependencyPresenter().getView().getDependenciesTextArea() .getText()); if (!selectedDependencies.toString().isEmpty()) { if (dependencyType.equals(CustomWorkflowConstants.AND_SEPERATOR)) { selectedDependencies.append(CustomWorkflowConstants.AND_SEPERATOR); selectedDependencies.append(CustomWorkflowConstants.NEXT_LINE); } else if (dependencyType.equals(CustomWorkflowConstants.OR_SEPERATOR)) { selectedDependencies.append(CustomWorkflowConstants.OR_SEPERATOR); selectedDependencies.append(CustomWorkflowConstants.NEXT_LINE); } } selectedDependencies.append(selectedDependency); TextArea dependenciesTextArea = editDependencyPresenter.getView().getDependenciesTextArea(); dependenciesTextArea.setText(selectedDependencies.toString()); dependenciesTextArea.setCursorPos(selectedDependencies.length()); } }
public static MessageBox prompt(String caption, String message, boolean asHTML, boolean multiline, int buttons, MessageBoxListener listener) { final MessageBox mb = new MessageBox(); mb.setText(caption); mb.setButtons(buttons, listener); mb._dockPanel.add(asHTML ? new HTML(message) : new Label(message), DockPanel.NORTH); if(multiline) { mb._textArea = new TextArea(); mb._dockPanel.add(mb._textArea, DockPanel.CENTER); mb.center(); mb._textArea.setFocus(true); } else { mb._textBox = new TextBox(); mb._dockPanel.add(mb._textBox, DockPanel.CENTER); mb.center(); mb._textBox.setFocus(true); } return mb; }
@Override public ApplicationListener createApplicationListener() { setLoadingListener(new LoadingListener() { @Override public void beforeSetup() {} @Override public void afterSetup() { textBox = new TextArea(); textBox.getElement().getStyle().setPosition(Style.Position.RELATIVE); textBox.getElement().getStyle().setWidth(1000, Style.Unit.PX); textBox.getElement().getStyle().setHeight(500, Style.Unit.PX); textBox.getElement().getStyle().setDisplay(Style.Display.INLINE); textBox.getElement().getStyle().setTop(50, Style.Unit.PX); textBox.getElement().getStyle().setBackgroundColor("#664477"); textBox.setEnabled(true); getRootPanel().add(textBox); } }); return new BabelBobble(new GwtCopier()); }
@Override public Widget render(Schema property) { HTMLPanel panel = new HTMLPanel(""); panel.getElement().getStyle().setDisplay(Display.INLINE); panel.add(new InlineLabel("\"")); if (property.locked()) { InlineLabel label = new InlineLabel(); panel.add(label); hasText = label; } else { TextArea editor = new TextArea(); panel.add(editor); hasText = editor; } panel.add(new InlineLabel("\"")); if (property.getDefault() != null) { hasText.setText(property.getDefault()); } return panel; }
private static AsyncCallback<?> createXmlCallBack(final TextArea textArea) { if(xmlCallBack == null){ xmlCallBack = new AsyncCallback<Object>() { public void onSuccess(Object result) { if (result != null) { String xml = result.toString(); textArea.setText(xml); } ClientApplicationContext.getInstance().setBusy(false); } public void onFailure(Throwable caught) { ClientApplicationContext.getInstance().log("Processing screen creation failed", "Error creating dynamic panel", true, true, caught); ClientApplicationContext.getInstance().setBusy(false); updateTime(null); } }; } return xmlCallBack; }
public Text(Composite parent, int style) { this(new TextArea(), parent, style); textArea = (TextArea) getGwtWidget(); panel = (LayoutPanel) getParent().getGwtWidget().getParent(); panel.add(textArea); textArea.addBlurHandler(new BlurHandler() { @Override public void onBlur(BlurEvent event) { setText(textArea.getText()); textArea.removeFromParent(); sendEvent(SWT.Modify); sendEvent(SWT.FocusOut); } }); }
public OriginalPanel() { setSize("100%", "100%"); setSpacing(5); Label title = new Label(appConstants.importTextTitle()); add(title); setCellWidth(title,"100%"); setCellHeight(title,"1%"); textArea = new TextArea(); textArea.addChangeListener(this); textArea.setSize("100%","100%"); add(textArea); setCellWidth(textArea,"100%"); setCellHeight(textArea,"99%"); }
private void createLuckyWikiButton() { Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_wiki")); final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text")); rndWikiButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { wcService.getRandomWikiUrl(new AsyncCallback<String>() { public void onSuccess(String result) { textArea.setText(result); } public void onFailure(Throwable caught) { textArea.setText("http://en.wikipedia.org/wiki/Special:random"); } }); } }); }
private void createLuckyTwitterButton() { Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_twitter")); final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text")); rndWikiButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { wcService.getRandomTwitterUrl(new AsyncCallback<String>() { public void onSuccess(String result) { textArea.setText(result); } public void onFailure(Throwable caught) { textArea.setText("twitter: hot trend"); } }); } }); }
private void createLuckyYoutubeButton() { Anchor rndWikiButton = Anchor.wrap(Document.get().getElementById("btn_rnd_youtube")); final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text")); rndWikiButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { wcService.getRandomYoutubeUrl(new AsyncCallback<String>() { public void onSuccess(String result) { textArea.setText(result); } public void onFailure(Throwable caught) { textArea.setText("https://www.youtube.com"); } }); } }); }
private void createLuckyGoogleButton() { Anchor rndGoogleButton = Anchor.wrap(Document.get().getElementById("btn_rnd_google")); final TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text")); rndGoogleButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { wcService.getRandomGoogleUrl(new AsyncCallback<String>() { public void onSuccess(String result) { textArea.setText(result); } public void onFailure(Throwable caught) { textArea.setText("google: hot trend"); } }); } }); }
private TextArea createTextArea() { TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text")); textArea.addKeyDownHandler(new KeyDownHandler() { public void onKeyDown(KeyDownEvent event) { event.preventDefault(); if (event.getNativeKeyCode() == KeyCodes.KEY_ENTER) { createWordCloud(); } } }); return textArea; }
public void log(String msg) { if (appScreen == null) { return; } TextArea logTextArea = appScreen.getTextArea(); Date d = new Date(); String t = d.toString() + ": " + msg; int cW = logTextArea.getCharacterWidth(); String currentText = logTextArea.getText(); if (currentText.length() > 0) { logTextArea.setText(currentText + "\n" + t); } else { logTextArea.setText(t); } appScreen.getScrollPanel().scrollToBottom(); Log.debug(msg); }
public void copyContent(ClipboardContent content) { final TextArea copyArea = createClipboardTextArea(); if (TextContentHelper.isText(content)) { copyArea.setText(TextContentHelper.getText(content)); } else { copyArea.setText(content.toString()); } copyArea.selectAll(); new Timer() { @Override public void run() { RootPanel.get().remove(copyArea); $(myTarget).focus(); } }.schedule(20); }
protected void init(String msg, String title) { this.setTitle("stdErr"); this.setGlassEnabled(true); HTML closeButton = new HTML("X"); closeButton.setSize("10px", "10px"); closeButton.setStyleName("closebtn"); closeButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { StdPanel.this.hide(); } }); ScrollPanel scvp = new ScrollPanel(); VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.add(closeButton); verticalPanel.setCellHeight(closeButton, "30px"); verticalPanel.setStyleName("vpanel"); HTML desc = new HTML(title); desc.setStyleName("popupTitle"); verticalPanel.add(desc); verticalPanel.setCellHeight(desc, "30px"); TextArea label = new TextArea(); label.setText(msg); label.setReadOnly(true); label.setSize("650px", "400px"); verticalPanel.add(label); scvp.add(verticalPanel); this.add(scvp); this.setStyleName("loading_container"); this.center(); this.show(); }
/** * 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 ); }
/** * Init UI * @param editable Wheather is editable */ protected void init(boolean editable){ scriptArea = new TextArea(); scriptArea.setText( widget.getProgramConf().getScriptContent()); this.add( panel ); this.add( new Label("Script")); this.add( scriptArea ); }
/** * Helper method called by constructor to initialize ui components */ private void initComponents() { // Initialize UI panel = new VerticalPanel(); panel.setWidth("100%"); galleryGUI = new FlowPanel(); appSingle = new FlowPanel(); appDetails = new FlowPanel(); appHeader = new FlowPanel(); appInfo = new FlowPanel(); appAction = new FlowPanel(); appAuthor = new FlowPanel(); appMeta = new FlowPanel(); appDates = new FlowPanel(); appPrimaryWrapper = new FlowPanel(); appSecondaryWrapper = new FlowPanel(); appDescPanel = new FlowPanel(); appReportPanel = new FlowPanel(); appSharePanel = new FlowPanel(); appActionTabs = new TabPanel(); sidebarTabs = new TabPanel(); appComments = new FlowPanel(); appCommentsList = new FlowPanel(); appsByAuthor = new FlowPanel(); appsByTags = new FlowPanel(); appsRemixes = new FlowPanel(); returnToGallery = new FlowPanel(); // tagSelected = ""; appCreated = new Label(); appChanged = new Label(); descBox = new FlowPanel(); titleBox = new FlowPanel(); desc = new TextArea(); titleText = new TextArea(); moreInfoText = new TextArea(); creditText = new TextArea(); ccLicenseRef = new HTML(MESSAGES.galleryCcLicenseRef()); ccLicenseRef.addStyleName("app-action-html"); }
/** * Helper method called by constructor to initialize the app's comment area */ private void initAppComments() { // App details - comments appDetails.add(appComments); appComments.addStyleName("app-comments-wrapper"); Label commentsHeader = new Label("Comments and Reviews"); commentsHeader.addStyleName("app-comments-header"); appComments.add(commentsHeader); final TextArea commentTextArea = new TextArea(); commentTextArea.addStyleName("app-comments-textarea"); appComments.add(commentTextArea); Button commentSubmit = new Button("Submit my comment"); commentSubmit.addStyleName("app-comments-submit"); commentSubmit.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { final OdeAsyncCallback<Long> commentPublishCallback = new OdeAsyncCallback<Long>( // failure message MESSAGES.galleryError()) { @Override public void onSuccess(Long date) { // get the new comment list so gui updates // note: we might modify the call to publishComment so it returns // the list instead, this would save one server call gallery.GetComments(app.getGalleryAppId(), 0, 100); } }; Ode.getInstance().getGalleryService().publishComment(app.getGalleryAppId(), commentTextArea.getText(), commentPublishCallback); } }); appComments.add(commentSubmit); // Add list of comments gallery.GetComments(app.getGalleryAppId(), 0, 100); appComments.add(appCommentsList); appCommentsList.addStyleName("app-comments"); }
public void setTextAreaEvent(DocField field, String input, final ValidatableWidget<TextArea> textAreaWidget) { String inputString = input; int pos = inputString.lastIndexOf(SEPERATOR); int index = 0; String originalString = inputString; if (!(pos < 0)) { index = Integer.parseInt(inputString.substring(pos + ALTERNATE_STRING_VALUE.length() + SEPERATOR.length(), inputString .length())); inputString = inputString.substring(0, pos); } textAreaWidget.getWidget().setText(inputString); textAreaWidget.getWidget().setValue(inputString); // textAreaWidget.toggleValidDateBox(); CoordinatesList coordinatesList = field.getCoordinatesList(); int count = 0; if (field.getAlternateValues() != null) { for (Field alternateField : field.getAlternateValues().getAlternateValue()) { if (pos < 0) { if (alternateField.getValue().equals(inputString)) { ValidatePanel.this.fireEvent(new ValidationFieldChangeEvent(alternateField)); coordinatesList = alternateField.getCoordinatesList(); } } else { if (alternateField.getValue().equals(inputString)) { if (count == index) { ValidatePanel.this.fireEvent(new ValidationFieldChangeEvent(alternateField)); coordinatesList = alternateField.getCoordinatesList(); } count++; } } } } if (field.getValue().equals(originalString)) { ValidatePanel.this.fireEvent(new ValidationFieldChangeEvent(field)); } updateDocument(coordinatesList, field.getName()); }
public ConsoleDialog(ConsoleDialogListener listener) { super(false, true); this.listener = listener; VerticalPanel dialogContents = new VerticalPanel(); dialogContents.setSpacing(4); setWidget(dialogContents); console = new TextArea(); console.setReadOnly(true); int width= Window.getClientWidth(); int height= Window.getClientHeight(); console.setSize(width*2/3 + "px", height*2/3 + "px"); console.addStyleName(Utils.sandboxStyle.consoleArea()); okButton = new Button("Ok"); addButton(okButton); dialogContents.add(console); okButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { hide(); if (ConsoleDialog.this.listener != null) { ConsoleDialog.this.listener.onOk(rpcCallSucceded && consoleSessionSucceded); } } }); okButton.setEnabled(false); }
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()); }
/** * Use this constructor only when you are subclassing TextAreaFieldWidget and need * the special case provided by the willEncapsulate parameter. * @param fieldDef the FieldDef that is the Model for this TextAreaFieldWidget * @param willEncapsulate this parameter should be true only if you are subclassing * text box and plan to wrap it in another widget. If true, you must call * initWidget() in the subclass and TextAreaFieldWidget will not call it. * This parameter is rarely used */ protected TextAreaInputField(FieldDef fieldDef, boolean willEncapsulate) { _fieldDef = fieldDef; _textArea = new TextArea(); _textArea.setSize("250px", "135px"); addHandlers(); if (!willEncapsulate)initWidget(_textArea); _textArea.setTitle(_fieldDef.getShortDesc()); if (_fieldDef.getDefaultValueAsString() != null) { _textArea.setText(_fieldDef.getDefaultValueAsString()); } }
private static AsyncCallback<?> createXmlCallBack(final TextArea textArea) { if (xmlCallBack == null) { xmlCallBack = new AsyncCallback<Object>() { public void onSuccess(Object result) { if (result != null) { String xml = result.toString(); textArea.setText(xml); DialogComponent .showDialog( "Conversion successful", "Please select from the menu of this window the \"GWT\" rendering option. <br>A \"Try Me\" menu item will appear in the top menu bar. <br><br> All the windows from this FMB will be listed. ", GenericDialogGVO.TYPE_INFO, "Please select from the menu of this window the \"GWT output\" rendering option. <br>A \"Try Me\" menu item will appear in the top menu bar. <br><br> All the windows from this FMB will be listed in this \"Try Me\" menu. ", 0, 0); } ClientApplicationContext.getInstance().setBusy(false); } public void onFailure(Throwable caught) { ClientApplicationContext.getInstance().log( "Processing screen creation failed", "Error creating dynamic panel", true, true, caught); ClientApplicationContext.getInstance().setBusy(false); updateTime(null); } }; } return xmlCallBack; }
private void showTextArea() { final TextArea textArea=new TextArea(); textArea.setStyleName("mf-writeACommentTextArea"); textArea.setTitle(i18n.hitCtrlEnterToSubmitComment()); textArea.setFocus(true); textArea.addKeyUpHandler(new KeyUpHandler() { public void onKeyUp(KeyUpEvent event) { if(event.getNativeKeyCode()==KeyCodes.KEY_ENTER && event.isControlKeyDown()) { if(!"".equals(textArea.getText())) { ctx.getStatusLine().showProgress(i18n.savingYourComment()); ctx.getService().saveQuestionComment(questionId,textArea.getText(),new AsyncCallback<String>() { public void onFailure(Throwable caught) { ctx.getRia().handleServiceError(caught); } public void onSuccess(String result) { ctx.getStatusLine().hideStatus(); textArea.setVisible(false); CommentBean commentBean=new CommentBean( result, ctx.getState().getCurrentUser(), questionId, textArea.getText(), new Date()); // this is a new comment, therefore it is always added at the end - replacing existing one ;-) final int threadRow = questionCommentsPanel.getRowCount()-1; questionCommentsPanel.setWidget(threadRow, 0, new ViewCommentPanel(threadRow, questionCommentsPanel, commentBean, ctx)); questionCommentsPanel.addNewComment(); } }); } } } }); add(textArea); }
public PlotEditor(Model mod) { this.model = mod; setSize("100%", "100%"); plot = new TextArea(); plot.setSize("100%", "100%"); plot.setText(model.getPlot()); plot.addChangeHandler(new ChangeHandler() { public void onChange(ChangeEvent event) { model.updatePlot(plot.getText().trim(), plotListener); } }); add(plot); setCellHeight(plot,"100%"); setCellWidth(plot,"100%"); plotListener = new PlotListener() { public void refreshAll() { plot.setText(model.getPlot()); } public void update(String pl) { plot.setText(pl); } public void updateBookRules(String rules) { } public void updatePlayerRules(String rules) { } public void updateCommercialText(String text) { } public void updateDemoInfoText(String text) { } }; model.addPlotListener(plotListener); }
private void createCreateWordCloudButton(final TextArea textArea) { Button sendButton = Button.wrap(Document.get().getElementById("btn_create_wc")); sendButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent event) { createWordCloud(); } }); }
private void createWordCloud() { TextArea textArea = TextArea.wrap(Document.get().getElementById("input_text")); String text = textArea.getText().trim(); if (!text.isEmpty()) { createWordCloud(text); } else { textArea.setFocus(true); } }
public Widget getWidget() { TextArea ta = new TextArea(); ta.setWidth( stdFieldWidth + "px" ); ta.setHeight( "120px" ); return ta; }
protected InputTextArea(InputTextArea source) { super(new TextArea(), source); this.setMaxLength(source.getMaxLength()); if (source.rows != null) { this.setRows(source.rows); } }
public DialogContent(EditCallback callback) { this.callback = callback; VerticalPanel vp = new VerticalPanel(); initWidget(vp); if (engVal != null && !engVal.equals("")) { vp.add(new Label(translatorappI18n.translateTableRow_engVal())); HTML lbl = new HTML(perNToBr(SafeHtmlUtils.htmlEscape(brToPerN(engVal)))); lbl.getElement().getStyle().setBackgroundColor("#f2f2f2"); lbl.getElement().getStyle().setWidth(blockWidth, Unit.PX); lbl.getElement().getStyle().setHeight(blockHeight, Unit.PX); lbl.getElement().getStyle().setOverflowY(Overflow.AUTO); lbl.getElement().getStyle().setBorderColor("#d0d0d0"); lbl.getElement().getStyle().setBorderStyle(BorderStyle.SOLID); lbl.getElement().getStyle().setBorderWidth(2, Unit.PX); vp.add(lbl); } vp.add(new Label(translatorappI18n.translatedValue_value())); textArea = new TextArea(); textArea.setText(brToPerN(translatedVal)); textArea.getElement().getStyle().setWidth(blockWidth, Unit.PX); textArea.getElement().getStyle().setHeight(blockHeight, Unit.PX); vp.add(textArea); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); revertBtn = new IneButton(IneButtonType.CANCEL, IneFormI18n.CANCEL()); hp.add(revertBtn); doneBtn = new IneButton(IneButtonType.ACTION, IneFormI18n.SAVE()); hp.add(doneBtn); vp.add(hp); }
DialogContent(ChangedCallback callback) { this.callback = callback; add(new HTML(translatorappI18n.upload_header())); header = new TextBox(); header.getElement().getStyle().setWidth(600, Unit.PX); header.setValue(createDefaultHeaderText()); add(header); add(new HTML(translatorappI18n.upload_rows())); rows = new TextArea(); rows.getElement().getStyle().setWidth(600, Unit.PX); rows.getElement().getStyle().setHeight(400, Unit.PX); add(rows); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); cancel = new IneButton(IneButtonType.CANCEL, IneFormI18n.CANCEL()); hp.add(cancel); ok = new IneButton(IneButtonType.ACTION, IneFormI18n.OK()); hp.add(ok); add(hp); }
public RichTextEditorWidget() { editorId = "tinyMCE-" + System.currentTimeMillis(); textArea = new TextArea(); textArea.setWidth("90%"); textArea.getElement().setAttribute("id", editorId); initWidget(textArea); // DeferredCommand.addCommand(new Command() { // // public void execute() { // initEditor(); // } // }); }
public AnalyseHandler(final TextArea mainTextArea, final Label statusLabel, final List<SnomedConcept> conceptList, final List<SemanticType> types, final Map<String, String> typeCodeToDescription) { this.mainTextArea = mainTextArea; this.statusLabel = statusLabel; this.conceptList = conceptList; this.types = types; this.typeCodeToDescription = typeCodeToDescription; this.glassPanel = new GlassLoadingPanel(); final String hostAndPort = Cookies.getCookie("webserviceHost"); this.webserviceUrl = (hostAndPort.isEmpty() ? "" : "http://" + hostAndPort) + "/snomed-coder-web/rest/v1.0/snomedctCodes"; }
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)); }
@Override protected boolean createFieldWidget() { field = new TextArea(); field.addKeyUpHandler(new MyKeyUpHandler()); field.addValueChangeHandler(getVCHandler()); Style fieldStyle = field.getElement().getStyle(); fieldStyle.setWidth(100, Unit.PCT); fieldStyle.setHeight(150, Unit.PX); fieldStyle.setProperty("border", "2px inset"); fieldStyle.setProperty("boxSizing", "border-box"); fieldStyle.setPaddingLeft(3, Unit.PX); fieldStyle.setColor("#575A5F !important"); fieldStyle.setFontSize(11, Unit.PX); fieldStyle.setProperty("fontFamily", "Verdana, Arial, Helvetica, sans-serif"); fieldStyle.setProperty("borderTop", "1px solid #CCC"); fieldStyle.setProperty("borderRight", "1px solid #999"); fieldStyle.setProperty("borderBottom", "1px solid #999"); fieldStyle.setProperty("borderLeft", "1px solid #999"); //fieldStyle.setProperty("border", "2px #C9D5E0 inset"); fieldStyle.setProperty("boxSizing", "border-box"); fieldStyle.setProperty("WebkitBoxSizing", "border-box"); fieldStyle.setProperty("MozBoxSizing", "border-box"); // fieldStyle.setProperty("borderCollapse", "collapse"); return true; // field.setStylePrimaryName("StringViewTextBox"); }
private void createHtmlArea(TabLayoutPanel tab) { VerticalPanel container=new VerticalPanel(); container.setSize("100%", "100%"); htmlArea = new TextArea(); htmlArea.setWidth("95%"); htmlArea.setHeight("100%"); container.add(htmlArea); tab.add(container,"HTML"); }