/** * Create the contents for the receiver. * * @param parent * the Composite that the children will be created in */ public void createContents(Composite parent) { // Message label titleLabel = new CLabel(parent, SWT.NONE); titleLabel.setFont(JFaceResources.getBannerFont()); messageComposite = new Composite(parent, SWT.NONE); GridLayout messageLayout = new GridLayout(); messageLayout.numColumns = 2; messageLayout.marginWidth = 0; messageLayout.marginHeight = 0; messageLayout.makeColumnsEqualWidth = false; messageComposite.setLayout(messageLayout); messageImageLabel = new Label(messageComposite, SWT.NONE); messageImageLabel.setImage(JFaceResources .getImage(Dialog.DLG_IMG_MESSAGE_INFO)); messageImageLabel.setLayoutData(new GridData( GridData.VERTICAL_ALIGN_CENTER)); messageText = new Text(messageComposite, SWT.NONE); messageText.setEditable(false); GridData textData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER); messageText.setLayoutData(textData); }
/** * Create the contents for the receiver. * * @param parent * the Composite that the children will be created in */ public void createContents(Composite parent) { // Message label titleLabel = new CLabel(parent, SWT.NONE); titleLabel.setFont(JFaceResources.getBannerFont()); messageComposite = new Composite(parent, SWT.NONE); GridLayout messageLayout = new GridLayout(); messageLayout.numColumns = 2; messageLayout.marginWidth = 0; messageLayout.marginHeight = 0; messageLayout.makeColumnsEqualWidth = false; messageComposite.setLayout(messageLayout); messageImageLabel = new Label(messageComposite, SWT.NONE); messageImageLabel.setImage(JFaceResources .getImage(Dialog.DLG_IMG_MESSAGE_INFO)); messageImageLabel.setLayoutData(new GridData( GridData.VERTICAL_ALIGN_CENTER)); messageText = new Text(messageComposite, SWT.NONE); messageText.setEditable(false); GridData textData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER); messageText.setLayoutData(textData); }
/** * Create the contents for the receiver. * * @param parent * the Composite that the children will be created in */ public void createContents(Composite parent) { // Message label titleLabel = new CLabel(parent, SWT.NONE); titleLabel.setFont(JFaceResources.getBannerFont()); messageComposite = new Composite(parent, SWT.NONE); GridLayout messageLayout = new GridLayout(); messageLayout.numColumns = 2; messageLayout.marginWidth = 0; messageLayout.marginHeight = 0; messageLayout.makeColumnsEqualWidth = false; messageComposite.setLayout(messageLayout); messageImageLabel = new Label(messageComposite, SWT.NONE); messageImageLabel.setImage(JFaceResources .getImage(Dialog.DLG_IMG_MESSAGE_INFO)); messageImageLabel.setLayoutData(new GridData( GridData.VERTICAL_ALIGN_CENTER)); messageText = new Text(messageComposite, SWT.NONE); messageText.setEditable(false); GridData textData = new GridData(GridData.GRAB_HORIZONTAL | GridData.FILL_HORIZONTAL | GridData.VERTICAL_ALIGN_CENTER); messageText.setLayoutData(textData); }
public static CLabel createCLabel(final Composite parent, final String text, final boolean bold, final Image image) { final CLabel label = new CLabel(parent, SWT.NONE); setInfoBackgroundColor(label); label.setText(text); if (bold) { label.setFont(BOLDFONT); } label.setImage(image); return label; }
/** * Creates a new <code>CLabel</code> that will wrap at the specified width and has the specified image * @param parent the parent to add this label to * @param text the text for the label * @param image the image for the label * @param hspan the h span to take up in the parent * @param wrapwidth the with to wrap at * @return a new <code>CLabel</code> * @since 3.3 */ public static CLabel createWrapCLabel(Composite parent, String text, Image image, int hspan, int wrapwidth) { CLabel label = new CLabel(parent, SWT.NONE | SWT.WRAP); label.setFont(parent.getFont()); if(text != null) { label.setText(text); } if(image != null) { label.setImage(image); } GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = hspan; gd.widthHint = wrapwidth; label.setLayoutData(gd); return label; }
/** * Constructs a new instance of this class given its parent and a style * value describing its behavior and appearance. * * @param parent * the parent component * @param style * SWT style bits */ public DetailsContentViewer(Composite parent, int style) { viewForm = new ViewForm(parent, style); GridData gd = new GridData(GridData.FILL_HORIZONTAL); gd.horizontalSpan = 2; viewForm.setLayoutData(gd); label = new CLabel(viewForm, SWT.FLAT); label.setFont(parent.getFont()); viewForm.setContent(label); hookControl(label); }
fStatusLabel.setFont(group.getFont()); fStatusLabel.setAlignment(SWT.LEFT); fStatusLabel.setText(SearchMessages.SearchPage_containingText_hint);
label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING | GridData.FILL_HORIZONTAL)); label.setFont(JFaceResources.getDialogFont());
fStatusLabel.setFont(group.getFont()); fStatusLabel.setAlignment(SWT.LEFT); fStatusLabel.setText(SearchMessages.SearchPage_containingText_hint);
/** * @see IPreferencePageContainer#updateMessage() */ @Override public void updateMessage() { if (currentPage != null) { String pageMessage = currentPage.getMessage(); String pageErrorMessage = currentPage.getErrorMessage(); // Adjust the font if (pageMessage == null && pageErrorMessage == null) fMessageLabel.setFont(JFaceResources.getBannerFont()); else fMessageLabel.setFont(JFaceResources.getDialogFont()); // Set the message and error message if (pageMessage == null) { if (isSinglePage()) { setMessage(TeamUIMessages.PreferencePageContainerDialog_6); } else { //remove mnemonic see bug 75886 String title = currentPage.getTitle(); title = title.replaceAll("&", "");//$NON-NLS-1$ //$NON-NLS-2$ setMessage(title); } } else { setMessage(pageMessage); } setErrorMessage(pageErrorMessage); } }
Image image, int hspan, int wrapwidth) { CLabel label = new CLabel(parent, SWT.NONE | SWT.WRAP); label.setFont(parent.getFont()); if (text != null) { label.setText(text);
statusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1)); statusLabel.setFont(group.getFont()); statusLabel.setAlignment(SWT.LEFT); statusLabel.setText(UIText.CommitSearchPage_ContainingTextHint);
fMessageLabel.setForeground(fg); fMessageLabel.setText(" ");//$NON-NLS-1$ fMessageLabel.setFont(JFaceResources.getBannerFont());
fMessageLabel.setForeground(fg); fMessageLabel.setText(" ");//$NON-NLS-1$ fMessageLabel.setFont(JFaceResources.getBannerFont());
private void createTitleArea() { title = createComposite(container); final String providerName = provider.getDescription().getName(); final Image providerImage = provider.getDescription().getImage(); final CLabel l = new CLabel(title, SWT.NONE); l.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT)); setInfoForegroundColor(l); setInfoBackgroundColor(l); l.setText(providerName); l.setImage(providerImage); }
factory.getColors().getColor(IFormColors.TB_BG)}, new int[] {100}, true); label.setFont(JFaceResources.getBannerFont()); FormData data = new FormData(); data.left = new FormAttachment(0, 0);
factory.getColors().getColor(IFormColors.H_GRADIENT_START) }, new int[] { 100 }, true); label.setFont(font); label.setForeground(factory.getColors().getColor(IFormColors.TITLE)); FormData data = new FormData();