/** Redraw this item, retrieves new labels from its label provider. */ void refresh() { String text = fLabelProvider.getText(getData()); Image image = fLabelProvider.getImage(getData()); String toolTip = fToolTipLabelProvider.getText(getData()); fDetailsBlock.setText(text); fDetailsBlock.setImage(image); fDetailsBlock.setToolTip(toolTip); refreshArrow(); }
/* * @see org.eclipse.swt.widgets.Item#setText(java.lang.String) */ @Override public void setText(String string) { super.setText(string); fDetailsBlock.setText(string); // more or less space might be required for the label if (fIsLast) fContainer.layout(true, true); }
/* * @see org.eclipse.swt.widgets.Item#setImage(org.eclipse.swt.graphics.Image) */ @Override public void setImage(Image image) { super.setImage(image); fDetailsBlock.setImage(image); }
/** * Set the tool tip of the item to the given text. * * @param text the tool tip for the item */ public void setToolTip(String text) { fDetailsBlock.setToolTip(text); }
/** * Sets whether or not the this item should show the details (name and label). * * @param visible true if the item shows details */ void setDetailsVisible(boolean visible) { fDetailsBlock.setVisible(visible); }
/** * Returns whether this item has the keyboard focus. * * @return <code>true</code> if this item has the keyboard focus */ boolean hasFocus() { return fDetailsBlock.hasFocus(); }
/** * Sets whether this item has the keyboard focus. * * @param state <code>true</code> if it has focus, <code>false</code> otherwise */ void setFocus(boolean state) { fDetailsBlock.setFocus(state); }
/** * Sets whether this item has to be marked as selected or not. * * @param selected true if marked as selected */ void setSelected(boolean selected) { fDetailsBlock.setSelected(selected); }
/** * Returns the width of this item. * * @return the width of this item */ int getWidth() { return fDetailsBlock.getWidth() + fExpandBlock.getWidth() + 2; }
/** * Does this item show a text label? * * @return true if it does. */ boolean isShowText() { return fDetailsBlock.isTextVisible(); }
/** * Should this item show a text label. * * @param enabled true if it should */ void setShowText(boolean enabled) { fDetailsBlock.setTextVisible(enabled); }