private void createParameterNameInput(Composite group) { Label l= new Label(group, SWT.NONE); l.setText(RefactoringMessages.ExtractClassWizard_field_name); final Text text= new Text(group, SWT.BORDER); fParameterNameDecoration= new ControlDecoration(text, SWT.TOP | SWT.LEAD); text.setText(fDescriptor.getFieldName()); text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { fDescriptor.setFieldName(text.getText()); validateRefactoring(); } }); GridData gridData= new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalIndent= FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); text.setLayoutData(gridData); }
private void createParameterNameInput(Composite group) { Label l= new Label(group, SWT.NONE); l.setText(RefactoringMessages.ExtractClassWizard_field_name); final Text text= new Text(group, SWT.BORDER); fParameterNameDecoration= new ControlDecoration(text, SWT.TOP | SWT.LEAD); text.setText(fDescriptor.getFieldName()); text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { fDescriptor.setFieldName(text.getText()); validateRefactoring(); } }); GridData gridData= new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalIndent= FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); text.setLayoutData(gridData); }
private int widthOf(Image image) { if (image == null) { return 0; } return useMaxDecorationWidth ? FieldDecorationRegistry.getDefault() .getMaximumDecorationWidth() : image.getBounds().width; } }
private int widthOf(Image image) { if (image == null) { return 0; } return useMaxDecorationWidth ? FieldDecorationRegistry.getDefault() .getMaximumDecorationWidth() : image.getBounds().width; } }
private int widthOf(Image image) { if (image == null) { return 0; } return useMaxDecorationWidth ? FieldDecorationRegistry.getDefault() .getMaximumDecorationWidth() : image.getBounds().width; } }
private static Image getDecorationImage(final String key) { return FieldDecorationRegistry.getDefault().getFieldDecoration(key) .getImage(); }
private void createClassNameInput(Composite result) { Label label= new Label(result, SWT.LEAD); label.setText(RefactoringMessages.ExtractClassWizard_label_class_name); final Text text= new Text(result, SWT.SINGLE | SWT.BORDER); fClassNameDecoration= new ControlDecoration(text, SWT.TOP | SWT.LEAD); text.setText(fDescriptor.getClassName()); text.selectAll(); text.setFocus(); text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { fDescriptor.setClassName(text.getText()); validateRefactoring(); } }); GridData gridData= new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalIndent= FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); text.setLayoutData(gridData); }
private void createClassNameInput(Composite result) { Label label= new Label(result, SWT.LEAD); label.setText(RefactoringMessages.ExtractClassWizard_label_class_name); final Text text= new Text(result, SWT.SINGLE | SWT.BORDER); fClassNameDecoration= new ControlDecoration(text, SWT.TOP | SWT.LEAD); text.setText(fDescriptor.getClassName()); text.selectAll(); text.setFocus(); text.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { fDescriptor.setClassName(text.getText()); validateRefactoring(); } }); GridData gridData= new GridData(GridData.FILL_HORIZONTAL); gridData.horizontalIndent= FieldDecorationRegistry.getDefault().getMaximumDecorationWidth(); text.setLayoutData(gridData); }
/** * Adds an image to decorated field to be shown in the message area. * * @param image * desired image to be shown in the ImageAndMessageArea */ public void setImage(Image image) { FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); registry.registerFieldDecoration("messageImage", null, image); //$NON-NLS-1$ messageField.addFieldDecoration(registry .getFieldDecoration("messageImage"), //$NON-NLS-1$ SWT.LEFT | SWT.TOP, false); }
/** * Adds an image to decorated field to be shown in the message area. * * @param image * desired image to be shown in the ImageAndMessageArea */ public void setImage(Image image) { FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); registry.registerFieldDecoration("messageImage", null, image); //$NON-NLS-1$ messageField.addFieldDecoration(registry .getFieldDecoration("messageImage"), //$NON-NLS-1$ SWT.LEFT | SWT.TOP, false); }
/** * Adds an image to decorated field to be shown in the message area. * * @param image * desired image to be shown in the ImageAndMessageArea */ public void setImage(Image image) { FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); registry.registerFieldDecoration("messageImage", null, image); //$NON-NLS-1$ messageField.addFieldDecoration(registry .getFieldDecoration("messageImage"), //$NON-NLS-1$ SWT.LEFT | SWT.TOP, false); }
/** * Create a MarkerViewLabelProvider on a field. * * @param field */ MarkerColumnLabelProvider(MarkerField field) { FieldDecorationRegistry.getDefault(); this.field = field; imageManager = new LocalResourceManager(IDEWorkbenchPlugin.getDefault() .getResourceManager()); field.setImageManager(imageManager); }
protected void createProductSection(Composite parent) { fProductButton = new Button(parent, SWT.RADIO); fProductButton.setText(PDEUIMessages.ProgramBlock_runProduct); fProductButton.addSelectionListener(fListener); fProductCombo = SWTFactory.createCombo(parent, SWT.DROP_DOWN, 1, TargetPlatform.getProducts()); fProductCombo.addSelectionListener(fListener); fProductCombo.addModifyListener(fListener); fProductComboDecoration = new ControlDecoration(fProductCombo, SWT.TOP | SWT.LEFT); FieldDecoration warningDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING); fProductComboDecoration.setDescriptionText(PDEUIMessages.ProgramBlock_productDecorationWarning0); fProductComboDecoration.setImage(warningDecoration.getImage()); }
/** * Adds enough space in the control's layout data margin for the content assist * decoration. * @param control the control that needs a margin * @since 3.3 */ private void addDecorationMargin(Control control) { Object layoutData= control.getLayoutData(); if (!(layoutData instanceof GridData)) return; GridData gd= (GridData)layoutData; FieldDecoration dec= FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); gd.horizontalIndent= dec.getImage().getBounds().width; }
/** * Adds enough space in the control's layout data margin for the content assist * decoration. * @param control the control that needs a margin * @since 3.3 */ private void addDecorationMargin(Control control) { Object layoutData= control.getLayoutData(); if (!(layoutData instanceof GridData)) return; GridData gd= (GridData)layoutData; FieldDecoration dec= FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); gd.horizontalIndent= dec.getImage().getBounds().width; }
/** * Adds enough space in the control's layout data margin for the content assist * decoration. * @param control the control that needs a margin * @since 3.3 */ private void addDecorationMargin(Control control) { Object layoutData= control.getLayoutData(); if (!(layoutData instanceof GridData)) return; GridData gd= (GridData)layoutData; FieldDecoration dec= FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); gd.horizontalIndent= dec.getImage().getBounds().width; }
/** * Initializes the control editor. * * @param itemEditor * the editor to initialize */ protected void initItemEditor(C itemEditor) { this.setItemEditor(itemEditor); setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_ERROR).getImage()); hide(); }
public static void addRequiredDecoration(Control control) { FieldDecoration fieldDecoration = FieldDecorationRegistry.getDefault().getFieldDecoration( FieldDecorationRegistry.DEC_REQUIRED); ControlDecoration controlDecoration = new ControlDecoration(control, SWT.LEFT | SWT.CENTER); controlDecoration.setDescriptionText(fieldDecoration.getDescription()); controlDecoration.setImage(fieldDecoration.getImage()); } }
protected Control createDialogArea(Composite parent) { Control createDialogArea = super.createDialogArea(parent); decorator = new ControlDecoration(getText(), SWT.TOP | SWT.LEFT); decorator.setDescriptionText(NetUIMessages.NonProxyHostsComposite_0); decorator.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration( FieldDecorationRegistry.DEC_INFORMATION).getImage()); return createDialogArea; } public boolean close() {
private void createUIFieldDecorationTemplate() { // Decorate the combo with the info image int bits = SWT.TOP | SWT.LEFT; fControlDecoration = new ControlDecoration(fFieldTemplateCombo.getControl(), bits); // Configure decoration // No margin fControlDecoration.setMarginWidth(0); // Custom hover tip text fControlDecoration.setDescriptionText(PDEUIMessages.SplashConfigurationSection_msgDecorationTemplateSupport); // Custom hover properties fControlDecoration.setShowHover(true); // Hover image to use FieldDecoration contentProposalImage = FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_INFORMATION); fControlDecoration.setImage(contentProposalImage.getImage()); // Hide the decoration initially fControlDecoration.hide(); }