com.vaadin.ui.TextArea Java Examples

The following examples show how to use com.vaadin.ui.TextArea. 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: LogLayout.java    From usergrid with Apache License 2.0 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 #2
Source File: ProjectRoleAddViewImpl.java    From mycollab with GNU Affero General Public License v3.0 6 votes vote down vote up
@Override
protected AbstractBeanFieldGroupEditFieldFactory<ProjectRole> initBeanFormFieldFactory() {
    return new AbstractBeanFieldGroupEditFieldFactory<ProjectRole>(editForm) {
        private static final long serialVersionUID = 1L;

        @Override
        protected HasValue<?> onCreateField(Object propertyId) {
            if (propertyId.equals("description")) {
                return new TextArea();
            } else if (propertyId.equals("rolename")) {
                return new MTextField().withRequiredIndicatorVisible(true);
            }
            return null;
        }
    };
}
 
Example #3
Source File: ActionStatusMsgGrid.java    From hawkbit with Eclipse Public License 1.0 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
Source File: DecisionFlowChartManagerImpl.java    From cia with Apache License 2.0 6 votes vote down vote up
@Override
public TextArea createCommitteeeDecisionSummary(final Map<String, List<ViewRiksdagenCommittee>> committeeMap,final String rm) {		
	final TextArea area = new TextArea("Summary");
	final StringBuilder stringBuilder = new StringBuilder();
	final List<ProposalCommitteeeSummary> createCommitteeSummary = decisionDataFactory.createCommitteeSummary(rm);
	
	final Map<String, List<ProposalCommitteeeSummary>> orgProposalMap = createCommitteeSummary.stream()
			.collect(Collectors.groupingBy(ProposalCommitteeeSummary::getOrg));

	for (final Entry<String, List<ProposalCommitteeeSummary>> entry : orgProposalMap.entrySet()) {			
		if (committeeMap.containsKey(entry.getKey())) {
			addCommiteeSummary(stringBuilder, entry, committeeMap.get(entry.getKey()).stream().findFirst());
		}
	}
	area.setValue(stringBuilder.toString());
	return area;
}
 
Example #5
Source File: PartyRankingOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 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
Source File: PoliticianRankingOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 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
Source File: FormUtils.java    From jdal with Apache License 2.0 5 votes vote down vote up
/** 
 * Create a new TextArea with current locale from {@link LocaleContextHolder}
 * @return a new TextArea
 */
public static TextArea newTextArea() {
	TextArea area = new TextArea();
	area.setNullRepresentation("");
	area.setLocale(LocaleContextHolder.getLocale());
	
	return area;
}
 
Example #8
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private static TextArea createTargetFilterQuery() {
    final TextArea filterField = new TextAreaBuilder(TargetFilterQuery.QUERY_MAX_SIZE).style("text-area-style")
            .id(UIComponentIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD).buildTextComponent();

    filterField.setId(UIComponentIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD);
    filterField.setEnabled(false);
    filterField.setSizeUndefined();
    return filterField;
}
 
Example #9
Source File: BasicModel.java    From chipster with MIT License 5 votes vote down vote up
private void initElements() {
	
	lbName = new Label("Display name:");
	lbId = new Label();
	lbDescription = new Label("Description:");
	lbOptional = new Label("Optional:");
	
	name = new TextField();
	name.setWidth(WIDTH);
	name.setDescription("Display name for the element");
	name.setImmediate(true);
	name.addTextChangeListener(new CSCTextChangeListener(this));
	
	id = new TextField();
	id.setDescription("file name or unique identification");
	id.setImmediate(true);
	id.setRequired(true);
	id.setRequiredError(REQUIRED_TEXT);
	id.setWidth(WIDTH);
	id.addTextChangeListener(new CSCTextChangeListener(this, true));
	
	description = new TextArea();
	description.setWidth(WIDTH);
	description.setDescription("Short description");
	
	layout = new HorizontalLayout();
	
	prefix = new TextField();
	postfix = new TextField();
	
	layout.addComponent(prefix);
	layout.addComponent(new Label(MULTI_FILE_TEXT));
	layout.addComponent(postfix);
	
	optional = new CheckBox();
	optional.setDescription("Is this element optional");
	optional.setImmediate(true);
}
 
Example #10
Source File: TextEditor.java    From chipster with MIT License 5 votes vote down vote up
private void init() {
	txtArea = new TextArea();
	txtArea.setSizeFull();
	// for some reasons size full does not do anything to height
	txtArea.setRows(50);
	
	this.addComponent(txtArea);
}
 
Example #11
Source File: GitRepositoryContainer.java    From XACML with MIT 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 #12
Source File: GitSynchronizeWindow.java    From XACML with MIT 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 #13
Source File: PDPStatusWindow.java    From XACML with MIT 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 #14
Source File: ProjectMemberInviteViewImpl.java    From mycollab with GNU Affero General Public License v3.0 5 votes vote down vote up
private void initContent() {
    this.removeAllComponents();

    roleComboBox = new ProjectRoleComboBox();
    roleComboBox.addValueChangeListener(valueChangeEvent -> {
        SimpleProjectRole role = roleComboBox.getValue();
        displayRolePermission(role);
    });

    AddViewLayout userAddLayout = new AddViewLayout(UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_INVITE_MEMBERS), VaadinIcons.USER);
    userAddLayout.addHeaderRight(createButtonControls());

    GridFormLayoutHelper informationLayout = GridFormLayoutHelper.defaultFormLayoutHelper(LayoutType.ONE_COLUMN);

    inviteUserTokenField = new InviteUserTokenField();
    informationLayout.addComponent(new MVerticalLayout(inviteUserTokenField, new ELabel(UserUIContext.getMessage
                    (ProjectMemberI18nEnum.USER_TOKEN_INVITE_HINT)).withFullWidth().withStyleName(WebThemes.META_INFO)).withMargin(false),
            UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_INVITEES_EMAIL), 0, 0);
    informationLayout.addComponent(roleComboBox, UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_ROLE), 0, 1);

    messageArea = new TextArea();
    messageArea.setValue(UserUIContext.getMessage(ProjectMemberI18nEnum.MSG_DEFAULT_INVITATION_COMMENT));
    informationLayout.addComponent(messageArea, UserUIContext.getMessage(ProjectMemberI18nEnum.FORM_MESSAGE), 0, 2);

    userAddLayout.addBody(informationLayout.getLayout());
    userAddLayout.addBottom(createBottomPanel());
    this.addComponent(userAddLayout);

    roleComboBox.setDefaultValue();
}
 
Example #15
Source File: MinistryRankingOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 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 #16
Source File: ParliamentDecisionFlowPageModContentFactoryImpl.java    From cia with Apache License 2.0 5 votes vote down vote up
@Secured({ "ROLE_ANONYMOUS", "ROLE_USER", "ROLE_ADMIN" })
@Override
public Layout createContent(final String parameters, final MenuBar menuBar, final Panel panel) {
	final VerticalLayout panelContent = createPanelContent();
	getParliamentMenuItemFactory().createParliamentTopicMenu(menuBar);

	String selectedYear = "2018/19";
	if (parameters != null && parameters.contains("[") && parameters.contains("]")) {
		selectedYear = parameters.substring(parameters.indexOf('[') + 1, parameters.lastIndexOf(']'));
	} 
	
	final DataContainer<ViewRiksdagenCommittee, String> dataContainer = getApplicationManager()
			.getDataContainer(ViewRiksdagenCommittee.class);
	final List<ViewRiksdagenCommittee> allCommittess = dataContainer.getAll();

	final Map<String, List<ViewRiksdagenCommittee>> committeeMap = allCommittess.stream().collect(Collectors.groupingBy(c -> c.getEmbeddedId().getOrgCode().toUpperCase(Locale.ENGLISH)));
	
	final ComboBox<String> comboBox = new ComboBox<>("Select year", Collections.unmodifiableList(Arrays.asList("2018/19","2017/18","2016/17","2015/16","2014/15","2013/14","2012/13","2011/12","2010/11")));
	panelContent.addComponent(comboBox);
	panelContent.setExpandRatio(comboBox, ContentRatio.SMALL);
	comboBox.setSelectedItem(selectedYear);
	comboBox.addValueChangeListener(new DecisionFlowValueChangeListener(NAME,""));
	
	final SankeyChart chart = decisionFlowChartManager.createAllDecisionFlow(committeeMap,comboBox.getSelectedItem().orElse(selectedYear));
	panelContent.addComponent(chart);
	panelContent.setExpandRatio(chart, ContentRatio.LARGE);

	final TextArea textarea = decisionFlowChartManager.createCommitteeeDecisionSummary(committeeMap,comboBox.getSelectedItem().orElse(selectedYear));
	textarea.setSizeFull();
	panelContent.addComponent(textarea);
	panelContent.setExpandRatio(textarea, ContentRatio.SMALL_GRID);


	getPageActionEventHelper().createPageEvent(ViewAction.VISIT_PARLIAMENT_RANKING_VIEW, ApplicationEventGroup.USER, NAME,
			parameters, selectedYear);
	panel.setCaption(new StringBuilder().append(NAME).append("::").append(PARLIAMENT_DECISION_FLOW).toString());

	return panelContent;

}
 
Example #17
Source File: DefineGroupsLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextArea createTargetFilterQuery() {
    final TextArea filterField = new TextAreaBuilder(TargetFilterQuery.QUERY_MAX_SIZE).style("text-area-style")
            .id(UIComponentIdProvider.ROLLOUT_TARGET_FILTER_QUERY_FIELD).buildTextComponent();

    filterField.setEnabled(false);
    filterField.setSizeUndefined();
    return filterField;
}
 
Example #18
Source File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 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 #19
Source File: AbstractMetadataPopupLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextArea createValueTextField() {
    valueTextArea = new TextAreaBuilder(MetaData.VALUE_MAX_SIZE).caption(i18n.getMessage("textfield.value"))
            .required(true, i18n).id(UIComponentIdProvider.METADATA_VALUE_ID).buildTextComponent();
    valueTextArea.setSizeFull();
    valueTextArea.setHeight(100, Unit.PERCENTAGE);
    valueTextArea.addTextChangeListener(this::onValueChange);
    valueTextArea.setTextChangeEventMode(TextChangeEventMode.LAZY);
    valueTextArea.setTextChangeTimeout(INPUT_DEBOUNCE_TIMEOUT);
    return valueTextArea;
}
 
Example #20
Source File: AbstractTypeLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private static 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 #21
Source File: TargetBulkUpdateWindowLayout.java    From hawkbit with Eclipse Public License 1.0 5 votes vote down vote up
private TextArea getDescriptionTextArea() {
    final TextArea description = new TextAreaBuilder(Target.DESCRIPTION_MAX_SIZE)
            .caption(i18n.getMessage("textfield.description")).style("text-area-style")
            .id(UIComponentIdProvider.BULK_UPLOAD_DESC).buildTextComponent();
    description.setWidth("100%");
    return description;
}
 
Example #22
Source File: CommitteeRankingOverviewPageModContentFactoryImpl.java    From cia with Apache License 2.0 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 #23
Source File: RuleEditorWindow.java    From XACML with MIT License 4 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");
	
	// labelRuleID
	labelRuleID = new Label();
	labelRuleID.setCaption("Rule ID");
	labelRuleID.setImmediate(false);
	labelRuleID.setWidth("100.0%");
	labelRuleID.setHeight("-1px");
	labelRuleID.setValue("Label");
	mainLayout.addComponent(labelRuleID);
	mainLayout.setExpandRatio(labelRuleID, 1.0f);
	
	// optionGroupEffect
	optionGroupEffect = new OptionGroup();
	optionGroupEffect.setCaption("Choose the effect.");
	optionGroupEffect.setImmediate(false);
	optionGroupEffect.setWidth("-1px");
	optionGroupEffect.setHeight("-1px");
	optionGroupEffect.setInvalidAllowed(false);
	optionGroupEffect.setRequired(true);
	mainLayout.addComponent(optionGroupEffect);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Enter a description for the Rule.");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100.0%");
	textAreaDescription.setHeight("-1px");
	textAreaDescription.setNullSettingAllowed(true);
	textAreaDescription.setNullRepresentation("");
	mainLayout.addComponent(textAreaDescription);
	mainLayout.setExpandRatio(textAreaDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example #24
Source File: AddUpdateRolloutWindowLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
private static TextArea createDescription() {
    final TextArea descriptionField = new TextAreaBuilder(Rollout.DESCRIPTION_MAX_SIZE).style("text-area-style")
            .id(UIComponentIdProvider.ROLLOUT_DESCRIPTION_ID).buildTextComponent();
    descriptionField.setSizeUndefined();
    return descriptionField;
}
 
Example #25
Source File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
protected TextArea getTagDesc() {
    return tagDesc;
}
 
Example #26
Source File: AbstractTagLayout.java    From hawkbit with Eclipse Public License 1.0 4 votes vote down vote up
protected void setTagDesc(final TextArea tagDesc) {
    this.tagDesc = tagDesc;
}
 
Example #27
Source File: PolicySetEditorWindow.java    From XACML with MIT License 4 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");
	
	// labelID
	labelID = new Label();
	labelID.setCaption("Policy Set ID");
	labelID.setImmediate(false);
	labelID.setWidth("100.0%");
	labelID.setHeight("-1px");
	labelID.setValue("Label");
	mainLayout.addComponent(labelID);
	
	// textFieldVersion
	textFieldVersion = new TextField();
	textFieldVersion.setCaption("Version");
	textFieldVersion.setImmediate(false);
	textFieldVersion
			.setDescription("The format is numbers only separated by decimal point.");
	textFieldVersion.setWidth("-1px");
	textFieldVersion.setHeight("-1px");
	textFieldVersion.setInvalidAllowed(false);
	textFieldVersion.setRequired(true);
	textFieldVersion.setInputPrompt("Eg. 1 or 1.0 or 1.0.0 etc.");
	mainLayout.addComponent(textFieldVersion);
	
	// listSelectAlgorithm
	listSelectAlgorithm = new ListSelect();
	listSelectAlgorithm.setCaption("Policy Combining Algorithm");
	listSelectAlgorithm.setImmediate(false);
	listSelectAlgorithm.setWidth("100.0%");
	listSelectAlgorithm.setHeight("-1px");
	listSelectAlgorithm.setInvalidAllowed(false);
	listSelectAlgorithm.setRequired(true);
	mainLayout.addComponent(listSelectAlgorithm);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100.0%");
	textAreaDescription.setHeight("-1px");
	mainLayout.addComponent(textAreaDescription);
	mainLayout.setExpandRatio(textAreaDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example #28
Source File: EditPDPWindow.java    From XACML with MIT License 4 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");
	
	// textId
	textId = new TextField();
	textId.setCaption("PDP URL");
	textId.setImmediate(false);
	textId.setDescription("The URL is the ID of the PDP");
	textId.setWidth("-1px");
	textId.setHeight("-1px");
	textId.setRequired(true);
	textId.setInputPrompt("Eg. http://localhost:8080/pdp");
	mainLayout.addComponent(textId);
	
	// textName
	textName = new TextField();
	textName.setCaption("PDP Name");
	textName.setImmediate(false);
	textName.setWidth("-1px");
	textName.setHeight("-1px");
	mainLayout.addComponent(textName);
	
	// textDescription
	textDescription = new TextArea();
	textDescription.setCaption("PDP Description");
	textDescription.setImmediate(false);
	textDescription.setWidth("100.0%");
	textDescription.setHeight("-1px");
	textDescription.setNullSettingAllowed(true);
	mainLayout.addComponent(textDescription);
	mainLayout.setExpandRatio(textDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}
 
Example #29
Source File: PolicyNameEditorWindow.java    From XACML with MIT License 4 votes vote down vote up
@AutoGenerated
private FormLayout buildMainLayout() {
	// common part: create layout
	mainLayout = new FormLayout();
	mainLayout.setImmediate(false);
	
	// textFieldPolicyName
	textFieldPolicyName = new TextField();
	textFieldPolicyName.setCaption("Policy File Name");
	textFieldPolicyName.setImmediate(true);
	textFieldPolicyName.setWidth("-1px");
	textFieldPolicyName.setHeight("-1px");
	textFieldPolicyName.setInputPrompt("Enter filename eg. foobar.xml");
	textFieldPolicyName.setRequired(true);
	mainLayout.addComponent(textFieldPolicyName);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100%");
	textAreaDescription.setHeight("-1px");
	textAreaDescription
			.setInputPrompt("Enter a description for the Policy/PolicySet.");
	textAreaDescription.setNullSettingAllowed(true);
	mainLayout.addComponent(textAreaDescription);
	
	// optionPolicySet
	optionPolicySet = new OptionGroup();
	optionPolicySet.setCaption("Policy or PolicySet?");
	optionPolicySet.setImmediate(true);
	optionPolicySet
			.setDescription("Is the root level a Policy or Policy Set.");
	optionPolicySet.setWidth("-1px");
	optionPolicySet.setHeight("-1px");
	optionPolicySet.setRequired(true);
	mainLayout.addComponent(optionPolicySet);
	
	// comboAlgorithms
	comboAlgorithms = new ComboBox();
	comboAlgorithms.setCaption("Combining Algorithm");
	comboAlgorithms.setImmediate(false);
	comboAlgorithms.setDescription("Select the combining algorithm.");
	comboAlgorithms.setWidth("-1px");
	comboAlgorithms.setHeight("-1px");
	comboAlgorithms.setRequired(true);
	mainLayout.addComponent(comboAlgorithms);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));

	return mainLayout;
}
 
Example #30
Source File: PolicyEditorWindow.java    From XACML with MIT License 4 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");
	
	// labelID
	labelID = new Label();
	labelID.setCaption("Policy Set ID");
	labelID.setImmediate(false);
	labelID.setWidth("100.0%");
	labelID.setHeight("-1px");
	labelID.setValue("Label");
	mainLayout.addComponent(labelID);
	
	// textFieldVersion
	textFieldVersion = new TextField();
	textFieldVersion.setCaption("Version");
	textFieldVersion.setImmediate(false);
	textFieldVersion
			.setDescription("The format is numbers only separated by decimal point.");
	textFieldVersion.setWidth("-1px");
	textFieldVersion.setHeight("-1px");
	textFieldVersion.setInvalidAllowed(false);
	textFieldVersion.setRequired(true);
	textFieldVersion.setInputPrompt("Eg. 1 or 1.0 or 1.0.0 etc.");
	mainLayout.addComponent(textFieldVersion);
	
	// listSelectAlgorithm
	listSelectAlgorithm = new ListSelect();
	listSelectAlgorithm.setCaption("Policy Combining Algorithm");
	listSelectAlgorithm.setImmediate(false);
	listSelectAlgorithm.setWidth("100.0%");
	listSelectAlgorithm.setHeight("-1px");
	listSelectAlgorithm.setInvalidAllowed(false);
	listSelectAlgorithm.setRequired(true);
	mainLayout.addComponent(listSelectAlgorithm);
	
	// textAreaDescription
	textAreaDescription = new TextArea();
	textAreaDescription.setCaption("Description");
	textAreaDescription.setImmediate(false);
	textAreaDescription.setWidth("100.0%");
	textAreaDescription.setHeight("-1px");
	mainLayout.addComponent(textAreaDescription);
	mainLayout.setExpandRatio(textAreaDescription, 1.0f);
	
	// buttonSave
	buttonSave = new Button();
	buttonSave.setCaption("Save");
	buttonSave.setImmediate(true);
	buttonSave.setWidth("-1px");
	buttonSave.setHeight("-1px");
	mainLayout.addComponent(buttonSave);
	mainLayout.setComponentAlignment(buttonSave, new Alignment(48));
	
	return mainLayout;
}