@Override public void mouseHover(MouseEvent event) { FieldDecorationData decData = (FieldDecorationData) event.widget .getData(); String desc = decData.decoration.getDescription(); if (desc != null) { showHoverText(desc, label); } }
@Override public void mouseHover(MouseEvent event) { FieldDecorationData decData = (FieldDecorationData) event.widget .getData(); String desc = decData.decoration.getDescription(); if (desc != null) { showHoverText(desc, label); } }
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()); } }
/** * Update the specified decoration. This message should be used if the image * or description in the decoration have changed. This message has no * immediate effect if the decoration is not visible, and no effect at all * if the decoration was not previously added to the field. * * @param decoration * the decoration to be hidden. */ public void updateDecoration(FieldDecoration decoration) { FieldDecorationData data = getDecorationData(decoration); if (data == null) { return; } if (data.label != null) { data.label.setImage(decoration.getImage()); // If the decoration is being shown, and a hover is active, // update the hover text to display the new description. if (data.label.getVisible() == true && hover != null) { showHoverText(decoration.getDescription(), data.label); } } }
/** * Update the specified decoration. This message should be used if the image * or description in the decoration have changed. This message has no * immediate effect if the decoration is not visible, and no effect at all * if the decoration was not previously added to the field. * * @param decoration * the decoration to be hidden. */ public void updateDecoration(FieldDecoration decoration) { FieldDecorationData data = getDecorationData(decoration); if (data == null) { return; } if (data.label != null) { data.label.setImage(decoration.getImage()); // If the decoration is being shown, and a hover is active, // update the hover text to display the new description. if (data.label.getVisible() == true && hover != null) { showHoverText(decoration.getDescription(), data.label); } } }
/** * Update the specified decoration. This message should be used if the image * or description in the decoration have changed. This message has no * immediate effect if the decoration is not visible, and no effect at all * if the decoration was not previously added to the field. * * @param decoration * the decoration to be hidden. */ public void updateDecoration(FieldDecoration decoration) { FieldDecorationData data = getDecorationData(decoration); if (data == null) { return; } if (data.label != null) { data.label.setImage(decoration.getImage()); // If the decoration is being shown, and a hover is active, // update the hover text to display the new description. if (data.label.getVisible() == true && hover != null) { showHoverText(decoration.getDescription(), data.label); } } }
ControlDecoration decoration = new ControlDecoration(control, SWT.LEFT | SWT.TOP); decoration.setShowOnlyOnFocus(true); decoration.setDescriptionText(fieldDecoration.getDescription()); decoration.setImage(fieldDecoration.getImage());
showHoverText( decDatas[i].decoration.getDescription(), label );
FieldDecoration dec = getContentAssistFieldDecoration(); decoration.setImage(dec.getImage()); decoration.setDescriptionText(dec.getDescription());