Showing posts with label filtereditemsselectiondialog. Show all posts
Showing posts with label filtereditemsselectiondialog. Show all posts

Thursday, 9 August 2012

刷新内容提供商FilteredItemsSelectionDialog

我写了一个对话框,延长过滤项目的日食选择对话框。这个对话框有几个复选框int的视图菜单。我想显示的内容,在视图菜单上指明的条件而定。

当我真正开始做什么,我想,我没有一个线索如何做到这一点。

像任何其他的崇拜者编码我问,如果他能帮助我做什么我想,我完全惊讶议员谷歌说:“老兄我是不是得线索。

我怎么过,最终找出了感谢同事。现在我已经决定,我会让全世界都知道如何做到这一点,所以下一次有人问谷歌先生,他确实有一个正确的答案。

首先,你有,延长的ViewerFilter类,它MyViewerFilter及以上乘坐方法的选择(),以满足我们的需要。

第二:在行动的呼叫addListFilter(过滤器)的run()方法;过滤器是一个的比调用scheduleRefresh()typeMyViewerFilter的对象;

这样做将更新的内容提供商每点击复选框。

Thursday, 26 July 2012

Bragging

In this Post I ll brag about the the first question I answered on StackOverFlow.com. The best part is that my answer got accepted too.  Well The question was as follows:

I have been following the tutorial here. In the advanced tutorial ResourceSelectionHistory stores the selected items and the retrieves it when the dialog is relaunched. I wanted the ResourceSelectionHistory to store objects and not just strings, is there i way to do that. I also want the items to open in the editor when the user clicks on them. When I click on an item in the actual populated list it opens, but not when I click on the part showing history.

The person here wants to IMemento to tell him what type of object was stored in the History. As the person who first answered the question said that these classes are very restrictive. and they expect you to do only what they want you do do.

I have figured out a way that could be used to do what the questioner want: Follow along.....

You can store strings, integers and Boolean to IMemento. You can cleverly utilize them to reveal the type of object. For example you can use element.putInteger("objType", 1); if your object is of say type A and element.putInteger("objType", 2); if its of type B. Hope that helps.

ge33ek