本文整理匯總了Java中org.eclipse.ui.IMemento.putString方法的典型用法代碼示例。如果您正苦於以下問題:Java IMemento.putString方法的具體用法?Java IMemento.putString怎麽用?Java IMemento.putString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.ui.IMemento
的用法示例。
在下文中一共展示了IMemento.putString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: populateWithStateToSave
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private void populateWithStateToSave(final VSUser user, final IMemento memento) {
for (final Iterator it = user.workspaces.keySet().iterator(); it.hasNext();) {
final String workspaceName = (String) it.next();
final VSWorkspace workspace = (VSWorkspace) user.workspaces.get(workspaceName);
final IMemento workspaceMemento = memento.createChild(WORKSPACE_CHILDREN, workspace.name);
for (final Iterator expandedPathsIt = workspace.expandedPaths.iterator(); expandedPathsIt.hasNext();) {
final String path = (String) expandedPathsIt.next();
final IMemento expandedMemento = workspaceMemento.createChild(EXPANDED_CHILDREN);
expandedMemento.putString(PATH_KEY, path);
}
if (workspace.selectedPath != null) {
final IMemento selectedMemento = workspaceMemento.createChild(SELECTED_CHILD);
selectedMemento.putString(PATH_KEY, workspace.selectedPath);
}
}
}
示例3: saveState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
@Override
public void saveState(final IMemento memento) {
super.saveState(memento);
final IMemento settings = memento.createChild(PARTICIPANT_SETTINGS);
// persist the paths of all resources that we're currently
// synchronizing,
// we'll use these paths to restore the synchronization view
final IResource[] resources = getResources();
final StringBuffer resourceList = new StringBuffer();
for (int i = 0; i < resources.length; i++) {
if (i > 0) {
resourceList.append("|"); //$NON-NLS-1$
}
resourceList.append(resources[i].getLocation().toOSString());
if (resources[i].getType() != IResource.FILE) {
resourceList.append("/"); //$NON-NLS-1$
}
}
settings.putString(PARTICIPANT_SETTINGS_RESOURCES, resourceList.toString());
}
示例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: createLayerXml_120_Default
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void createLayerXml_120_Default( final IMemento xmlCategory,
final boolean isEnabled,
final boolean canSetOpacity,
final float opacity,
final String defaultLayerId) {
final DefaultLayer mapDefaultLayer = MapDefaultLayer.getLayer(defaultLayerId);
if (mapDefaultLayer == null) {
return;
}
final IMemento xmlLayer = xmlCategory.createChild(TAG_LAYER);
xmlLayer.putString(ATTR_ID, defaultLayerId);
xmlLayer.putBoolean(ATTR_IS_ENABLED, isEnabled);
xmlLayer.putBoolean(ATTR_IS_DEFAULT_LAYER, true);
// opacity
xmlLayer.putFloat(ATTR_OPACITY, opacity);
xmlLayer.putBoolean(ATTR_CAN_SET_OPACITY, canSetOpacity);
}
示例7: persistLogicalJavaElement
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void persistLogicalJavaElement(ILogicalJavaElement element,
IMemento memento) throws PersistenceException {
memento.putString(KEY_CLASS, element.getClass().getSimpleName());
if (element instanceof LogicalType) {
memento.putString(KEY_FULLY_QUALIFIED_NAME,
((LogicalType) element).getFullyQualifiedName());
} else if (element instanceof LogicalPackage) {
memento.putString(KEY_PACKAGE_NAME,
((LogicalPackage) element).getPackageName());
} else {
throw new PersistenceException("Could not persist "
+ element.getClass().getName());
}
}
示例8: saveState_URI
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private static void saveState_URI( final URI[] location,
final IMetadataRepositoryManager metaManager,
final IMemento xmlRepositories,
final boolean isEnabled) {
for (final URI uri : location) {
final IMemento xmlRepo = xmlRepositories.createChild(TAG_REPOSITORY);
final String nickName = metaManager.getRepositoryProperty(uri, IRepository.PROP_NICKNAME);
xmlRepo.putString(ATTR_URI, uri.toASCIIString());
xmlRepo.putString(ATTR_NICK_NAME, nickName);
xmlRepo.putBoolean(ATTR_IS_ENABLED, isEnabled);
}
}
示例9: storeItemToMemento
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
@Override
protected void storeItemToMemento(final Object item, final IMemento memento) {
if (item instanceof IEObjectDescription) {
final URI uri = ((IEObjectDescription) item).getEObjectURI();
memento.putString(MEMENTO_URI_KEY, uri.toString());
}
}
示例10: toXml
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
@Override
public void toXml(ZooKeeperConnectionDescriptor connectionDescriptor, XMLMemento memento) {
memento.putString(XML_TAG_SESSION_TIMEOUT, String.valueOf(connectionDescriptor.getSessionTimeout()));
String rootPath = connectionDescriptor.getRootPath();
if (rootPath != null) {
memento.putString(XML_TAG_ROOT_PATH, rootPath);
}
IMemento serversMemento = memento.createChild(XML_TAG_ZOO_KEEPER_SERVERS);
for (ZooKeeperServerDescriptor serverDescriptor : connectionDescriptor.getServers()) {
IMemento serverMemento = serversMemento.createChild(XML_TAG_ZOO_KEEPER_SERVER);
serverMemento.putString(XML_TAG_ZOO_KEEPER_SERVER_HOST, serverDescriptor.getHost());
serverMemento.putString(XML_TAG_ZOO_KEEPER_SERVER_PORT, String.valueOf(serverDescriptor.getPort()));
JmxConnectionDescriptor jmxConnectionDescriptor = serverDescriptor.getJmxConnectionDescriptor();
if (jmxConnectionDescriptor != null) {
serverMemento
.putString(XML_TAG_ZOO_KEEPER_SERVER_JMX_CONNECTION, jmxConnectionDescriptor.getName());
_JmxConnectionDescriptorFiles.save(jmxConnectionDescriptor);
}
}
IMemento authInfosMemento = memento.createChild(XML_TAG_AUTH_INFOS);
for (AuthInfo authInfo : connectionDescriptor.getAuthInfos()) {
IMemento authInfoMemento = authInfosMemento.createChild(XML_TAG_AUTH_INFO);
authInfoMemento.putString(XML_TAG_AUTH_INFO_TYPE, authInfo.getType().name());
authInfoMemento.putString(XML_TAG_AUTH_INFO_SCHEME, authInfo.getScheme());
authInfoMemento.putString(XML_TAG_AUTH_INFO_AUTH, authInfo.getAuthString());
}
}
示例11: saveState
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
@Override
public void saveState ( final IMemento memento )
{
memento.putString ( CONNECTION_ID, this.connectionId );
memento.putString ( CONNECTION_URI, this.connectionUri );
super.saveState ( memento );
}
示例12: saveTo
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void saveTo ( final IMemento memento )
{
if ( memento == null )
{
return;
}
memento.putString ( "item.id", this.id );
memento.putString ( "connection.uri", this.connectionString );
memento.putString ( "type", this.type.toString () );
}
示例13: 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);
}
示例14: getPersistable
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public IPersistableElement getPersistable() {
return new IPersistableElement() {
public String getFactoryId() {
return FACTORY_ID;
}
public void saveState(IMemento memento) {
memento.putString(FEATURE_ID, aboutInfo.getFeatureId() + ':'
+ aboutInfo.getVersionId());
}
};
}
示例15: saveExpandedElements
import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
private void saveExpandedElements(IMemento memento) {
Object[] expandedElements = bookmarksTreeViewer.getVisibleExpandedElements();
StringBuilder sb = new StringBuilder();
for (Object element : expandedElements) {
if (element instanceof Bookmark) {
Bookmark bookmark = (Bookmark) element;
if (sb.length() != 0) {
sb.append(',');
}
sb.append(bookmark.getId());
}
}
memento.putString(STORE_EXPANDED, sb.toString());
}