本文整理匯總了Java中org.eclipse.ui.IMemento.putInteger方法的典型用法代碼示例。如果您正苦於以下問題:Java IMemento.putInteger方法的具體用法?Java IMemento.putInteger怎麽用?Java IMemento.putInteger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.IMemento
的用法示例。
在下文中一共展示了IMemento.putInteger方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveTo
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void saveTo ( final IMemento memento )
{
if ( memento == null )
{
return;
}
{
final IMemento tableMemento = memento.createChild ( "tableCols" ); //$NON-NLS-1$
for ( int i = 0; i < this.viewer.getTree ().getColumnCount (); i++ )
{
final TreeColumn col = this.viewer.getTree ().getColumn ( i );
tableMemento.putInteger ( "col_" + i, col.getWidth () ); //$NON-NLS-1$
}
}
for ( final ListEntry entry : this.list.getItems () )
{
final Item item = entry.getItem ();
item.saveTo ( memento.createChild ( "item" ) ); //$NON-NLS-1$
}
}
示例2: saveState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
@Override
public void saveState(IMemento memento) {
// Scroll lock
memento.putBoolean("scrollLock", scrollLock);
// Limit log chars
memento.putInteger("limitLogChars", limitLogChars);
// Activate on new events
memento.putBoolean("activateOnNewEvents", activateOnNewEvents);
// Column order
memento.putString("columnOrder", Arrays.toString(tableViewer.getTable().getColumnOrder()));
// Column information
for (ColumnInfo columnInfo : columnInfos) {
IMemento columnInfoMemento = memento.createChild("columnInfo");
columnInfoMemento.putString("name", columnInfo.getName());
columnInfoMemento.putBoolean("visible", columnInfo.isVisible());
columnInfoMemento.putInteger("size", columnInfo.getSize());
}
super.saveState(memento);
}
示例3: saveCodeFolding
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
/**
* Saves the code folding state into the given memento.
*/
public void saveCodeFolding(IMemento memento) {
// The annotation model might be null if the editor opened an storage input
// instead of a file input.
if (projectionAnnotationModel == null) {
return;
}
Iterator<?> annotationIt = projectionAnnotationModel.getAnnotationIterator();
while (annotationIt.hasNext()) {
ProjectionAnnotation annotation = (ProjectionAnnotation) annotationIt.next();
IMemento annotationMemento = memento.createChild(ANNOTATION);
Position position = projectionAnnotationModel.getPosition(annotation);
annotationMemento.putBoolean(IS_COLLAPSED, annotation.isCollapsed());
annotationMemento.putInteger(OFFSET, position.offset);
annotationMemento.putInteger(LENGTH, position.length);
}
}
示例4: createXmlProfile
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static IMemento createXmlProfile( final XMLMemento xmlMemento,
final int profileId,
final String name,
final String profileImagePath,
final boolean isShadow,
final float shadowValue,
final String resolution) {
final IMemento xmlProfile = xmlMemento.createChild(MEMENTO_CHILD_PROFILE);
xmlProfile.putInteger(TAG_PROFILE_ID, profileId);
xmlProfile.putString(TAG_NAME, name);
xmlProfile.putString(TAG_IMAGE_PATH, profileImagePath);
xmlProfile.putBoolean(TAG_IS_SHADOW, isShadow);
xmlProfile.putString(TAG_RESOLUTION, resolution);
xmlProfile.putFloat(TAG_SHADOW_VALUE, shadowValue);
return xmlProfile;
}
示例5: createXml_FromTrackConfig
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void createXml_FromTrackConfig(final Map25TrackConfig config, final IMemento xmlTourTracks) {
// <Track>
final IMemento xmlConfig = xmlTourTracks.createChild(TAG_TRACK);
{
xmlConfig.putString(ATTR_ID, config.id);
xmlConfig.putString(ATTR_CONFIG_NAME, config.name);
xmlConfig.putInteger(ATTR_ANIMATION_TIME, config.animationTime);
// <Outline>
final IMemento xmlOutline = Util.setXmlRgb(xmlConfig, TAG_OUTLINE, config.outlineColor);
{
xmlOutline.putFloat(ATTR_OUTLINE_WIDTH, config.outlineWidth);
}
}
}
示例6: save
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void save(IMemento memento) {
memento.putInteger(KEY_SORTCOLUMN, sortcolumn);
memento.putBoolean(KEY_REVERSESORT, reversesort);
memento.putString(KEY_COUNTERS, counters.name());
memento.putString(KEY_ROOTTYPE, roottype.name());
memento.putBoolean(KEY_HIDEUNUSEDELEMENTS, hideunusedelements);
memento.putInteger(KEY_COLUMN0, columnwidths[0]);
memento.putInteger(KEY_COLUMN1, columnwidths[1]);
memento.putInteger(KEY_COLUMN2, columnwidths[2]);
memento.putInteger(KEY_COLUMN3, columnwidths[3]);
memento.putInteger(KEY_COLUMN4, columnwidths[4]);
memento.putBoolean(KEY_LINKED, linked);
}
示例7: restoreSashWidths
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void restoreSashWidths(SashForm sash, IMemento memento) {
if (memento == null) {
setDefaultSashWeights(sash);
memento = XMLMemento.createWriteRoot(getFactoryId());
memento.putInteger(FIRST_SASH_CONTROL_WEIGHT, DEFAULT_WEIGHTS[0]);
memento.putInteger(SECOND_SASH_CONTROL_WEIGHT, DEFAULT_WEIGHTS[1]);
rememberExpandState(memento);
setMemento(memento);
} else {
restoreState(memento);
}
}
示例8: saveState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void saveState(IMemento memento) {
super.saveState(memento);
memento = memento.createChild(ID);
memento.putInteger("objHash", objHash);
memento.putString("objName", objName);
memento.putString("objType", objType);
memento.putString("counter", counter);
memento.putInteger("serverId", serverId);
}
示例9: saveColors_20_Brightness
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
/**
* Brightness
*/
private static void saveColors_20_Brightness(final IMemento xmlColor, final Map3ColorProfile colorProfile) {
final IMemento xmlBrightness = xmlColor.createChild(GraphColorManager.MEMENTO_CHILD_BRIGHTNESS);
xmlBrightness.putInteger(GraphColorManager.TAG_BRIGHTNESS_MIN, colorProfile.getMinBrightness());
xmlBrightness.putInteger(GraphColorManager.TAG_BRIGHTNESS_MIN_FACTOR, colorProfile.getMinBrightnessFactor());
xmlBrightness.putInteger(GraphColorManager.TAG_BRIGHTNESS_MAX, colorProfile.getMaxBrightness());
xmlBrightness.putInteger(GraphColorManager.TAG_BRIGHTNESS_MAX_FACTOR, colorProfile.getMaxBrightnessFactor());
}
示例10: saveState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void saveState(IPresentationSerializer context, IMemento memento) {
// if closing, the area was not created
if (tabArea == null) {
return;
}
memento.putInteger("toolbarVisible", getFlag(F_TOOLBAR_VISIBLE) ? 1 : 0);
memento.putInteger("tabAreaVisible", getFlag(F_TAB_AREA_VISIBLE) ? 1 : 0);
if (PresentationPlugin.DEBUG_STATE) {
System.out.println(getDebugPartName() + ":saveState");
}
tabArea.saveState(context, memento);
}
示例11: createXmlVertex
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void createXmlVertex(final IMemento mementoProfile,
final int altitude,
final int red,
final int green,
final int blue) {
final IMemento xmlVertex = mementoProfile.createChild(MEMENTO_CHILD_VERTEX);
xmlVertex.putInteger(TAG_ALTITUDE, altitude);
xmlVertex.putInteger(TAG_RED, red);
xmlVertex.putInteger(TAG_GREEN, green);
xmlVertex.putInteger(TAG_BLUE, blue);
}
示例12: setXmlRgb
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
/**
* Creates a child for the color.
*
* @param xmlColor
* @param tagName
* @param rgb
* @return
*/
public static IMemento setXmlRgb(final IMemento xmlColor, final String tagName, final RGB rgb) {
final IMemento xmlColorTag = xmlColor.createChild(tagName);
{
xmlColorTag.putInteger(ATTR_COLOR_RED, rgb.red);
xmlColorTag.putInteger(ATTR_COLOR_GREEN, rgb.green);
xmlColorTag.putInteger(ATTR_COLOR_BLUE, rgb.blue);
}
return xmlColorTag;
}
示例13: saveState_30_Bookmarks
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void saveState_30_Bookmarks(final XMLMemento xmlRoot) {
// <AllBookmarks>
final IMemento xmlAllBookmarks = xmlRoot.createChild(TAG_ALL_BOOKMARKS);
for (final MapBookmark bookmark : _allBookmarks) {
// <Bookmark>
final IMemento xmlBookmark = xmlAllBookmarks.createChild(TAG_BOOKMARK);
{
xmlBookmark.putString(ATTR_ID, bookmark.id);
xmlBookmark.putString(ATTR_NAME, bookmark.name);
/*
* Map position
*/
final MapPosition mapPosition = bookmark.getMapPosition();
Util.setXmlDouble(xmlBookmark, ATTR_MAP_POSITION_X, mapPosition.x);
Util.setXmlDouble(xmlBookmark, ATTR_MAP_POSITION_Y, mapPosition.y);
Util.setXmlDouble(xmlBookmark, ATTR_MAP_POSITION_SCALE, mapPosition.scale);
xmlBookmark.putFloat(ATTR_MAP_POSITION_BEARING, mapPosition.bearing);
xmlBookmark.putFloat(ATTR_MAP_POSITION_TILT, mapPosition.tilt);
xmlBookmark.putInteger(ATTR_MAP_POSITION_ZOOM_LEVEL, mapPosition.zoomLevel);
}
}
}
示例14: saveState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void saveState(IMemento memento) {
super.saveState(memento);
memento.putInteger(KEY_SORTING, fCurrentSortOrder);
memento.putInteger(KEY_LIMIT, getElementLimit().intValue());
}
示例15: writeXmlProfile
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private void writeXmlProfile(final MPProfile mapProfile, final IMemento tagProfile) {
tagProfile.putString(ATTR_MP_TYPE, MAP_PROVIDER_TYPE_MAP_PROFILE);
tagProfile.putInteger(ATTR_PMP_BACKGROUND_COLOR, mapProfile.getBackgroundColor());
/*
* map provider specific fields
*/
for (final MPWrapper mpWrapper : mapProfile.getAllWrappers()) {
final MP mp = mpWrapper.getMP();
final String mpType = getMapProviderType(mp);
if (mpType == null) {
continue;
}
final boolean isDisplayedInMap = mpWrapper.isDisplayedInMap();
if (isDisplayedInMap == false) {
// save only displayed map providers to reduce space
continue;
}
final IMemento tagProfileMapProvider = tagProfile.createChild(TAG_MAP_PROVIDER_WRAPPER);
tagProfileMapProvider.putString(ATTR_PMP_MAP_PROVIDER_TYPE, mpType);
tagProfileMapProvider.putString(ATTR_PMP_MAP_PROVIDER_ID, mp.getId());
tagProfileMapProvider.putInteger(ATTR_PMP_POSITION, mpWrapper.getPositionIndex());
tagProfileMapProvider.putBoolean(ATTR_PMP_IS_DISPLAYED, isDisplayedInMap);
tagProfileMapProvider.putInteger(ATTR_PMP_ALPHA, mpWrapper.getAlpha());
tagProfileMapProvider.putBoolean(ATTR_PMP_IS_TRANSPARENT, mpWrapper.isTransparentColors());
tagProfileMapProvider.putBoolean(ATTR_PMP_IS_BLACK_TRANSPARENT, mpWrapper.isTransparentBlack());
tagProfileMapProvider.putBoolean(ATTR_PMP_IS_BRIGHTNESS_FOR_NEXT_MP, mpWrapper.isBrightnessForNextMp());
tagProfileMapProvider.putInteger(ATTR_PMP_BRIGHTNESS_FOR_NEXT_MP, mpWrapper.getBrightnessValueForNextMp());
// transparent colors
final int[] transparentColors = mpWrapper.getTransparentColors();
if (transparentColors != null) {
// create a child for each color
for (final int color : transparentColors) {
// don't write black color this is with the attribute ATTR_PMP_IS_TRANSPARENT_BLACK
if (color > 0) {
tagProfileMapProvider//
.createChild(TAG_TRANSPARENT_COLOR)
.putInteger(ATTR_TRANSPARENT_COLOR_VALUE, color);
}
}
}
// wms layers
if (mp instanceof MPWms) {
writeXmlWmsLayers(tagProfileMapProvider, (MPWms) mp);
}
}
}