• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java LinkedNotebook类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.evernote.edam.type.LinkedNotebook的典型用法代码示例。如果您正苦于以下问题:Java LinkedNotebook类的具体用法?Java LinkedNotebook怎么用?Java LinkedNotebook使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



LinkedNotebook类属于com.evernote.edam.type包,在下文中一共展示了LinkedNotebook类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getView

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
@Override
public View getView(int position, View convertView, ViewGroup parent) {
    ViewHolder viewHolder;
    if (convertView == null) {
        convertView = LayoutInflater.from(getActivity()).inflate(android.R.layout.simple_list_item_1, parent, false);
        viewHolder = new ViewHolder(convertView);
        convertView.setTag(viewHolder);
    } else {
        viewHolder = (ViewHolder) convertView.getTag();
    }

    LinkedNotebook notebook = getItem(position);
    viewHolder.mTextView1.setText(notebook.getShareName());

    return convertView;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:17,代码来源:LinkedNotebookListFragment.java


示例2: onFindLinkedNotebooks

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
@TaskResult(id = "linked")
public void onFindLinkedNotebooks(List<LinkedNotebook> linkedNotebooks) {
    mSwipeRefreshLayout.setRefreshing(false);

    if (linkedNotebooks == null || linkedNotebooks.isEmpty()) {
        getChildFragmentManager().beginTransaction()
                .replace(R.id.fragment_container, EmptyFragment.create("linked notebooks"))
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
                .commit();
    } else {
        getChildFragmentManager().beginTransaction()
                .replace(R.id.fragment_container, LinkedNotebookListFragment.create(linkedNotebooks))
                .setTransition(FragmentTransaction.TRANSIT_FRAGMENT_FADE)
                .commit();
    }
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:17,代码来源:LinkedNotebookContainerFragment.java


示例3: getLinkedHtmlHelper

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * Use this method, if you want to download a linked note as HTML.
 *
 * @param linkedNotebook The referenced {@link LinkedNotebook}. Its GUID and share key must not be
 *                       {@code null}.
 * @return An async wrapper to load a note as HTML from the Evernote service.
 */
public EvernoteHtmlHelper getLinkedHtmlHelper(@NonNull LinkedNotebook linkedNotebook) throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {
    String key = linkedNotebook.getGuid();

    EvernoteHtmlHelper htmlHelper = mLinkedHtmlHelper.get(key);
    if (htmlHelper == null) {
        String url = linkedNotebook.getNoteStoreUrl();

        EvernoteNoteStoreClient client = getNoteStoreClient(url, EvernotePreconditions.checkNotEmpty(mEvernoteSession.getAuthToken()));
        AuthenticationResult authenticationResult = client.authenticateToSharedNotebook(linkedNotebook.getShareKey());

        htmlHelper = createHtmlHelper(authenticationResult.getAuthenticationToken());

        mLinkedHtmlHelper.put(key, htmlHelper);
    }

    return htmlHelper;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:25,代码来源:EvernoteClientFactory.java


示例4: createBusinessNotebook

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @param notebook The new business notebook.
 * @param defaultClient The note store client, which references the user's note store.
 * @return The new created {@link LinkedNotebook}, which has an business ID.
 */
public LinkedNotebook createBusinessNotebook(@NonNull Notebook notebook, @NonNull EvernoteNoteStoreClient defaultClient)
        throws TException, EDAMUserException, EDAMSystemException, EDAMNotFoundException {

    Notebook originalNotebook = mClient.createNotebook(notebook);

    List<SharedNotebook> sharedNotebooks = originalNotebook.getSharedNotebooks();
    SharedNotebook sharedNotebook = sharedNotebooks.get(0);

    LinkedNotebook linkedNotebook = new LinkedNotebook();
    linkedNotebook.setShareKey(sharedNotebook.getShareKey());
    linkedNotebook.setShareName(originalNotebook.getName());
    linkedNotebook.setUsername(mBusinessUserName);
    linkedNotebook.setShardId(mBusinessUserShardId);

    return defaultClient.createLinkedNotebook(linkedNotebook);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:22,代码来源:EvernoteBusinessNotebookHelper.java


示例5: loadNotebook

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * If this note is linked, then it loads the corresponding notebook for the linked notebook. Use
 * {@link #loadLinkedNotebook()} to get the linked notebook.
 *
 * @return The note's notebook from server.
 * @see #isLinked()
 * @see EvernoteLinkedNotebookHelper#getCorrespondingNotebook()
 */
public Notebook loadNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    if (mNotebookGuid == null) {
        return null;
    }

    if (mLinked) {
        LinkedNotebook linkedNotebook = NoteRefHelper.getLinkedNotebook(mNotebookGuid);
        return NoteRefHelper.getSession().getEvernoteClientFactory().getLinkedNotebookHelper(linkedNotebook).getCorrespondingNotebook();
    }

    EvernoteNoteStoreClient noteStore = NoteRefHelper.getNoteStore(this);
    if (noteStore == null) {
        return null;
    }

    return noteStore.getNotebook(mNotebookGuid);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:26,代码来源:NoteRef.java


示例6: loadLinkedNotebook

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @return The linked notebook if this is a linked note.
 * @see #isLinked()
 */
public LinkedNotebook loadLinkedNotebook() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    if (!mLinked) {
        return null;
    }

    EvernoteNoteStoreClient noteStore = NoteRefHelper.getSession().getEvernoteClientFactory().getNoteStoreClient();
    if (noteStore == null) {
        return null;
    }

    List<LinkedNotebook> linkedNotebooks = noteStore.listLinkedNotebooks();
    for (LinkedNotebook linkedNotebook : linkedNotebooks) {
        if (linkedNotebook.getGuid().equals(mNotebookGuid)) {
            return linkedNotebook;
        }
    }

    return null;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:24,代码来源:NoteRef.java


示例7: listNotebooks

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * return a user's all notebooks(including linked notebooks).
 *
 * @return The user's notebooks.
 */
@Override
public Map<String, ENObject> listNotebooks() throws EDAMUserException, EDAMSystemException, TException, EDAMNotFoundException {
    List<Notebook> notebooks = factory.getNoteStoreClient().listNotebooks();
    List<LinkedNotebook> linkedNotebooks = factory.getNoteStoreClient().listLinkedNotebooks();

    Map<String, ENObject> map = MapUtil.map();
    for (Notebook n : notebooks) {
        map.put(n.getName(), ENObjectImpl.forNameAndGuid(n.getName(), n.getGuid()));
    }

    for (LinkedNotebook linkedNotebook : linkedNotebooks) { // LinkedNotebook must be serializable
        NoteStoreClient linkedNoteStore = factory.getLinkedNoteStoreClient(linkedNotebook);
        SharedNotebook sharedNotebook = linkedNoteStore.getSharedNotebookByAuth();

        if (map.containsKey(linkedNotebook.getShareName())) {
            map.put(linkedNotebook.getShareName() + ConstantsUtil.LEFT_PARENTHESIS + linkedNotebook.getUsername() + ConstantsUtil.COLON + sharedNotebook.getNotebookGuid() + ConstantsUtil.RIGHT_PARENTHESIS, ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
        } else {
            map.put(linkedNotebook.getShareName(), ENObjectImpl.forValues(linkedNotebook.getShareName(), sharedNotebook.getNotebookGuid(), ENObjectType.LINKED, linkedNotebook));
        }
    }

    return map;
}
 
开发者ID:LTTPP,项目名称:Eemory,代码行数:29,代码来源:EeClipperImpl.java


示例8: getSharedWithMeOrPublicNotebookLabel

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
private SSLabel getSharedWithMeOrPublicNotebookLabel(
  final LinkedNotebook sharedWithMeOrPublicNotebook) throws SSErr{
  
  try{
    final SSLabel tmpLabel = SSLabel.get(sharedWithMeOrPublicNotebook.getShareName());
    
    if(tmpLabel == null){
      return getDefaultLabel();
    }else{
      return tmpLabel;
    }
  }catch(Exception error){
     SSLogU.warn(error);
    return getDefaultLabel();
  }
}
 
开发者ID:learning-layers,项目名称:SocialSemanticServer,代码行数:17,代码来源:SSDataImportBNPEvernoteImporter.java


示例9: testLinkedNoteStoreClientWithException

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
@Test
public void testLinkedNoteStoreClientWithException() throws Exception {
	EDAMUserException exception = new EDAMUserException();
	ClientFactory clientFactory = mock(ClientFactory.class);
	when(clientFactory.createLinkedNoteStoreClient(argThat(any(LinkedNotebook.class)))).thenThrow(exception);

	EvernoteTemplate template = new EvernoteTemplate(EvernoteService.SANDBOX, "token");
	replaceClientFactory(template, clientFactory);

	try {
		template.linkedNoteStoreClient(mock(LinkedNotebook.class));
		fail("didn't thrown exception");
	} catch (EvernoteException e) {
		Throwable cause = e.getCause();
		assertThat(cause, is(instanceOf(EDAMUserException.class)));
		assertThat((EDAMUserException) cause, is(sameInstance(exception)));
	}
}
 
开发者ID:ttddyy,项目名称:spring-social-evernote,代码行数:19,代码来源:EvernoteTemplateStoreClientTest.java


示例10: create

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
public static NoteContainerFragment create(@Nullable Notebook notebook, @Nullable LinkedNotebook linkedNotebook, @Nullable String mReceivedString) {
    Bundle args = new Bundle();
    args.putSerializable(KEY_NOTEBOOK, notebook);
    args.putSerializable(KEY_LINKED_NOTEBOOK, linkedNotebook);
    args.putSerializable(KEY_RECEIVED_STRING, mReceivedString);

    NoteContainerFragment fragment = new NoteContainerFragment();
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:11,代码来源:NoteContainerFragment.java


示例11: onCreate

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
@Override
public void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);

    mNotebook = (Notebook) getArguments().getSerializable(KEY_NOTEBOOK);
    mLinkedNotebook = (LinkedNotebook) getArguments().getSerializable(KEY_LINKED_NOTEBOOK);
    mReceivedString = (String) getArguments().getSerializable(KEY_RECEIVED_STRING);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:10,代码来源:NoteContainerFragment.java


示例12: create

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
public static LinkedNotebookListFragment create(List<LinkedNotebook> notebooks) {
    Bundle args = new Bundle();
    ParcelableUtil.putSerializableList(args, new ArrayList<Serializable>(notebooks), KEY_LINKED_NOTEBOOK_LIST);

    LinkedNotebookListFragment fragment = new LinkedNotebookListFragment();
    fragment.setArguments(args);
    return fragment;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:9,代码来源:LinkedNotebookListFragment.java


示例13: CreateNewNoteTask

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
public CreateNewNoteTask(String title, String content, ImageData imageData, Notebook notebook, LinkedNotebook linkedNotebook) {
    super(Note.class);

    mTitle = title;
    mContent = content;
    mImageData = imageData;
    mNotebook = notebook;
    mLinkedNotebook = linkedNotebook;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:10,代码来源:CreateNewNoteTask.java


示例14: FindNotesTask

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public FindNotesTask(int offset, int maxNotes, @Nullable Notebook notebook, @Nullable LinkedNotebook linkedNotebook, @Nullable String query) {
    super((Class) List.class);

    NoteFilter noteFilter = new NoteFilter();
    noteFilter.setOrder(NoteSortOrder.UPDATED.getValue());

    if (!TextUtils.isEmpty(query)) {
        noteFilter.setWords(query);
    }else{
        //TODO: let the user choose a tag he wants here we just use favorit as tag to filter by
        List<String> list = new ArrayList();
        list.add("03750a45-c107-4e8b-afbf-29fa22777244");
        noteFilter.setTagGuids(list);
    }

    if (notebook != null) {
        noteFilter.setNotebookGuid(notebook.getGuid());
    }

    mSearch = new EvernoteSearchHelper.Search()
            .setOffset(offset)
            .setMaxNotes(maxNotes)
            .setNoteFilter(noteFilter);

    if (linkedNotebook != null) {
        mSearch.addLinkedNotebook(linkedNotebook);
    } else {
        mSearch.addScope(EvernoteSearchHelper.Scope.PERSONAL_NOTES);
    }

}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:33,代码来源:FindNotesTask.java


示例15: getLinkedNotebookHelper

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * Returns an async wrapper providing several helper methods for this {@link LinkedNotebook}. With
 * {@link EvernoteLinkedNotebookHelper#getClient()} you can get access to the underlying {@link EvernoteNoteStoreClient},
 * which references the {@link LinkedNotebook}'s note store URL.
 *
 * @param linkedNotebook The referenced {@link LinkedNotebook}. Its GUID and share key must not be
 *                       {@code null}.
 * @return An async wrapper providing several helper methods.
 */
public synchronized EvernoteLinkedNotebookHelper getLinkedNotebookHelper(@NonNull LinkedNotebook linkedNotebook)
        throws EDAMUserException, EDAMSystemException, EDAMNotFoundException, TException {

    String key = linkedNotebook.getGuid();
    EvernoteLinkedNotebookHelper notebookHelper = mLinkedNotebookHelpers.get(key);
    if (notebookHelper == null) {
        notebookHelper = createLinkedNotebookHelper(linkedNotebook);
        mLinkedNotebookHelpers.put(key, notebookHelper);
    }

    return notebookHelper;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:22,代码来源:EvernoteClientFactory.java


示例16: getLinkedNotebookHelperAsync

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @see #getLinkedNotebookHelper(LinkedNotebook)
 */
public Future<EvernoteLinkedNotebookHelper> getLinkedNotebookHelperAsync(@NonNull final LinkedNotebook linkedNotebook,
                                                                         @Nullable EvernoteCallback<EvernoteLinkedNotebookHelper> callback) {

    return mCreateHelperClient.submitTask(new Callable<EvernoteLinkedNotebookHelper>() {
        @Override
        public EvernoteLinkedNotebookHelper call() throws Exception {
            return getLinkedNotebookHelper(linkedNotebook);
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:14,代码来源:EvernoteClientFactory.java


示例17: getLinkedHtmlHelperAsync

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @see #getLinkedNotebookHelper(LinkedNotebook)
 */
public Future<EvernoteHtmlHelper> getLinkedHtmlHelperAsync(@NonNull final LinkedNotebook linkedNotebook, @Nullable EvernoteCallback<EvernoteHtmlHelper> callback) {
    return mCreateHelperClient.submitTask(new Callable<EvernoteHtmlHelper>() {
        @Override
        public EvernoteHtmlHelper call() throws Exception {
            return getLinkedHtmlHelper(linkedNotebook);
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:12,代码来源:EvernoteClientFactory.java


示例18: listBusinessNotebooks

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @param defaultClient The note store client, which references the user's note store.
 * @return A list of {@link LinkedNotebook}s, which all have a business ID.
 */
public List<LinkedNotebook> listBusinessNotebooks(@NonNull EvernoteNoteStoreClient defaultClient) throws EDAMUserException,
        EDAMSystemException, TException, EDAMNotFoundException {

    List<LinkedNotebook> businessNotebooks = new ArrayList<>(defaultClient.listLinkedNotebooks());

    Iterator<LinkedNotebook> iterator = businessNotebooks.iterator();
    while (iterator.hasNext()) {
        if (!isBusinessNotebook(iterator.next())) {
            iterator.remove();
        }
    }

    return businessNotebooks;
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:19,代码来源:EvernoteBusinessNotebookHelper.java


示例19: listBusinessNotebooksAsync

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @see #listBusinessNotebooks(EvernoteNoteStoreClient)
 */
public Future<List<LinkedNotebook>> listBusinessNotebooksAsync(@NonNull final EvernoteNoteStoreClient defaultClient,
                                                               @Nullable EvernoteCallback<List<LinkedNotebook>> callback) {

    return submitTask(new Callable<List<LinkedNotebook>>() {
        @Override
        public List<LinkedNotebook> call() throws Exception {
            return listBusinessNotebooks(defaultClient);
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:14,代码来源:EvernoteBusinessNotebookHelper.java


示例20: createBusinessNotebookAsync

import com.evernote.edam.type.LinkedNotebook; //导入依赖的package包/类
/**
 * @see #createBusinessNotebook(Notebook, EvernoteNoteStoreClient)
 */
public Future<LinkedNotebook> createBusinessNotebookAsync(@NonNull final Notebook notebook, @NonNull final EvernoteNoteStoreClient defaultClient,
                                                          @Nullable EvernoteCallback<LinkedNotebook> callback) {

    return submitTask(new Callable<LinkedNotebook>() {
        @Override
        public LinkedNotebook call() throws Exception {
            return createBusinessNotebook(notebook, defaultClient);
        }
    }, callback);
}
 
开发者ID:fivef,项目名称:add_to_evernote_note,代码行数:14,代码来源:EvernoteBusinessNotebookHelper.java



注:本文中的com.evernote.edam.type.LinkedNotebook类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SeatBid类代码示例发布时间:2022-05-23
下一篇:
Java ExternalSort类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap