Java Code Examples for com.vaadin.ui.TextArea

The following are top voted examples for showing how to use com.vaadin.ui.TextArea. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: hybridbpm   File: TextComplete.java   Source Code and License 6 votes vote down vote up
public void extend(final TextArea textArea, List<String> users, List<String> projects) {
    if (textArea.getId() == null) {
        textArea.setId(UUID.randomUUID().toString().replace("-", ""));
    }
    StringBuilder execute = new StringBuilder("htextcomplete('#");
    execute.append(textArea.getId());
    execute.append("', [");
    for (String user : users) {
        execute.append("'").append(user).append("',");
    }
    execute.deleteCharAt(execute.length() - 1);
    execute.append("], [");
    for (String project : projects) {
        execute.append("'").append(project).append("',");
    }
    execute.deleteCharAt(execute.length() - 1);
    execute.append("])");
    super.extend(textArea);
    com.vaadin.ui.JavaScript.getCurrent().execute(execute.toString());
}
 
Example 2
Project: MetricsToGo   File: UIStartPage.java   Source Code and License 6 votes vote down vote up
private VerticalLayout getCopyPasteLayout() {
	VerticalLayout layout = new VerticalLayout();
	Label label = new Label("Paste the complete Content of your java-file here:");

	layout.addComponent(label);
	layout.setComponentAlignment(label, Alignment.TOP_CENTER);

	copyPasteTextfield = new TextArea();
	copyPasteTextfield.setWordWrap(false);
	copyPasteTextfield.setWidth(30.0f, Unit.REM);
	copyPasteTextfield.setHeight(30.0f, Unit.REM);

	layout.addComponent(copyPasteTextfield);
	layout.setComponentAlignment(copyPasteTextfield, Alignment.MIDDLE_CENTER);

	Button button = new Button(ADD);
	button.addClickListener(x -> addPasteListener.accept(getCopyPasteText()));
	layout.addComponent(button);
	layout.setComponentAlignment(button, Alignment.BOTTOM_RIGHT);

	return layout;
}
 
Example 3
Project: hawkbit   File: ActionStatusMsgGrid.java   Source Code and License 6 votes vote down vote up
@Override
public Component getDetails(final RowReference rowReference) {
    // Find the bean to generate details for
    final Item item = rowReference.getItem();
    final String message = (String) item.getItemProperty(ProxyMessage.PXY_MSG_VALUE).getValue();

    final TextArea textArea = new TextArea();
    textArea.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
    textArea.addStyleName(ValoTheme.TEXTAREA_TINY);
    textArea.addStyleName("inline-icon");
    textArea.setHeight(120, Unit.PIXELS);
    textArea.setWidth(100, Unit.PERCENTAGE);
    textArea.setValue(message);
    textArea.setReadOnly(Boolean.TRUE);
    return textArea;
}
 
Example 4
Project: border-layout   File: BorderlayoutUI.java   Source Code and License 6 votes vote down vote up
private Component getSimpleExamle() {
	VerticalLayout vlo = new VerticalLayout();
	vlo.setMargin(true);
	vlo.setHeight("100%");
	vlo.setWidth("100%");
	vlo.setSpacing(true);
	vlo.addComponent(getTestButtons());
	for (int i = 0; i < components.length; i++) {
		components[i] = new TextArea();
		((TextArea) components[i]).setValue(texts[i]);
		components[i].setSizeFull();
	}

	bl = new BorderLayout();
	vlo.addComponent(bl);
	vlo.setExpandRatio(bl, 1);

	bl.addComponent(components[0], BorderLayout.Constraint.NORTH);
	bl.addComponent(components[1], BorderLayout.Constraint.SOUTH);
	bl.addComponent(components[2], BorderLayout.Constraint.CENTER);
	bl.addComponent(components[3], BorderLayout.Constraint.EAST);
	bl.addComponent(components[4], BorderLayout.Constraint.WEST);
	return vlo;
}
 
Example 5
Project: cia   File: PartyRankingOverviewPageModContentFactoryImpl.java   Source Code and License 6 votes vote down vote up
/**
 * Creates the description.
 *
 * @return the text area
 */
private static TextArea createDescription() {
	final TextArea totalpartytoplistLabel = new TextArea(
			"Party Ranking by topic",
			"Time served in Parliament:ALL:CURRENT:"
					+ "\nTime served in Committees:ALL:CURRENT:"
					+ "\nTime served in Government:ALL:CURRENT:"
					+ "\nTop document author NR:ALL:YEAR:CURRENT:*FILTER:DocumnetType"
					+ "\nTop document author SIZE:YEAR:ALL:CURRENT:*FILTER:DocumnetType"

					+ "\nTop votes NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
					+ "\nTop vote winner NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
					+ "\nTop vote party rebel NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
					+ "\nTop vote presence NR/PERCENTAGE :ALL:YEAR:CURRENT::#Views:List,Timeline,BarChart,PieChart"
					+ "\nSearch by name");
	totalpartytoplistLabel.setSizeFull();
	totalpartytoplistLabel.setStyleName("Level2Header");
	return totalpartytoplistLabel;
}
 
Example 6
Project: cia   File: PoliticianRankingOverviewPageModContentFactoryImpl.java   Source Code and License 6 votes vote down vote up
/**
 * Creates the description.
 *
 * @return the text area
 */
private static TextArea createDescription() {
	final TextArea totalpoliticantoplistLabel = new TextArea("Politician Ranking by topic",
			"Time served in Parliament:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
					+ "\nTime served in Committees:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
					+ "\nTime served in Government:ALL:CURRENT:*FILTER:Gender,Party,ElectionRegion"
					+ "\nTop document author NR:ALL:YEAR:CURRENT:*FILTER:DocumnetType,Gender,Party,ElectionRegion"
					+ "\nTop document author SIZE:YEAR:ALL:CURRENT:*FILTER:DocumnetType,Gender,Party,ElectionRegion"

					+ "\nTop votes:ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
					+ "\nTop vote winner NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
					+ "\nTop vote party rebel NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
					+ "\nTop vote presence NR/PERCENTAGE :ALL:YEAR:CURRENT::*FILTER:Gender,Party,ElectionRegion"
					+ "\nSearch by name");
	totalpoliticantoplistLabel.setSizeFull();
	totalpoliticantoplistLabel.setStyleName("Level2Header");
	return totalpoliticantoplistLabel;
}
 
Example 7
Project: metl   File: EditXsltPanel.java   Source Code and License 6 votes vote down vote up
public TestWindow() {
    super("Test Transformation");
    setWidth(800f, Unit.PIXELS);
    setHeight(600f, Unit.PIXELS);
    content.setMargin(true);
    
    TextArea textField = new TextArea();
    textField.setSizeFull();
    textField.setWordwrap(false);
    
    Thread thread = Thread.currentThread();
    ClassLoader previousLoader = thread.getContextClassLoader();
    try {
        thread.setContextClassLoader(getClass().getClassLoader());
        textField.setValue(XsltProcessor.getTransformedXml(textArea.getValue(), editor.getValue(), XsltProcessor.PRETTY_FORMAT, false));
    } finally {
        thread.setContextClassLoader(previousLoader);

    }            
    addComponent(textField);
    content.setExpandRatio(textField, 1.0f);
    
    addComponent(buildButtonFooter(buildCloseButton()));
}
 
Example 8
Project: Plugins   File: SparqlUpdateVaadinDialog.java   Source Code and License 6 votes vote down vote up
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    checkPerGraph = new CheckBox(ctx.tr("sparqlUpdate.dialog.perGraph"));
    checkPerGraph.setWidth("100%");
    mainLayout.addComponent(checkPerGraph);
    mainLayout.setExpandRatio(checkPerGraph, 0.0f);

    txtQuery = new TextArea(ctx.tr("sparqlUpdate.dialog.query"));
    txtQuery.setSizeFull();
    txtQuery.setRequired(true);
    txtQuery.addValidator(createSparqlUpdateQueryValidator());
    txtQuery.setImmediate(true);
    mainLayout.addComponent(txtQuery);
    mainLayout.setExpandRatio(txtQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
 
Example 9
Project: Plugins   File: SparqlAskVaadinDialog.java   Source Code and License 6 votes vote down vote up
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    optMessageType = new OptionGroup(ctx.tr("rdfvalidation.dialog.optMessageType.caption"));
    optMessageType.addItem(DPUContext.MessageType.ERROR);
    optMessageType.addItem(DPUContext.MessageType.WARNING);
    optMessageType.setValue(optMessageType.getItem(0));
    mainLayout.addComponent(optMessageType);

    txtAskQuery = new TextArea(ctx.tr("rdfvalidation.dialog.txtAskQuery.caption"));
    txtAskQuery.setSizeFull();
    txtAskQuery.setNullRepresentation("");
    txtAskQuery.setNullSettingAllowed(true);
    mainLayout.addComponent(txtAskQuery);
    mainLayout.setExpandRatio(txtAskQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
 
Example 10
Project: Plugins   File: SparqlConstructVaadinDialog.java   Source Code and License 6 votes vote down vote up
@Override
protected void buildDialogLayout() {
    final VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);

    checkPerGraph = new CheckBox(ctx.tr("SparqlConstructVaadinDialog.perGraphMode"));
    checkPerGraph.setWidth("100%");
    mainLayout.addComponent(checkPerGraph);
    mainLayout.setExpandRatio(checkPerGraph, 0.0f);

    txtQuery = new TextArea(ctx.tr("SparqlConstructVaadinDialog.constructQuery"));
    txtQuery.setSizeFull();
    txtQuery.setRequired(true);
    txtQuery.addValidator(createSparqlQueryValidator());
    txtQuery.setImmediate(true);
    mainLayout.addComponent(txtQuery);
    mainLayout.setExpandRatio(txtQuery, 1.0f);

    setCompositionRoot(mainLayout);
}
 
Example 11
Project: mycollab   File: ProjectRoleAddViewImpl.java   Source Code and License 6 votes vote down vote up
@Override
protected AbstractBeanFieldGroupEditFieldFactory<ProjectRole> initBeanFormFieldFactory() {
    return new AbstractBeanFieldGroupEditFieldFactory<ProjectRole>(editForm) {
        private static final long serialVersionUID = 1L;

        @Override
        protected Field<?> onCreateField(Object propertyId) {
            if (propertyId.equals("description")) {
                final TextArea textArea = new TextArea();
                textArea.setNullRepresentation("");
                return textArea;
            } else if (propertyId.equals("rolename")) {
                final TextField tf = new TextField();
                if (isValidateForm) {
                    tf.setNullRepresentation("");
                    tf.setRequired(true);
                    tf.setRequiredError("Please enter a role name");
                }
                return tf;
            }
            return null;
        }
    };
}
 
Example 12
Project: enterprise-app   File: ImportFromClipboardWindow.java   Source Code and License 6 votes vote down vote up
public ImportFromClipboardWindow(String typeName, String columnsStringLabel) {
	super(Constants.uiImportFromClipboard);
	
	setResizable(false);
	setWidth("420px");
	
	TextArea textArea = new TextArea();
	textArea.addListener(this);
	textArea.setImmediate(true);
	textArea.setBuffered(true);
	textArea.setWidth("100%");
	
	VerticalLayout layout = new VerticalLayout();
	layout.setMargin(true);
	
	layout.addComponent(new Label(Constants.uiImportFromClipboardInstructions(columnsStringLabel), Label.CONTENT_XHTML));
	layout.addComponent(textArea);
	
	setContent(layout);
	
	textArea.focus();
}
 
Example 13
Project: konekti   File: MessageViewForm.java   Source Code and License 6 votes vote down vote up
@AutoGenerated
private HorizontalLayout buildHorizontalLayout_1() {
	// common part: create layout
	horizontalLayout_1 = new HorizontalLayout();
	horizontalLayout_1.setImmediate(false);
	horizontalLayout_1.setWidth("100.0%");
	horizontalLayout_1.setHeight("-1px");
	horizontalLayout_1.setMargin(false);
	
	// textArea
	textArea = new TextArea();
	textArea.setImmediate(false);
	textArea.setWidth("100.0%");
	textArea.setHeight("-1px");
	horizontalLayout_1.addComponent(textArea);
	horizontalLayout_1.setExpandRatio(textArea, 1.0f);
	
	return horizontalLayout_1;
}
 
Example 14
Project: konekti   File: AttachmentViewForm.java   Source Code and License 6 votes vote down vote up
private VerticalLayout buildVerticalLayoutFile() {
	// common part: create layout
	verticalLayoutFile = new VerticalLayout();
	verticalLayoutFile.setImmediate(false);
	verticalLayoutFile.setWidth("100.0%");
	verticalLayoutFile.setHeight("100.0%");
	verticalLayoutFile.setMargin(false);
	
	// textAreaFile
	textAreaFile = new TextArea();
	textAreaFile.setCaption("Comentarios");
	textAreaFile.setImmediate(false);
	textAreaFile.setWidth("100.0%");
	textAreaFile.setHeight("-1px");
	verticalLayoutFile.addComponent(textAreaFile);
	
	// horizontalLayoutFileToolbox
	horizontalLayoutFileToolbox = buildHorizontalLayoutFileToolbox();
	verticalLayoutFile.addComponent(horizontalLayoutFileToolbox);
	
	return verticalLayoutFile;
}
 
Example 15
Project: usergrid   File: LogLayout.java   Source Code and License 6 votes vote down vote up
private void addLogArea() {
    logArea = new TextArea( "Coordinator Logs" );

    // TODO make this file point configurable
    file = new File( "/var/log/chop-webapp.log" );
    try {
        r = new RandomAccessFile( file, "r" );
    }
    catch ( FileNotFoundException e ) {
        LOG.error( "Error while accessing file {}: {}", file, e );
    }
    logArea.setHeight( "100%" );
    logArea.setWidth( "100%" );
    getApplicationLog();
    addComponent( logArea );
    this.setComponentAlignment( logArea, Alignment.TOP_CENTER );
    this.setExpandRatio( logArea, 0.95f );
}
 
Example 16
Project: scoutmaster   File: ChildNoteView.java   Source Code and License 6 votes vote down vote up
@Override
protected Component buildEditor(final ValidatingFieldGroup<Note> fieldGroup2)
{
	final VerticalLayout layout = new VerticalLayout();
	layout.setSizeFull();

	final MultiColumnFormLayout<Note> overviewForm = new MultiColumnFormLayout<Note>(1, this.fieldGroup);
	overviewForm.setColumnFieldWidth(0, 500);
	overviewForm.setColumnLabelWidth(0, 70);
	// overviewForm.setColumnExpandRatio(0, 1.0f);
	overviewForm.setSizeFull();

	// overviewForm.colspan(2);
	overviewForm.bindDateField("Note Date", Note_.noteDate, "yyyy-MM-dd hh:mm", Resolution.MINUTE);
	overviewForm.newLine();
	overviewForm.bindTextField("Subject", Note_.subject);
	overviewForm.newLine();

	final TextArea detailsEditor = overviewForm.bindTextAreaField("Body", Note_.body, 6);
	detailsEditor.setSizeFull();
	overviewForm.setExpandRatio(1.0f);

	layout.addComponent(overviewForm);
	return layout;
}
 
Example 17
Project: tinypounder   File: TinyPounderMainUI.java   Source Code and License 5 votes vote down vote up
private TextArea addConsole(String title, String key) {
  TextArea console = new TextArea();
  console.setData(key);
  console.setWidth(100, Unit.PERCENTAGE);
  console.setWordWrap(false);
  console.setStyleName("console");

  consoles.addTab(console, title);

  return console;
}
 
Example 18
Project: tinypounder   File: TinyPounderMainUI.java   Source Code and License 5 votes vote down vote up
private void startServer(String stripeName, String serverName, Button startBT, Button stopBT, Label stateLBL, Label pidLBL) {
  File stripeconfig = tcConfigLocationPerStripe.get(stripeName);
  if (stripeconfig == null) {
    generateXML(false);
    stripeconfig = tcConfigLocationPerStripe.get(stripeName);
  }

  File workDir = new File(settings.getKitPath());
  String key = stripeName + "-" + serverName;
  TextArea console = getConsole(key);

  RunningServer runningServer = new RunningServer(
      workDir, stripeconfig, serverName, console, 500,
      () -> {
        runningServers.remove(key);
        access(() -> {
          stopBT.setEnabled(false);
          startBT.setEnabled(true);
          pidLBL.setValue("");
          stateLBL.setValue("STOPPED");
        });
      },
      newState -> access(() -> stateLBL.setValue("STATE: " + newState)),
      newPID -> access(() -> pidLBL.setValue("PID: " + newPID))
  );

  if (runningServers.put(key, runningServer) != null) {
    Notification.show("ERROR", "Server is running: " + serverName, Notification.Type.ERROR_MESSAGE);
    return;
  }

  consoles.setSelectedTab(console);
  stateLBL.setValue("STARTING");
  runningServer.start();
  startBT.setEnabled(false);
  stopBT.setEnabled(true);
  runningServer.refreshConsole();
}
 
Example 19
Project: tinypounder   File: TinyPounderMainUI.java   Source Code and License 5 votes vote down vote up
private TextArea getConsole(String key) throws NoSuchElementException {
  for (Component console : consoles) {
    if (key.equals(((AbstractComponent) console).getData())) {
      return (TextArea) console;
    }
  }
  throw new NoSuchElementException("No console found for " + key);
}
 
Example 20
Project: tinypounder   File: RunningServer.java   Source Code and License 5 votes vote down vote up
RunningServer(File workDir, File stripeconfig, String serverName, TextArea console, int maxLines, Runnable onStop, Consumer<String> onState, Consumer<Long> onPID) {
  this.workDir = workDir;
  this.stripeconfig = stripeconfig;
  this.serverName = serverName;
  this.lines = new ArrayBlockingQueue<>(maxLines);
  this.console = console;
  this.onStop = onStop;
  this.onState = onState;
  this.onPID = onPID;
}
 
Example 21
Project: incubator-tamaya-sandbox   File: AbstractTextInfoProvider.java   Source Code and License 5 votes vote down vote up
@Override
public void addSystemInfo(Accordion systemInfoPanel) {
    VerticalLayout layout = new VerticalLayout();
    textArea = new TextArea("System Info");
    textArea.addStyleName(UIConstants.FIXED_FONT);
    textArea.setValue(getInfo());
    textArea.setRows(20);
    textArea.setHeight("400px");
    textArea.setWidth("100%");
    layout.addComponents(textArea);
    systemInfoPanel.addTab(layout, getCaption());
}
 
Example 22
Project: vaadin-vertx-samples   File: DashboardView.java   Source Code and License 5 votes vote down vote up
private Component buildNotes() {
    TextArea notes = new TextArea("Notes");
    notes.setValue("Remember to:\n· Zoom in and out in the Sales view\n· Filter the transactions and drag a set of them to the Reports tab\n· Create a new report\n· Change the schedule of the movie theater");
    notes.setSizeFull();
    notes.addStyleName(ValoTheme.TEXTAREA_BORDERLESS);
    Component panel = createContentWrapper(notes);
    panel.addStyleName("notes");
    return panel;
}
 
Example 23
Project: businesshorizon2   File: ProjectCreationViewImpl.java   Source Code and License 5 votes vote down vote up
/**
	 * Diese Methode erstellt das UI, bestehend aus Inputfeld für Projektname und
	 * Projektbeschreibung.
	 *
	 * @author Marco Glaser
	 */
	public void generateUi(){
		setWidth(95, UNITS_PERCENTAGE);
		setHeight(SIZE_UNDEFINED, 0);
		setStyleName("projectCreationLayout");
		
		projectNameInput = new TextField();
		projectDescriptionInput = new TextArea();
		gap = new Label();
		secondGap = new Label();
		
		projectNameInput.setWidth(80, UNITS_PERCENTAGE);
//		projectNameInput.setHeight(30, UNITS_PIXELS);
		projectNameInput.setStyleName("projectNameInput");
		projectDescriptionInput.setWidth(80, UNITS_PERCENTAGE);
		projectDescriptionInput.setHeight(300, UNITS_PIXELS);
		projectDescriptionInput.setStyleName("projectNameInput");
		gap.setHeight("20px");
		secondGap.setSizeFull();
		
		projectNameInput.setValue("Geben Sie hier den Projektnamen ein.");
		projectDescriptionInput.setValue("Geben Sie hier eine Beschreibung des Projekts ein.");
		
		addComponent(projectNameInput);
		addComponent(gap);
		addComponent(projectDescriptionInput);
		
		projectNameInput.setCaption("Projektname");
		projectNameInput.setValue("Geben Sie hier den Projektnamen ein.");
		projectDescriptionInput.setCaption("Projektbeschreibung");
		projectDescriptionInput.setValue("Geben Sie hier eine Projektbeschreibung ein");
//		addComponent(secondGap);
//		setExpandRatio(secondGap, 1.0f);
	}
 
Example 24
Project: incubator-openaz   File: PDPStatusWindow.java   Source Code and License 5 votes vote down vote up
protected TextArea	createTextArea(String value, int lines) {
	TextArea area = new TextArea();
	area.setValue(value);
	area.setNullRepresentation("");
	area.setSizeFull();
	area.setReadOnly(true);
	area.setRows(lines);
	return area;
}
 
Example 25
Project: incubator-openaz   File: GitSynchronizeWindow.java   Source Code and License 5 votes vote down vote up
@AutoGenerated
private VerticalLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new VerticalLayout();
	mainLayout.setImmediate(false);
	mainLayout.setWidth("-1px");
	mainLayout.setHeight("-1px");
	mainLayout.setMargin(true);
	mainLayout.setSpacing(true);
	
	// top-level component properties
	setWidth("-1px");
	setHeight("-1px");
	
	// textAreaResults
	textAreaResults = new TextArea();
	textAreaResults.setCaption("Synch Results");
	textAreaResults.setImmediate(false);
	textAreaResults.setWidth("462px");
	textAreaResults.setHeight("222px");
	mainLayout.addComponent(textAreaResults);
	
	// buttonSynchronize
	buttonSynchronize = new Button();
	buttonSynchronize.setCaption("Synchronize");
	buttonSynchronize.setImmediate(true);
	buttonSynchronize.setWidth("-1px");
	buttonSynchronize.setHeight("-1px");
	mainLayout.addComponent(buttonSynchronize);
	mainLayout.setComponentAlignment(buttonSynchronize, new Alignment(24));
	
	return mainLayout;
}
 
Example 26
Project: incubator-openaz   File: GitRepositoryContainer.java   Source Code and License 5 votes vote down vote up
/**
 * Gets the specified property's data type. "Name" is a <code>String</code>,
 * "Size" is a <code>Long</code>, "Last Modified" is a <code>Date</code>. If
 * propertyId is not one of those, <code>null</code> is returned.
 * 
 * @param propertyId
 *            the ID of the property whose type is requested.
 * @return data type of the requested property, or <code>null</code>
 */
@Override
public Class<?> getType(Object propertyId) {

    if (propertyId.equals(PROPERTY_NAME)) {
        return String.class;
    }
    if (propertyId.equals(PROPERTY_ICON)) {
        return Resource.class;
    }
    if (propertyId.equals(PROPERTY_SIZE)) {
        return Long.class;
    }
    if (propertyId.equals(PROPERTY_LASTMODIFIED)) {
        return Date.class;
    }
    if (propertyId.equals(PROPERTY_VERSION)) {
        return String.class;
    }
    if (propertyId.equals(PROPERTY_STATUS)) {
    	return TextArea.class;
    }
    if (propertyId.equals(PROPERTY_DATA)) {
    	return Object.class;
    }
    return null;
}
 
Example 27
Project: hawkbit   File: AddUpdateRolloutWindowLayout.java   Source Code and License 5 votes vote down vote up
private static TextArea createTargetFilterQuery() {
    final TextArea filterField = new TextAreaBuilder().style("text-area-style")
            .id(UIComponentIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD)
            .maxLengthAllowed(SPUILabelDefinitions.TARGET_FILTER_QUERY_TEXT_FIELD_LENGTH).buildTextComponent();

    filterField.setId(UIComponentIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD);
    filterField.setNullRepresentation("");
    filterField.setEnabled(false);
    filterField.setSizeUndefined();
    return filterField;
}
 
Example 28
Project: hawkbit   File: AddUpdateRolloutWindowLayout.java   Source Code and License 5 votes vote down vote up
private TextArea createDescription() {
    final TextArea descriptionField = new TextAreaBuilder().style("text-area-style")
            .prompt(i18n.getMessage("textfield.description")).id(UIComponentIdProvider.ROLLOUT_DESCRIPTION_ID)
            .buildTextComponent();
    descriptionField.setNullRepresentation("");
    descriptionField.setSizeUndefined();
    return descriptionField;
}
 
Example 29
Project: hawkbit   File: DefineGroupsLayout.java   Source Code and License 5 votes vote down vote up
private TextArea createTargetFilterQuery() {
    final TextArea filterField = new TextAreaBuilder().style("text-area-style")
            .id(UIComponentIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD)
            .maxLengthAllowed(SPUILabelDefinitions.TARGET_FILTER_QUERY_TEXT_FIELD_LENGTH).buildTextComponent();

    filterField.setNullRepresentation("");
    filterField.setEnabled(false);
    filterField.setSizeUndefined();
    return filterField;
}
 
Example 30
Project: hawkbit   File: CreateUpdateTypeLayout.java   Source Code and License 5 votes vote down vote up
/**
 * Set tag name and desc field border color based on chosen color.
 *
 * @param tagName
 * @param tagDesc
 * @param taregtTagColor
 */
private void createDynamicStyleForComponents(final TextField tagName, final TextField typeKey,
        final TextArea typeDesc, final String typeTagColor) {

    tagName.removeStyleName(SPUIDefinitions.TYPE_NAME);
    typeKey.removeStyleName(SPUIDefinitions.TYPE_KEY);
    typeDesc.removeStyleName(SPUIDefinitions.TYPE_DESC);
    getDynamicStyles(typeTagColor);
    tagName.addStyleName(TYPE_NAME_DYNAMIC_STYLE);
    typeKey.addStyleName(TYPE_NAME_DYNAMIC_STYLE);
    typeDesc.addStyleName(TYPE_DESC_DYNAMIC_STYLE);
}
 
Example 31
Project: hawkbit   File: AbstractCreateUpdateTagLayout.java   Source Code and License 5 votes vote down vote up
/**
 * Set tag name and desc field border color based on chosen color.
 *
 * @param tagName
 * @param tagDesc
 * @param taregtTagColor
 */
protected void createDynamicStyleForComponents(final TextField tagName, final TextArea tagDesc,
        final String taregtTagColor) {

    tagName.removeStyleName(SPUIDefinitions.TAG_NAME);
    tagDesc.removeStyleName(SPUIDefinitions.TAG_DESC);
    getTargetDynamicStyles(taregtTagColor);
    tagName.addStyleName(TAG_NAME_DYNAMIC_STYLE);
    tagDesc.addStyleName(TAG_DESC_DYNAMIC_STYLE);
}
 
Example 32
Project: hawkbit   File: TargetBulkUpdateWindowLayout.java   Source Code and License 5 votes vote down vote up
private TextArea getDescriptionTextArea() {
    final TextArea description = new TextAreaBuilder().caption(i18n.getMessage("textfield.description"))
            .style("text-area-style").prompt(i18n.getMessage("textfield.description")).immediate(true)
            .id(UIComponentIdProvider.BULK_UPLOAD_DESC).buildTextComponent();
    description.setNullRepresentation("");
    description.setWidth("100%");
    return description;
}
 
Example 33
Project: hawkbit   File: AbstractMetadataPopupLayout.java   Source Code and License 5 votes vote down vote up
private TextArea createValueTextField() {
    valueTextArea = new TextAreaBuilder().caption(i18n.getMessage("textfield.value")).required(true)
            .prompt(i18n.getMessage("textfield.value")).immediate(true).id(UIComponentIdProvider.METADATA_VALUE_ID)
            .maxLengthAllowed(MetaData.VALUE_MAX_SIZE).buildTextComponent();
    valueTextArea.setNullRepresentation("");
    valueTextArea.setSizeFull();
    valueTextArea.setHeight(100, Unit.PERCENTAGE);
    valueTextArea.addTextChangeListener(this::onValueChange);
    valueTextArea.setTextChangeEventMode(TextChangeEventMode.EAGER);
    return valueTextArea;
}
 
Example 34
Project: cia   File: CommitteeRankingOverviewPageModContentFactoryImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Creates the description.
 *
 * @return the text area
 */
private static TextArea createDescription() {
	final TextArea totalCommitteeRankinglistLabel = new TextArea(COMMITTEE_RANKING_BY_TOPIC,
			COMMITTEE_RANKING_BY_TOPIC_DESCRIPTION);
	totalCommitteeRankinglistLabel.setSizeFull();
	totalCommitteeRankinglistLabel.setStyleName("Level2Header");
	return totalCommitteeRankinglistLabel;
}
 
Example 35
Project: cia   File: MinistryRankingOverviewPageModContentFactoryImpl.java   Source Code and License 5 votes vote down vote up
/**
 * Creates the description.
 *
 * @return the text area
 */
private static TextArea createDescription() {
	final TextArea totalCommitteeRankinglistLabel = new TextArea(MINISTRY_RANKING_BY_TOPIC,
			MINISTRY_RANKING_BY_TOPIC_DESCRIPTION);
	totalCommitteeRankinglistLabel.setSizeFull();
	totalCommitteeRankinglistLabel.setStyleName("Level2Header");
	return totalCommitteeRankinglistLabel;
}
 
Example 36
Project: Vaadin-Prime-Count   File: OutcomeOfUserStory.java   Source Code and License 5 votes vote down vote up
public OutcomeOfUserStory(final AbstractPrototypeComponent parent)
{
    super(parent, new VerticalLayout());
    this.txta4Result = new TextArea("Ouput");
    this.fieldSet = new HashSet<>(2);
    this.fieldSet.add(this.txta4Result);
    defineWithin(this.layout);
}
 
Example 37
Project: SecureBPMN   File: NewCasePopupWindow.java   Source Code and License 5 votes vote down vote up
protected void initForm() {
  form = new Form();
  form.setValidationVisibleOnCommit(true);
  form.setImmediate(true);
  addComponent(form);
  
  // name
  nameField = new TextField(i18nManager.getMessage(Messages.TASK_NAME));
  nameField.focus();
  nameField.setRequired(true);
  nameField.setRequiredError(i18nManager.getMessage(Messages.TASK_NAME_REQUIRED));
  form.addField("name", nameField);
  
  // description
  descriptionArea = new TextArea(i18nManager.getMessage(Messages.TASK_DESCRIPTION));
  descriptionArea.setColumns(25);
  form.addField("description", descriptionArea);
  
  // duedate
  dueDateField = new DateField(i18nManager.getMessage(Messages.TASK_DUEDATE));
  dueDateField.setResolution(DateField.RESOLUTION_DAY);
  form.addField("duedate", dueDateField);
  
  // priority
  priorityComboBox = new PriorityComboBox(i18nManager);
  form.addField("priority", priorityComboBox);
}
 
Example 38
Project: vaadin-jsclipboard-addon   File: DeprecatedWayView.java   Source Code and License 5 votes vote down vote up
private void createOldWayCopyToClipboard() {

        Label label = new Label(
                "This variant  will be removed, see <a target=\"_blank\" href=\"https://github.com/vaadin4qbanos/vaadin-jsclipboard-addon/blob/master/README.md\">README</a><br>"
                + "This variant was done using the library <a href='https://clipboardjs.com/' >clipboard.js</a> as a Component");
        label.setContentMode(ContentMode.HTML);

        final TextArea anotherArea = new TextArea();
        anotherArea.setId("clipboardTarget");
        anotherArea.setValue("Another example to copy to clipboard");

        ClipboardButton clipboardButton = new ClipboardButton("clipboardTarget");
        clipboardButton.addSuccessListener(() -> {
            Notification.show("Copy to clipboard successful");
        });
        clipboardButton.addErrorListener(() -> {
            Notification.show("Copy to clipboard unsuccessful", Notification.Type.ERROR_MESSAGE);
        });

        Button source = new Button(VaadinIcons.CODE);
        source.addClickListener((Button.ClickEvent event) -> {
            Window win = createOldWaySourceWindow();
            win.setModal(true);
            UI.getCurrent().addWindow(win);
        });

        VerticalLayout wrapper = new VerticalLayout();
        wrapper.setSpacing(true);
        wrapper.setDefaultComponentAlignment(Alignment.TOP_CENTER);
        wrapper.setWidth("100%");
        wrapper.addComponents(new HorizontalLayout(label), anotherArea, clipboardButton, source);
        addComponent(wrapper);
    }
 
Example 39
Project: vaadin-jsclipboard-addon   File: TextAreaView.java   Source Code and License 5 votes vote down vote up
@Override
public Component getTargetComponent() {
    final TextArea textArea = new TextArea();
    textArea.setSizeFull();
    textArea.setValue("Copy to clipboard textarea value....");
    textArea.setId("tocopie-textarea");
    return textArea;
}
 
Example 40
Project: metl   File: AppUI.java   Source Code and License 5 votes vote down vote up
public ErrorWindow(String intro, String message) {
    super("Error");
    setWidth(600f, Unit.PIXELS);
    setHeight(300f, Unit.PIXELS);
    content.setMargin(true);

    HorizontalLayout layout = new HorizontalLayout();
    Label icon = new Label();
    icon.setIcon(new ThemeResource("images/error.png"));
    icon.setWidth(70f, Unit.PIXELS);
    layout.addComponent(icon);

    Label labelIntro = new Label(intro, ContentMode.HTML);
    labelIntro.setStyleName("large");
    labelIntro.setWidth(530f, Unit.PIXELS);
    layout.addComponent(labelIntro);
    addComponent(layout);

    TextArea textField = new TextArea();
    textField.setSizeFull();
    textField.setWordwrap(false);
    textField.setValue(message);
    addComponent(textField);
    content.setExpandRatio(textField, 1.0f);

    addComponent(buildButtonFooter(buildCloseButton()));
}