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


Java IMemento.putTextData方法代碼示例

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


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

示例1: saveState

import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
@Override
public void saveState ( final IMemento memento )
{
    super.saveState ( memento );
    if ( memento == null )
    {
        return;
    }

    final Resource resource = new XMIResourceFactoryImpl ().createResource ( null );
    resource.getContents ().add ( this.configuration );

    final ByteArrayOutputStream outputStream = new ByteArrayOutputStream ();

    final Map<?, ?> options = new HashMap<Object, Object> ();

    try
    {
        resource.save ( outputStream, options );
        final IMemento child = memento.createChild ( CHILD_CONFIGURATION );

        child.putTextData ( StringUtils.newStringUtf8 ( Base64.encodeBase64 ( outputStream.toByteArray (), true ) ) );
    }
    catch ( final Exception e )
    {
        StatusManager.getManager ().handle ( StatusHelper.convertStatus ( Activator.PLUGIN_ID, e ), StatusManager.LOG );
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:29,代碼來源:ChartView.java

示例2: snapshot

import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
/**
 * Snapshot the projects currently associated with the repository
 * <p>
 * The memento returned can be later passed to {@link #save(IMemento)} to
 * persist it
 *
 * @see #save(IMemento)
 * @return memento, will be null on failures
 */
public IMemento snapshot() {
	String branch = getBranch();
	if (branch == null)
		return null;

	IProject[] projects;
	try {
		projects = ProjectUtil.getValidOpenProjects(repository);
	} catch (CoreException e) {
		return null;
	}
	XMLMemento memento = XMLMemento.createWriteRoot(KEY_PROJECTS);
	memento.putString(KEY_BRANCH, branch);
	final String workDir = repository.getWorkTree().getAbsolutePath();
	for (IProject project : projects) {
		IPath path = project.getLocation();
		if (path == null)
			continue;
		// Only remember mapped projects
		if (!(RepositoryProvider.getProvider(project) instanceof GitProvider))
			continue;
		String fullPath = path.toOSString();
		if (fullPath.startsWith(workDir)) {
			String relative = fullPath.substring(workDir.length());
			if (relative.length() == 0)
				relative = REPO_ROOT;
			IMemento child = memento.createChild(KEY_PROJECT);
			child.putTextData(relative);
		}
	}
	return memento;
}
 
開發者ID:Genuitec,項目名稱:gerrit-tools,代碼行數:42,代碼來源:BranchProjectTracker.java

示例3: save

import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void save(IMemento memento) {
  // We have to make sure to call super.toString() here to use JsniRef's
  // toString(), which provides the literal text of the Java reference)
  memento.putTextData(super.toString());
  memento.putString(TAG_SOURCE, getSource().toString());
  memento.putInteger(TAG_OFFSET, getOffset());
}
 
開發者ID:gwt-plugins,項目名稱:gwt-eclipse-plugin,代碼行數:8,代碼來源:IndexedJsniJavaRef.java

示例4: saveList

import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
protected final void saveList(IMemento memento) {
	String firstItem = combo.getText();
	IMemento child = memento.createChild(URL);
	child.putTextData(firstItem);
	
	String[] list = combo.getItems();
	for(int i = 0; i < list.length; ++i) {
		if (list[i].equals(firstItem)) {
			continue;
		}
		child = memento.createChild(URL);
		child.putTextData(list[i]);
	}
}
 
開發者ID:apicloudcom,項目名稱:APICloud-Studio,代碼行數:15,代碼來源:InputURLDialog.java

示例5: save

import org.eclipse.ui.IMemento; //導入方法依賴的package包/類
public void save(IMemento memento) {
  memento.putTextData(paramTypeString);
  memento.putString(TAG_SOURCE, getSource().toString());
  memento.putInteger(TAG_OFFSET, getOffset());
}
 
開發者ID:gwt-plugins,項目名稱:gwt-eclipse-plugin,代碼行數:6,代碼來源:JsniJavaRefParamType.java


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