當前位置: 首頁>>代碼示例>>Java>>正文


Java Link.getData方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.Link.getData方法的典型用法代碼示例。如果您正苦於以下問題:Java Link.getData方法的具體用法?Java Link.getData怎麽用?Java Link.getData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.Link的用法示例。


在下文中一共展示了Link.getData方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: fillSpeedTourTypeMenu

import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
private void fillSpeedTourTypeMenu(final IMenuManager menuMgr, final Link linkTourType) {

		// get tour type which will be checked in the menu
		final TourType checkedTourType = null;

		final int speedTTIndex = (int) linkTourType.getData(DATA_KEY_SPEED_TOUR_TYPE_INDEX);

		// add all tour types to the menu
		final ArrayList<TourType> tourTypes = TourDatabase.getAllTourTypes();

		for (final TourType tourType : tourTypes) {

			boolean isChecked = false;
			if (checkedTourType != null && checkedTourType.getTypeId() == tourType.getTypeId()) {
				isChecked = true;
			}

			final ActionSpeedTourType_SetInMenu action = new ActionSpeedTourType_SetInMenu(
					tourType,
					isChecked,
					speedTTIndex);

			menuMgr.add(action);
		}

		menuMgr.add(new Separator());
		menuMgr.add(_actionOpenTourTypePrefs);
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:29,代碼來源:DialogEasyImportConfig.java

示例2: getLink

import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
protected Link getLink(Key key) {
	for (int i= fLinks.size() - 1; i >= 0; i--) {
		Link curr= fLinks.get(i);
		Key data= (Key)curr.getData();
		if (key.equals(data)) {
			return curr;
		}
	}
	return null;
}
 
開發者ID:trylimits,項目名稱:Eclipse-Postfix-Code-Completion,代碼行數:11,代碼來源:OptionsConfigurationBlock.java

示例3: update_Model_From_UI_IL

import org.eclipse.swt.widgets.Link; //導入方法依賴的package包/類
/**
 * Set data from the UI into the model.
 */
private void update_Model_From_UI_IL() {

	if (_selectedIL == null) {
		return;
	}

	_selectedIL.name = _txtIL_ConfigName.getText();
	_selectedIL.description = _txtIL_ConfigDescription.getText();
	_selectedIL.isSaveTour = _chkIL_SaveTour.getSelection();
	_selectedIL.isShowInDashboard = _chkIL_ShowInDashboard.getSelection();

	// last marker
	_selectedIL.isSetLastMarker = _chkIL_SetLastMarker.getSelection();
	_selectedIL.lastMarkerDistance = getSelectedLastMarkerDistance();
	_selectedIL.lastMarkerText = _txtIL_LastMarker.getText();

	// tour type
	final Enum<TourTypeConfig> selectedTourTypeConfig = getSelectedTourTypeConfig();
	_selectedIL.tourTypeConfig = selectedTourTypeConfig;

	/*
	 * Set tour type data
	 */
	if (TourTypeConfig.TOUR_TYPE_CONFIG_BY_SPEED.equals(selectedTourTypeConfig)) {

		final ArrayList<SpeedTourType> speedTourTypes = _selectedIL.speedTourTypes;

		if (_spinnerTT_Speed_AvgSpeed != null) {

			final ArrayList<SpeedTourType> newSpeedTourTypes = new ArrayList<SpeedTourType>();

			for (int speedTTIndex = 0; speedTTIndex < speedTourTypes.size(); speedTTIndex++) {

				final Spinner spinnerAvgSpeed = _spinnerTT_Speed_AvgSpeed[speedTTIndex];
				final Link linkTourType = _linkTT_Speed_TourType[speedTTIndex];

				final SpeedTourType speedTourType = new SpeedTourType();

				speedTourType.avgSpeed = spinnerAvgSpeed.getSelection() * net.tourbook.ui.UI.UNIT_VALUE_DISTANCE;

				final Object tourTypeId = linkTourType.getData(DATA_KEY_TOUR_TYPE_ID);
				if (tourTypeId instanceof Long) {
					speedTourType.tourTypeId = (long) tourTypeId;
				} else {
					speedTourType.tourTypeId = TourDatabase.ENTITY_IS_NOT_SAVED;
				}

				newSpeedTourTypes.add(speedTourType);
			}

			// sort value
			Collections.sort(newSpeedTourTypes);

			// update model
			speedTourTypes.clear();
			speedTourTypes.addAll(newSpeedTourTypes);
		}

		_selectedIL.setupItemImage();

	} else if (TourTypeConfig.TOUR_TYPE_CONFIG_ONE_FOR_ALL.equals(selectedTourTypeConfig)) {

		update_Model_From_UI_OneTourType();

	} else {

		// this is the default

		_selectedIL.setupItemImage();
	}
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:75,代碼來源:DialogEasyImportConfig.java


注:本文中的org.eclipse.swt.widgets.Link.getData方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。