/** * 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); }
private FieldDecoration getFieldDecoration() { FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); // Look for a decoration installed for this particular command id. String decId = CONTENT_ASSIST_DECORATION_ID + adapter.getCommandId(); FieldDecoration dec = registry.getFieldDecoration(decId); // If there is not one, base ours on the standard JFace one. if (dec == null) { FieldDecoration originalDec = registry .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); registry.registerFieldDecoration(decId, null, originalDec .getImage()); dec = registry.getFieldDecoration(decId); } // Always update the decoration text since the key binding may // have changed since it was last retrieved. IBindingService bindingService = PlatformUI .getWorkbench().getService(IBindingService.class); dec.setDescription(NLS.bind( WorkbenchMessages.ContentAssist_Cue_Description_Key, bindingService.getBestActiveBindingFormattedFor(adapter .getCommandId()))); // Now return the field decoration return dec; }
private FieldDecoration getContentAssistFieldDecoration() { FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault(); // Look for a decoration installed for this particular command id. String decId = CONTENT_ASSIST_DECORATION_ID + getCommandId(); FieldDecoration dec = registry.getFieldDecoration(decId); // If there is not one, base ours on the standard JFace one. if (dec == null) { FieldDecoration originalDec = registry .getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL); registry.registerFieldDecoration(decId, null, originalDec .getImage()); dec = registry.getFieldDecoration(decId); } // Always update the decoration text since the key binding may // have changed since it was last retrieved. IBindingService bindingService = PlatformUI .getWorkbench().getService(IBindingService.class); dec .setDescription(NLS .bind( WorkbenchMessages.ContentAssist_Cue_Description_Key, bindingService .getBestActiveBindingFormattedFor(getCommandId()))); // Now return the field decoration return dec; }