本文整理匯總了Java中org.eclipse.swt.widgets.Link.setData方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.setData方法的具體用法?Java Link.setData怎麽用?Java Link.setData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Link
的用法示例。
在下文中一共展示了Link.setData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onSpeed_IL_TT_SetTourType
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void onSpeed_IL_TT_SetTourType(final int speedTTIndex, final TourType tourType) {
/*
* Update UI
*/
final Image image = TourTypeImage.getTourTypeImage(tourType.getTypeId());
final Label ttIcon = _lblTT_Speed_TourTypeIcon[speedTTIndex];
final Link ttLink = _linkTT_Speed_TourType[speedTTIndex];
ttIcon.setImage(image);
ttLink.setText(UI.LINK_TAG_START + tourType.getName() + UI.LINK_TAG_END);
ttLink.setData(DATA_KEY_TOUR_TYPE_ID, tourType.getTypeId());
_speedTourType_OuterContainer.layout();
// update UI with modified tour type
update_Model_From_UI_IL();
_ilViewer.update(_selectedIL, null);
redrawILViewer();
}
示例2: addLink
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
protected Link addLink(Composite parent, String label, Key key, SelectionListener linkListener, int indent, int widthHint) {
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= 3;
gd.horizontalIndent= indent;
gd.widthHint= widthHint;
Link link= new Link(parent, SWT.NONE);
link.setFont(JFaceResources.getDialogFont());
link.setText(label);
link.setData(key);
link.setLayoutData(gd);
link.addSelectionListener(linkListener);
makeScrollableCompositeAware(link);
fLinks.add(link);
return link;
}
示例3: updateTrigger
import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
/**
* Update the trigger key if either action is available and enabled or
* command is available
*
* @param trigger
* {@link Object} or <code>null</code>
* @param link
*/
private void updateTrigger(Object trigger, Link link) {
if (link.isDisposed()) {
return;
}
if (trigger instanceof IAction && ((IAction) trigger).isEnabled()) {
link.setData(TRIGGER_KEY, trigger);
} else if (trigger instanceof ParameterizedCommand) {
link.setData(TRIGGER_KEY, trigger);
} else {
link.setData(TRIGGER_KEY, null);
}
}