Java Code Examples for org.eclipse.swt.custom.CLabel#setText()

The following examples show how to use org.eclipse.swt.custom.CLabel#setText() . 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: BonitaCompareEditorInput.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
public Control createContents(final Composite parent) {
    final CLabel label = new CLabel(parent, SWT.NONE);
    final String lastArgumentWithConditionOrNot = canBeContainedInScript
            ? " " + Messages.reviewChangesMessageWithConditionPlace : "";
    if (operationType == RefactoringOperationType.UPDATE) {
        if (elementName.equals(newName)) {
            label.setText(Messages.bind(Messages.reviewTypeChangesMessageRefactoring,
                    new String[] { elementName, lastArgumentWithConditionOrNot }));
        } else {
            label.setText(Messages.bind(Messages.reviewChangesMessageRefactoring,
                    new String[] { elementName, newName, lastArgumentWithConditionOrNot }));
        }

    } else {
        label.setText(Messages.bind(Messages.reviewChangesMessageRemoving, elementName, lastArgumentWithConditionOrNot));
    }
    label.setImage(Display.getCurrent().getSystemImage(SWT.ICON_WARNING));
    return super.createContents(parent);
}
 
Example 2
Source File: ComponentRiskThresholds.java    From arx with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a label for a knob
 * @param root
 * @param knob
 */
private CLabel createLabel(final Composite root, 
                           final Knob<Double> knob) {

    // Label
    String text = "100%"; //$NON-NLS-1$
    final CLabel label = new CLabel(root, SWT.NONE);
    label.setText(text);
    label.setAlignment(SWT.LEFT);
    label.setLayoutData(SWTUtil.createFillGridData());
    label.setToolTipText(text);
    
    // Listen
    knob.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent arg0) {
            updateLabel(knob, label);
        }
    });
    
    // Return
    return label;
}
 
Example 3
Source File: DeployRequiredControl.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
public DeployRequiredControl(Composite parent, AbstractBdmFormPage formPage, GridData gridData) {
    super(parent, SWT.NONE);
    setLayout(GridLayoutFactory.fillDefaults().create());
    setLayoutData(gridData);
    formPage.getToolkit().adapt(this);

    Group group = new Group(this, SWT.NONE);
    group.setLayout(GridLayoutFactory.fillDefaults().create());
    group.setLayoutData(GridDataFactory.fillDefaults().create());

    CLabel label = new CLabel(group, SWT.WRAP);
    label.setLayoutData(GridDataFactory.fillDefaults().create());
    label.setText(Messages.bdmDeployRequired);
    label.setImage(JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING));

    boolean show = formPage.getEditorContribution().observeDeployRequired().getValue();
    gridData.exclude = !show;
    setVisible(show);
}
 
Example 4
Source File: CreateContractInputFromBusinessObjectWizardPage.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private void createReminderText(final EMFDataBindingContext dbc, final Composite composite) {
    final CLabel reminder = new CLabel(composite, SWT.NONE);
    final Display d = Display.getCurrent();
    final Image img = d.getSystemImage(SWT.ICON_WARNING);
    reminder.setImage(img);
    reminder.setLayoutData(GridDataFactory.fillDefaults().hint(600, SWT.DEFAULT).create());
    final Button autoGeneratedOperationButton = new Button(composite, SWT.RADIO);
    final Button manuallyDefinedOperationButton = new Button(composite, SWT.RADIO);
    actionObservable = new SelectObservableValue<>(Boolean.class);
    actionObservable.addOption(Boolean.TRUE, WidgetProperties.selection().observe(autoGeneratedOperationButton));
    actionObservable.addOption(Boolean.FALSE, WidgetProperties.selection().observe(manuallyDefinedOperationButton));
    if (contract.eContainer() instanceof Task) {
        reminder.setText(Messages.reminderForStepMessage);
        autoGeneratedOperationButton.setText(Messages.autoGeneratedOperationStepButton);
        manuallyDefinedOperationButton.setText(Messages.manuallyDefinedOperationStepButton);
    } else {
        reminder.setText(Messages.reminderForProcessMessage);
        autoGeneratedOperationButton.setText(Messages.autoGeneratedOperationProcessButton);
        manuallyDefinedOperationButton.setText(Messages.manuallyDefinedOperationProcessButton);
    }
    dbc.bindValue(actionObservable, generationOptions.getAutoGeneratedScriptObservable());
}
 
Example 5
Source File: ViewFilterDialog.java    From tracecompass with Eclipse Public License 2.0 6 votes vote down vote up
private void createCLabels(Composite parent, Composite labels, String currentRegex) {
    CLabel filter = new CLabel(labels, SWT.BORDER);
    filter.setText(currentRegex);
    filter.setImage(PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_TOOL_DELETE));
    filter.setBackground(fColorScheme.getColor(TimeGraphColorScheme.TOOL_BACKGROUND));
    filter.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDown(MouseEvent e2) {
            deleteCLabel(parent, filter, e2);
        }
    });

    parent.layout();
    Rectangle bounds = parent.getShell().getBounds();
    Point size = parent.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    Rectangle trim = parent.getShell().computeTrim(0, 0, size.x, size.y);
    parent.getShell().setBounds(bounds.x + bounds.width - trim.width, bounds.y + bounds.height - trim.height, trim.width, trim.height);
}
 
Example 6
Source File: DayEditor.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * (non-API) Method initializeColumnHeaders. Called internally when the column
 * header text needs to be updated.
 *
 * @param columns
 *            A LinkedList of CLabels representing the column objects
 */
protected void refreshColumnHeaders(LinkedList<CLabel> columns) {
	Date startDate = getStartDate();
	GregorianCalendar gc = new GregorianCalendar();
	gc.setTime(startDate);

	SimpleDateFormat formatter = new SimpleDateFormat("EE, MMM d");
	formatter.applyLocalizedPattern(formatter.toLocalizedPattern());

	for (Iterator<CLabel> iter = columns.iterator(); iter.hasNext();) {
		CLabel headerLabel = iter.next();
		headerLabel.setText(formatter.format(gc.getTime()));
		gc.add(Calendar.DATE, 1);
	}
}
 
Example 7
Source File: ConstructorFieldPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private void createComboComp() {
    FillLayout fillLayout = new FillLayout();
    fillLayout.type = org.eclipse.swt.SWT.VERTICAL;
    GridData gridData7 = new GridData();
    gridData7.horizontalSpan = 2;
    gridData7.verticalAlignment = GridData.CENTER;
    gridData7.grabExcessHorizontalSpace = true;
    gridData7.horizontalAlignment = GridData.FILL;
    comboComp = new Composite(mainComp, SWT.NONE);
    comboComp.setLayoutData(gridData7);
    comboComp.setLayout(fillLayout);
    methodInsertionLbl = new CLabel(comboComp, SWT.NONE);
    methodInsertionLbl.setText(Messages.offsetStrategyInsertionPointMethod);
    methodInsertionComb = createComboViewer(comboComp);
    methodInsertionComb.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection sel = (IStructuredSelection) event.getSelection();
            if (!sel.isEmpty()) {
                OffsetStrategyModel elem = (OffsetStrategyModel) sel.getFirstElement();
                getRequestProcessor().setMethodDestination(elem.getStrategy());
            }
        }
    });

    getRequestProcessor().setMethodDestination(strategyProvider.get(0).getStrategy());
    methodInsertionComb.getCombo().select(0);
}
 
Example 8
Source File: DataBinding.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void initValue(Object bean, String property, CLabel label) {
	try {
		Object val = Bean.getValue(bean, property);
		String value = getValueAsString(val);
		label.setText(value);
	} catch (Exception e) {
		error("Cannot set label value", e);
	}
}
 
Example 9
Source File: OverrideMethodsPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private void createComboComp() {
    FillLayout fillLayout = new FillLayout();
    fillLayout.type = org.eclipse.swt.SWT.VERTICAL;
    GridData gridData7 = new GridData();
    gridData7.horizontalSpan = 2;
    gridData7.verticalAlignment = GridData.CENTER;
    gridData7.grabExcessHorizontalSpace = true;
    gridData7.horizontalAlignment = GridData.FILL;
    comboComp = new Composite(mainComp, SWT.NONE);
    comboComp.setLayoutData(gridData7);
    comboComp.setLayout(fillLayout);
    insertionPointLbl = new CLabel(comboComp, SWT.NONE);
    insertionPointLbl.setText(Messages.offsetStrategyInsertionPointMethod);
    insertionPointCmb = createComboViewer(comboComp);
    insertionPointCmb.addSelectionChangedListener(new ISelectionChangedListener() {
        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            IStructuredSelection sel = (IStructuredSelection) event.getSelection();
            if (!sel.isEmpty()) {
                OffsetStrategyModel elem = (OffsetStrategyModel) sel.getFirstElement();
                getRequestProcessor().setInsertionPoint(elem.getStrategy());
            }
        }
    });
    getRequestProcessor().setInsertionPoint(strategyProvider.get(0).getStrategy());
    insertionPointCmb.getCombo().select(0);
}
 
Example 10
Source File: AbstractEditor.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
protected Control createLabelParameterControl(final Composite comp) {
	fixedValue = new CLabel(comp, SWT.READ_ONLY | SWT.BORDER_SOLID);
	fixedValue.setForeground(IGamaColors.BLACK.color()); // force text color, see #2601
	fixedValue.setText(getOriginalValue() instanceof String ? (String) getOriginalValue()
			: StringUtils.toGaml(getOriginalValue(), false));
	// addToolbarHiders(fixedValue);
	return fixedValue;
}
 
Example 11
Source File: HistogramView.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private void updateLegendArea() {
    for (Control c: fLegendArea.getChildren()) {
        c.dispose();
    }
    disposeLegendImages();
    if (fFullTraceHistogram.showTraces()) {
        Collection<ITmfTrace> traces = TmfTraceManager.getTraceSet(fTrace);
        fLegendImages = new Image[traces.size()];
        int traceIndex = 0;
        for (ITmfTrace trace : traces) {
            fLegendImages[traceIndex] = new Image(fLegendArea.getDisplay(), 16, 16);
            GC gc = new GC(fLegendImages[traceIndex]);
            gc.setBackground(fFullTraceHistogram.getTraceColor(traceIndex));
            gc.fillRectangle(0, 0, 15, 15);
            gc.setForeground(fLegendArea.getDisplay().getSystemColor(SWT.COLOR_BLACK));
            gc.drawRectangle(0, 0, 15, 15);
            gc.dispose();

            CLabel label = new CLabel(fLegendArea, SWT.NONE);
            label.setText(trace.getName());
            label.setImage(fLegendImages[traceIndex]);
            traceIndex++;
        }
    }
    fLegendArea.layout();
    fLegendArea.getParent().layout();
}
 
Example 12
Source File: AbstractDialog.java    From ermasterr with Apache License 2.0 5 votes vote down vote up
protected void createErrorComposite(final Composite parent) {
    errorMessageText = new CLabel(parent, SWT.NONE);
    errorMessageText.setLeftMargin(0);
    errorMessageText.setText("");

    final GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.heightHint = 30 * getErrorLine();
    gridData.horizontalSpan = numColumns;

    errorMessageText.setLayoutData(gridData);
    errorMessageText.setForeground(ColorConstants.red);
}
 
Example 13
Source File: GeneratePropertiesPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private Composite createMainComp(Composite parent) {
    GridData gridData12 = new GridData();
    gridData12.horizontalSpan = 2;
    GridData gridData11 = new GridData();
    gridData11.horizontalSpan = 2;
    GridLayout gridLayout2 = new GridLayout();
    gridLayout2.numColumns = 2;
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalAlignment = GridData.FILL;
    mainComp = new Composite(parent, SWT.NONE);
    mainComp.setLayoutData(gridData);
    cLabel = new CLabel(mainComp, SWT.NONE);
    cLabel.setText(generatePropertiesSelect);
    cLabel.setLayoutData(gridData11);
    createTreeComp();
    createButtonComp();
    mainComp.setLayout(gridLayout2);

    createComboComp();

    createVisibilityGroup();

    return mainComp;
}
 
Example 14
Source File: OverrideMethodsPage.java    From Pydev with Eclipse Public License 1.0 5 votes vote down vote up
private Composite createMainComp(Composite parent) {
    GridData gridData12 = new GridData();
    gridData12.horizontalSpan = 2;
    GridData gridData11 = new GridData();
    gridData11.horizontalSpan = 2;
    GridLayout gridLayout2 = new GridLayout();
    gridLayout2.numColumns = 2;
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalAlignment = GridData.FILL;
    mainComp = new Composite(parent, SWT.NONE);
    mainComp.setLayoutData(gridData);
    cLabel = new CLabel(mainComp, SWT.NONE);
    cLabel.setText(Messages.overrideMethodsSelect);
    cLabel.setLayoutData(gridData11);
    createTreeComp();
    createButtonComp();
    mainComp.setLayout(gridLayout2);

    createComboComp();

    createCommentComp(mainComp);

    return mainComp;
}
 
Example 15
Source File: TimeSlice.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Initialize the control
 */
private void initialize() {
	timeLabel = new CLabel(this, SWT.RIGHT);
	timeLabel.setText("23:00 PM");
	Integer preferredWidth = new Integer(timeLabel.computeSize(SWT.DEFAULT,
			SWT.DEFAULT, false).x + 5);
	timeLabel.setLayoutData(preferredWidth);
	timeLabel.setText("");
	setBackground(Display.getCurrent().getSystemColor(
			SWT.COLOR_WIDGET_BACKGROUND));
	setSize(new Point(537, 16));
	setLayout(new TimeSliceAcrossTimeLayout());
}
 
Example 16
Source File: PickWorkspaceDialog.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected Control createDialogArea(final Composite parent) {
	setTitle("Choose a Workspace to store your models, settings, etc.");
	setMessage(strMsg);

	try {
		final Composite inner = new Composite(parent, SWT.NONE);
		final GridLayout l = new GridLayout(4, false);
		// double[][] layout =
		// new double[][] {
		// { 5, LatticeConstants.PREFERRED, 5, 250, 5,
		// LatticeConstants.PREFERRED, 5 },
		// { 5, LatticeConstants.PREFERRED, 5, LatticeConstants.PREFERRED,
		// 40 } };
		inner.setLayout(l);
		inner.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, true));

		/* Label on the left */
		final CLabel label = new CLabel(inner, SWT.NONE);
		label.setText("GAMA Workspace");
		label.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));

		/* Combo in the middle */
		workspacePathCombo = new Combo(inner, SWT.BORDER);
		final GridData data = new GridData(SWT.LEFT, SWT.CENTER, true, false);
		data.widthHint = 200;
		workspacePathCombo.setLayoutData(data);
		final String wsRoot = WorkspacePreferences.getLastSetWorkspaceDirectory();
		workspacePathCombo.setText(wsRoot);

		/* Checkbox below */
		rememberWorkspaceButton = new Button(inner, SWT.CHECK);
		rememberWorkspaceButton.setText("Remember");
		rememberWorkspaceButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
		rememberWorkspaceButton.setSelection(WorkspacePreferences.isRememberWorkspace());

		final String lastUsed = WorkspacePreferences.getLastUsedWorkspaces();
		lastUsedWorkspaces = new ArrayList<>();
		if ( lastUsed != null ) {
			final String[] all = lastUsed.split(splitChar);
			for ( final String str : all ) {
				lastUsedWorkspaces.add(str);
			}
		}
		for ( final String last : lastUsedWorkspaces ) {
			workspacePathCombo.add(last);
		}

		/* Browse button on the right */
		final Button browse = new Button(inner, SWT.PUSH);
		browse.setText("Browse...");
		browse.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false));
		browse.addListener(SWT.Selection, event -> {
			final DirectoryDialog dd = new DirectoryDialog(getParentShell());
			dd.setText("Select Workspace Root");
			dd.setMessage(strInfo);
			dd.setFilterPath(workspacePathCombo.getText());
			final String pick = dd.open();
			if ( pick == null ) {
				if ( workspacePathCombo.getText().length() == 0 ) {
					setMessage(strError, IMessageProvider.ERROR);
				}
			} else {
				setMessage(strMsg);
				workspacePathCombo.setText(pick);
			}
		});
		return inner;
	} catch (final RuntimeException err) {
		err.printStackTrace();
		return null;
	}
}
 
Example 17
Source File: MakrosComposite.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Create the composite.
 * 
 * @param parent
 * @param style
 */
public MakrosComposite(Composite parent, int style){
	super(parent, style);
	setLayout(new GridLayout(1, false));
	
	CLabel lblHeader = new CLabel(this, SWT.NONE);
	lblHeader.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	lblHeader.setText("Makros des Anwender " + CoreHub.getLoggedInContact().getLabel());

	
	SashForm sash = new SashForm(this, SWT.HORIZONTAL);
	sash.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	Composite selectionComposite = new Composite(sash, SWT.NONE);
	selectionComposite.setLayout(new GridLayout(1, true));
	ToolBarManager toolbar = new ToolBarManager();
	ToolBar toolbarControl = toolbar.createControl(selectionComposite);
	toolbarControl.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
	
	viewer = new TableViewer(selectionComposite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
	viewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	viewer.setContentProvider(new ArrayContentProvider());
	viewer.setLabelProvider(new DefaultLabelProvider());
	viewer.setInput(getUserMakros(CoreHub.getLoggedInContact()));
	viewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event){
			StructuredSelection selection = (StructuredSelection) viewer.getSelection();
			if (selection != null && !selection.isEmpty()) {
				detailComposite.setMakro((MakroDTO) selection.getFirstElement());
			} else {
				detailComposite.setMakro(null);
			}
		}
	});
	viewer.setComparator(new ViewerComparator());
	
	MenuManager menuManager = new MenuManager();
	menuManager.add(new RemoveMakroAction(viewer));
	MenuManager subMenu = new MenuManager("Marko zu Anwender kopieren");
	subMenu.setRemoveAllWhenShown(true);
	subMenu.addMenuListener(new IMenuListener() {
		@Override
		public void menuAboutToShow(IMenuManager manager){
			addCopyToUserActions(manager);
		}
	});
	menuManager.add(subMenu);
	
	Menu menu = menuManager.createContextMenu(viewer.getTable());
	viewer.getTable().setMenu(menu);
	
	toolbar.add(new AddMakroAction(viewer));
	toolbar.add(new RemoveMakroAction(viewer));
	toolbar.add(new RefreshMakrosAction(viewer));
	toolbar.update(true);
	
	detailComposite = new MakroDetailComposite(sash, SWT.NONE);
	
	// can only be set after child components are available
	sash.setWeights(new int[] {
		1, 4
	});
}
 
Example 18
Source File: ReferencesInBinaryStatusContextViewer.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
public void createControl(Composite parent) {
	fForm= new ViewForm(parent, SWT.BORDER | SWT.FLAT);
	fForm.marginWidth= 0;
	fForm.marginHeight= 0;

	fLabel= new CLabel(fForm, SWT.NONE);
	fLabel.setText(RefactoringMessages.ReferencesInBinaryStatusContextViewer_title);
	fForm.setTopLeft(fLabel);

	Composite composite= new Composite(fForm, SWT.NONE);
	composite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	GridLayout layout= new GridLayout(1, false);
	layout.marginWidth= 0;
	layout.marginHeight= 0;
	composite.setLayout(layout);


	fTreeViewer= new TreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
	final AppearanceAwareLabelProvider labelProvider= new AppearanceAwareLabelProvider();
	fTreeViewer.setLabelProvider(new DelegatingStyledCellLabelProvider(labelProvider));
	fTreeViewer.setComparator(new ViewerComparator() {
		private Collator fCollator= Collator.getInstance();
		@Override
		public int compare(Viewer viewer, Object e1, Object e2) {
			String l1= labelProvider.getText(e1);
			String l2= labelProvider.getText(e2);
			return fCollator.compare(l1, l2);
		}
	});
	fTreeViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	fButton= new Button(composite, SWT.PUSH);
	fButton.setText(RefactoringMessages.ReferencesInBinaryStatusContextViewer_show_as_search_button);
	GridData layoutData= new GridData(SWT.BEGINNING, SWT.CENTER, false, false);
	layoutData.widthHint= SWTUtil.getButtonWidthHint(fButton);
	fButton.setLayoutData(layoutData);
	fButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			fillInSearchView();
		}
	});
	fButton.setEnabled(false);

	fForm.setContent(composite);

	Dialog.applyDialogFont(parent);
}
 
Example 19
Source File: SmartImportBdmPage.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
private void updateCLabel(CLabel clabel, String text, boolean visible) {
    clabel.setText(text);
    clabel.setVisible(visible);
    ((GridData) clabel.getLayoutData()).exclude = !visible;
    clabel.layout(true);
}
 
Example 20
Source File: TabbedPropertySheetWidgetFactory.java    From bonita-studio with GNU General Public License v2.0 3 votes vote down vote up
/**
 * Creates a label as a part of the form.
 *
 * @param parent
 *            the label parent.
 * @param text
 *            the label text.
 * @param style
 *            the label style.
 * @return the label.
 */
public CLabel createCLabel(Composite parent, String text, int style) {
    final CLabel label = new CLabel(parent, style);
    label.setBackground(parent.getBackground());
    label.setText(text);
    return label;
}