Java Code Examples for org.eclipse.swt.widgets.Tree.isFocusControl()

The following are Jave code examples for showing how to use isFocusControl() of the org.eclipse.swt.widgets.Tree class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: eclipse-batch-editor   File: AbstractFilterableTreeQuickDialog.java   Source Code and License Vote up 5 votes
@Override
public void keyPressed(KeyEvent event) {
	if (event.keyCode == SWT.ARROW_DOWN) {
		Tree tree = treeViewer.getTree();
		if (tree.isDisposed()) {
			return;
		}
		if (tree.isFocusControl()) {
			return;
		}
		tree.setFocus();
		return;
	}
	if (event.character == '\r') {
		ISelection selection = treeViewer.getSelection();
		openSelectionAndCloseDialog(selection);
		return;
	}
	boolean allowedChar = false;
	allowedChar = allowedChar || event.character == '*';
	allowedChar = allowedChar || event.character == '(';
	allowedChar = allowedChar || event.character == ')';
	allowedChar = allowedChar || Character.isJavaIdentifierPart(event.character);
	allowedChar = allowedChar || Character.isWhitespace(event.character);
	if (!allowedChar) {
		event.doit = false;
		return;
	}
	if (treeViewer == null) {
		return;
	}

}
 
Example 2
Project: eclipse-bash-editor   File: AbstractFilterableTreeQuickDialog.java   Source Code and License Vote up 5 votes
@Override
public void keyPressed(KeyEvent event) {
	if (event.keyCode == SWT.ARROW_DOWN) {
		Tree tree = treeViewer.getTree();
		if (tree.isDisposed()) {
			return;
		}
		if (tree.isFocusControl()) {
			return;
		}
		tree.setFocus();
		return;
	}
	if (event.character == '\r') {
		ISelection selection = treeViewer.getSelection();
		openSelectionAndCloseDialog(selection);
		return;
	}
	boolean allowedChar = false;
	allowedChar = allowedChar || event.character == '*';
	allowedChar = allowedChar || event.character == '(';
	allowedChar = allowedChar || event.character == ')';
	allowedChar = allowedChar || Character.isJavaIdentifierPart(event.character);
	allowedChar = allowedChar || Character.isWhitespace(event.character);
	if (!allowedChar) {
		event.doit = false;
		return;
	}
	if (treeViewer == null) {
		return;
	}

}
 
Example 3
Project: egradle   File: AbstractFilterableTreeQuickDialog.java   Source Code and License Vote up 5 votes
@Override
public void keyPressed(KeyEvent event) {
	if (event.keyCode == SWT.ARROW_DOWN) {
		Tree tree = treeViewer.getTree();
		if (tree.isDisposed()) {
			return;
		}
		if (tree.isFocusControl()) {
			return;
		}
		tree.setFocus();
		return;
	}
	if (event.character == '\r') {
		ISelection selection = treeViewer.getSelection();
		openSelectionAndCloseDialog(selection);
		return;
	}
	boolean allowedChar = false;
	allowedChar = allowedChar || event.character == '*';
	allowedChar = allowedChar || event.character == '(';
	allowedChar = allowedChar || event.character == ')';
	allowedChar = allowedChar || Character.isJavaIdentifierPart(event.character);
	allowedChar = allowedChar || Character.isWhitespace(event.character);
	if (!allowedChar) {
		event.doit = false;
		return;
	}
	if (treeViewer == null) {
		return;
	}

}