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


Java SashForm.getWeights方法代碼示例

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


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

示例1: backupWeightsAndSize

import org.eclipse.swt.custom.SashForm; //導入方法依賴的package包/類
private void backupWeightsAndSize(Position pos) {
	SashForm sf = positionSashFormMap.get(pos);
	if (sf != null) {
		weightsBackup.get(sf)[0] = sf.getWeights()[0];
		weightsBackup.get(sf)[1] = sf.getWeights()[1];
	}
	
}
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:9,代碼來源:PortalWidget.java

示例2: restoreSashWeight

import org.eclipse.swt.custom.SashForm; //導入方法依賴的package包/類
/**
 * Restore the sash weight from a memento
 * 
 * @param sash
 * @param fMemento
 * @param weightKey
 * @param sashDefaultWeight
 */
public static void restoreSashWeight(	final SashForm sash,
										final IMemento fMemento,
										final String weightKey,
										final int[] sashDefaultWeight) {

	final int[] sashWeights = sash.getWeights();
	final int[] newWeights = new int[sashWeights.length];

	for (int weightIndex = 0; weightIndex < sashWeights.length; weightIndex++) {

		final Integer mementoWeight = fMemento.getInteger(weightKey + Integer.toString(weightIndex));

		if (mementoWeight == null) {
			try {
				newWeights[weightIndex] = sashDefaultWeight[weightIndex];

			} catch (final ArrayIndexOutOfBoundsException e) {
				newWeights[weightIndex] = 100;
			}
		} else {
			newWeights[weightIndex] = mementoWeight;
		}
	}

	sash.setWeights(newWeights);
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:35,代碼來源:UI.java

示例3: saveSashWeight

import org.eclipse.swt.custom.SashForm; //導入方法依賴的package包/類
/**
 * Store the weights for the sash in a memento
 * 
 * @param sashForm
 * @param state
 * @param weightKey
 */
public static void saveSashWeight(final SashForm sashForm, final IDialogSettings state, final String weightKey) {

	final int[] weights = sashForm.getWeights();

	for (int weightIndex = 0; weightIndex < weights.length; weightIndex++) {
		state.put(weightKey + Integer.toString(weightIndex), weights[weightIndex]);
	}
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:16,代碼來源:UI.java


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