本文整理汇总了Java中org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem类的典型用法代码示例。如果您正苦于以下问题:Java BookmarkItem类的具体用法?Java BookmarkItem怎么用?Java BookmarkItem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
BookmarkItem类属于org.chromium.chrome.browser.bookmarks.BookmarkBridge包,在下文中一共展示了BookmarkItem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bookmarkNodeRemoved
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
public void bookmarkNodeRemoved(BookmarkItem parent, int oldIndex, BookmarkItem node,
boolean isDoingExtensiveChanges) {
// If the folder is removed in folder mode, show the parent folder or falls back to all
// bookmarks mode.
if (getCurrentState() == BookmarkUIState.STATE_FOLDER
&& node.getId().equals(mStateStack.peek().mFolder)) {
if (mBookmarkModel.getTopLevelFolderIDs(true, true).contains(
node.getId())) {
openFolder(mBookmarkModel.getDefaultFolder());
} else {
openFolder(parent.getId());
}
}
mSelectionDelegate.clearSelection();
}
示例2: setBookmarkId
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
BookmarkItem item = super.setBookmarkId(bookmarkId);
mUrl = item.getUrl();
mIconImageView.setImageDrawable(null);
mTitleView.setText(item.getTitle());
mDelegate.getLargeIconBridge().getLargeIconForUrl(mUrl, mMinIconSize, this);
return item;
}
示例3: onCreate
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mModel = new BookmarkModel();
mBookmarkId = BookmarkId.getBookmarkIdFromString(
getIntent().getStringExtra(INTENT_BOOKMARK_ID));
mModel.addObserver(mBookmarkModelObserver);
BookmarkItem item = mModel.getBookmarkById(mBookmarkId);
if (!mModel.doesBookmarkExist(mBookmarkId) || item == null) {
finish();
return;
}
setContentView(R.layout.bookmark_edit);
mTitleEditText = (EmptyAlertEditText) findViewById(R.id.title_text);
mFolderTextView = (TextView) findViewById(R.id.folder_text);
mUrlEditText = (EmptyAlertEditText) findViewById(R.id.url_text);
mFolderTextView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
BookmarkFolderSelectActivity.startFolderSelectActivity(
BookmarkEditActivity.this, mBookmarkId);
}
});
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
updateViewContent(false);
}
示例4: updateViewContent
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
/**
* @param modelChanged Whether this view update is due to a model change in background.
*/
private void updateViewContent(boolean modelChanged) {
BookmarkItem bookmarkItem = mModel.getBookmarkById(mBookmarkId);
// While the user is editing the bookmark, do not override user's input.
if (!modelChanged) {
mTitleEditText.setText(bookmarkItem.getTitle());
mUrlEditText.setText(bookmarkItem.getUrl());
}
mFolderTextView.setText(mModel.getBookmarkTitle(bookmarkItem.getParentId()));
mTitleEditText.setEnabled(bookmarkItem.isEditable());
mUrlEditText.setEnabled(bookmarkItem.isUrlEditable());
mFolderTextView.setEnabled(bookmarkItem.isMovable());
}
示例5: bookmarkNodeMoved
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
public void bookmarkNodeMoved(BookmarkItem oldParent, int oldIndex, BookmarkItem newParent,
int newIndex) {
if (!oldParent.getId().equals(newParent.getId())
&& mModel.getChildAt(newParent.getId(), newIndex).equals(mFolderId)) {
updateParent(newParent.getId());
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:9,代码来源:BookmarkAddEditFolderActivity.java
示例6: bookmarkNodeRemoved
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
public void bookmarkNodeRemoved(BookmarkItem parent, int oldIndex, BookmarkItem node,
boolean isDoingExtensiveChanges) {
if (mBookmarksToMove.contains(node.getId())) {
mBookmarksToMove.remove(node.getId());
if (mBookmarksToMove.isEmpty()) {
finish();
return;
}
} else if (node.isFolder()) {
updateFolderList();
}
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:14,代码来源:BookmarkFolderSelectActivity.java
示例7: setBookmarkId
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
/**
* Updates this row for the given {@link BookmarkId}.
* @return The {@link BookmarkItem} corresponding the given {@link BookmarkId}.
*/
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
mBookmarkId = bookmarkId;
BookmarkItem bookmarkItem = mDelegate.getModel().getBookmarkById(bookmarkId);
clearPopup();
if (isSelectable()) {
mMoreIcon.setVisibility(bookmarkItem.isEditable() ? VISIBLE : GONE);
setChecked(mDelegate.getSelectionDelegate().isItemSelected(bookmarkId));
}
super.setItem(bookmarkId);
return bookmarkItem;
}
示例8: fromBookmarkItem
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
public static Bookmark fromBookmarkItem(BookmarkItem item) {
if (item == null) return null;
Bookmark bookmark = new Bookmark();
bookmark.title = item.getTitle();
bookmark.url = item.getUrl();
bookmark.id = item.getId();
bookmark.parentId = item.getParentId();
bookmark.isFolder = item.isFolder();
return bookmark;
}
示例9: loadBookmarks
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@UiThread
private void loadBookmarks(BookmarkId folderId) {
mFolder = new BookmarkFolder();
// Load the requested folder if it exists. Otherwise, fall back to the default folder.
if (folderId != null) {
mFolder.folder = Bookmark.fromBookmarkItem(mBookmarkModel.getBookmarkById(
folderId));
}
if (mFolder.folder == null) {
folderId = mBookmarkModel.getDefaultFolder();
mFolder.folder = Bookmark.fromBookmarkItem(mBookmarkModel.getBookmarkById(
folderId));
}
mFolder.parent = Bookmark.fromBookmarkItem(mBookmarkModel.getBookmarkById(
mFolder.folder.parentId));
List<BookmarkItem> items = mBookmarkModel.getBookmarksForFolder(folderId);
// Move folders to the beginning of the list.
Collections.sort(items, new Comparator<BookmarkItem>() {
@Override
public int compare(BookmarkItem lhs, BookmarkItem rhs) {
return lhs.isFolder() == rhs.isFolder() ? 0 : lhs.isFolder() ? -1 : 1;
}
});
for (BookmarkItem item : items) {
Bookmark bookmark = Bookmark.fromBookmarkItem(item);
loadFavicon(bookmark);
mFolder.children.add(bookmark);
}
taskFinished();
}
示例10: setBookmarkId
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
/**
* Updates this row for the given {@link BookmarkId}.
* @return The {@link BookmarkItem} corresponding the given {@link BookmarkId}.
*/
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
mBookmarkId = bookmarkId;
BookmarkItem bookmarkItem = mDelegate.getModel().getBookmarkById(bookmarkId);
clearPopup();
mMoreIcon.setVisibility(bookmarkItem.isEditable() ? VISIBLE : GONE);
setChecked(mDelegate.getSelectionDelegate().isItemSelected(bookmarkId));
super.setItem(bookmarkId);
return bookmarkItem;
}
示例11: setBookmarkId
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
BookmarkItem item = super.setBookmarkId(bookmarkId);
mTitleView.setText(item.getTitle());
return item;
}
示例12: bookmarkNodeRemoved
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
public void bookmarkNodeRemoved(BookmarkItem parent, int oldIndex, BookmarkItem node,
boolean isDoingExtensiveChanges) {
if (!node.getId().equals(mFolderId)) return;
finish();
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:7,代码来源:BookmarkAddEditFolderActivity.java
示例13: onCreate
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
mModel = new BookmarkModel();
mModel.addObserver(mBookmarkModelObserver);
mIsAddMode = getIntent().getBooleanExtra(INTENT_IS_ADD_MODE, false);
if (mIsAddMode) {
List<String> stringList = getIntent().getStringArrayListExtra(
BookmarkFolderSelectActivity.INTENT_BOOKMARKS_TO_MOVE);
mBookmarksToMove = new ArrayList<>(stringList.size());
for (String string : stringList) {
mBookmarksToMove.add(BookmarkId.getBookmarkIdFromString(string));
}
} else {
mFolderId = BookmarkId.getBookmarkIdFromString(
getIntent().getStringExtra(INTENT_BOOKMARK_ID));
}
setContentView(R.layout.bookmark_add_edit_folder_activity);
mParentTextView = (TextView) findViewById(R.id.parent_folder);
mFolderTitle = (EmptyAlertEditText) findViewById(R.id.folder_title);
mParentTextView.setOnClickListener(this);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
if (mIsAddMode) {
getSupportActionBar().setTitle(R.string.add_folder);
updateParent(mModel.getDefaultFolder());
} else {
// Edit mode
getSupportActionBar().setTitle(R.string.edit_folder);
BookmarkItem bookmarkItem = mModel.getBookmarkById(mFolderId);
updateParent(bookmarkItem.getParentId());
mFolderTitle.setText(bookmarkItem.getTitle());
mFolderTitle.setSelection(mFolderTitle.getText().length());
mParentTextView.setEnabled(bookmarkItem.isMovable());
}
mParentTextView.setText(mModel.getBookmarkTitle(mParentId));
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:44,代码来源:BookmarkAddEditFolderActivity.java
示例14: setBookmarkId
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
BookmarkItem setBookmarkId(BookmarkId bookmarkId) {
BookmarkItem item = super.setBookmarkId(bookmarkId);
return item;
}
示例15: bookmarkNodeMoved
import org.chromium.chrome.browser.bookmarks.BookmarkBridge.BookmarkItem; //导入依赖的package包/类
@Override
public void bookmarkNodeMoved(BookmarkItem oldParent, int oldIndex, BookmarkItem newParent,
int newIndex) {
mSelectionDelegate.clearSelection();
}