本文整理汇总了Java中org.eclipse.jface.viewers.TreeExpansionEvent类的典型用法代码示例。如果您正苦于以下问题:Java TreeExpansionEvent类的具体用法?Java TreeExpansionEvent怎么用?Java TreeExpansionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TreeExpansionEvent类属于org.eclipse.jface.viewers包,在下文中一共展示了TreeExpansionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: dialogTreeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
private void dialogTreeExpanded(TreeExpansionEvent event) {
FJTree parent = (FJTree) event.getElement();
if (parent != null) {
Object[] children = parent.getChildren();
for (int i = 0; i < children.length; i++) {
FJTree child = (FJTree) children[i];
int checkState = child.getCheckState();
if (checkState == FJTree.CS_CHECKED) {
fileTree.setChecked(child, true);
fileTree.setGrayed(child, false);
} else if (checkState == FJTree.CS_UNCHECKED)
fileTree.setChecked(child, false);
else if (checkState == FJTree.CS_GRAYED)
fileTree.setGrayChecked(child, true);
}
}
dialogChanged();
}
示例2: dialogTreeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
private void dialogTreeExpanded(TreeExpansionEvent event) {
FJTree parent = (FJTree)event.getElement();
if (parent != null) {
Object[] children = parent.getChildren();
for (int i=0; i<children.length; i++) {
FJTree child = (FJTree)children[i];
int checkState = child.getCheckState();
if (checkState == FJTree.CS_CHECKED) {
fileTree.setChecked(child, true);
fileTree.setGrayed(child, false);
}
else if (checkState == FJTree.CS_UNCHECKED)
fileTree.setChecked(child, false);
else if (checkState == FJTree.CS_GRAYED)
fileTree.setGrayChecked(child, true);
}
}
dialogChanged();
}
示例3: listServer
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
private void listServer(final TreeExpansionEvent event) {
if (skipLazyLoad)
return;
Job job = new Job("Refreshing tree") {
@Override
protected IStatus run(IProgressMonitor monitor) {
IStatus status = Status.OK_STATUS;
try {
status = listServer(event, monitor);
} finally {
monitor.done();
}
return status;
}
};
job.setPriority(Job.SHORT);
job.setSystem(false);
job.setUser(true);
job.schedule();
}
示例4: lazyLoadResource
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
public IStatus lazyLoadResource(final TreeExpansionEvent event, IProgressMonitor monitor) {
if (skipLazyLoad)
return Status.OK_STATUS;
MResource r = (MResource) event.getElement();
try {
WSClientHelper.refreshResource(r, monitor);
Display.getDefault().asyncExec(new Runnable() {
public void run() {
event.getTreeViewer().refresh(true);
}
});
return Status.OK_STATUS;
} catch (final Throwable e) {
Display.getDefault().syncExec(new Runnable() {
public void run() {
event.getTreeViewer().collapseToLevel(event.getElement(), 1);
UIUtils.showErrorDialog(e.getMessage(), e);
}
});
}
return Status.CANCEL_STATUS;
}
示例5: setExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
protected void setExpanded(Item node, boolean expand) {
TreeItem item = (TreeItem) node;
boolean pre = item.getExpanded();
item.setExpanded(expand);
/*
* See Eclipse Bugzilla Bug 177378 and JIRA MER-176. In summary, the
* collapseAll() and expandAll() methods filter through this
* setExpanded() method. However, this path through the system does not
* notify listeners of the expansion event. Therefore, we added code to
* notify the listeners if the expansion state changes as a result of a
* programmatic call (user clicks in the tree do notify the listeners
* since those expansions take a different path).
*/
// do not fire the event if the expansion state did not change
if (pre == expand) return;
TreeExpansionEvent e = new TreeExpansionEvent(this, node.getData());
if (expand) fireTreeExpanded (e);
else fireTreeCollapsed(e);
}
示例6: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
public void treeExpanded(TreeExpansionEvent event)
{
Object item = event.getElement();
if(!fExpandedTreeNodes.contains(item))
{
fExpandedTreeNodes.add(item);
checkNewTreeElements(getTreeChildren(item));
}
}
示例7: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
public void treeExpanded(TreeExpansionEvent event) {
if (linkMonitor.isBlocked()) {
return;
}
linkMonitor.block();
try {
oppositeViewer.expandToLevel(event.getElement(), 1);
} finally {
linkMonitor.unblock();
}
}
示例8: treeCollapsed
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
public void treeCollapsed(TreeExpansionEvent event) {
if (linkMonitor.isBlocked()) {
return;
}
linkMonitor.block();
try {
oppositeViewer.collapseToLevel(event.getElement(), 1);
} finally {
linkMonitor.unblock();
}
}
示例9: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
/**
* Handles the expansionsion of an element in a tree viewer
* @param event
*/
public void treeExpanded(TreeExpansionEvent event) {
Object item= event.getElement();
// First see if the children need to be given their checked state at all. If they've
// already been realized then this won't be necessary
if (!fExpandedTreeNodes.contains(item)) {
fExpandedTreeNodes.add(item);
checkNewTreeElements(getTreeChildren(item));
}
}
示例10: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
public void treeExpanded(TreeExpansionEvent event) {
setCheckedGrayed((TreeElement) event.getElement(), true);
}
示例11: treeCollapsed
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
public void treeCollapsed(TreeExpansionEvent event) {
setCheckedGrayed((TreeElement) event.getElement(), false);
}
示例12: treeCollapsed
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
public void treeCollapsed(final TreeExpansionEvent event) {
reflow(event.getTreeViewer().getControl().getParent());
}
示例13: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
public void treeExpanded(final TreeExpansionEvent event) {
reflow(event.getTreeViewer().getControl().getParent());
}
示例14: treeCollapsed
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
public void treeCollapsed(TreeExpansionEvent event) {
LogUtils.info(log, treeName , Mode.COLLAPSE_TREE_ELEMENT, getLabel(event.getElement()));
}
示例15: treeExpanded
import org.eclipse.jface.viewers.TreeExpansionEvent; //导入依赖的package包/类
@Override
public void treeExpanded(TreeExpansionEvent event) {
LogUtils.info(log, treeName , Mode.EXPAND_TREE_ELEMENT, getLabel(event.getElement()));
}