Java Code Examples for org.eclipse.swt.widgets.Combo#getSelection()

The following examples show how to use org.eclipse.swt.widgets.Combo#getSelection() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TimeGraphFindDialog.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 *
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private static void updateHistory(Combo combo, List<String> history) {
    String findString = combo.getText();
    int index = history.indexOf(findString);
    if (index != 0) {
        if (index != -1) {
            history.remove(index);
        }
        history.add(0, findString);
        Point selection = combo.getSelection();
        updateCombo(combo, history);
        combo.setText(findString);
        combo.setSelection(selection);
    }
}
 
Example 2
Source File: FindReplaceDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private void updateHistory(Combo combo, List<String> history) {
	String findString = combo.getText();
	int index = history.indexOf(findString);
	if (index != 0) {
		if (index != -1) {
			history.remove(index);
		}
		history.add(0, findString);
		Point selection = combo.getSelection();
		updateCombo(combo, history);
		combo.setText(findString);
		combo.setSelection(selection);
	}
}
 
Example 3
Source File: TermBaseSearchDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private void updateHistory(Combo combo, List<String> history) {
	String findString = combo.getText();
	int index = history.indexOf(findString);
	if (index != 0) {
		if (index != -1) {
			history.remove(index);
		}
		history.add(0, findString);
		Point selection = combo.getSelection();
		updateCombo(combo, history);
		combo.setText(findString);
		combo.setSelection(selection);
	}
}
 
Example 4
Source File: ConcordanceSearchDialog.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private void updateHistory(Combo combo, List<String> history) {
	String findString = combo.getText();
	int index = history.indexOf(findString);
	if (index != 0) {
		if (index != -1) {
			history.remove(index);
		}
		history.add(0, findString);
		Point selection = combo.getSelection();
		updateCombo(combo, history);
		combo.setText(findString);
		combo.setSelection(selection);
	}
}
 
Example 5
Source File: FindReplaceDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private void updateHistory(Combo combo, List<String> history) {
	String findString = combo.getText();
	int index = history.indexOf(findString);
	if (index != 0) {
		if (index != -1) {
			history.remove(index);
		}
		history.add(0, findString);
		Point selection = combo.getSelection();
		updateCombo(combo, history);
		combo.setText(findString);
		combo.setSelection(selection);
	}
}
 
Example 6
Source File: TermBaseSearchDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private void updateHistory(Combo combo, List<String> history) {
	String findString = combo.getText();
	int index = history.indexOf(findString);
	if (index != 0) {
		if (index != -1) {
			history.remove(index);
		}
		history.add(0, findString);
		Point selection = combo.getSelection();
		updateCombo(combo, history);
		combo.setText(findString);
		combo.setSelection(selection);
	}
}
 
Example 7
Source File: ConcordanceSearchDialog.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Updates the combo with the history.
 * @param combo
 *            to be updated
 * @param history
 *            to be put into the combo
 */
private void updateHistory(Combo combo, List<String> history) {
	String findString = combo.getText();
	int index = history.indexOf(findString);
	if (index != 0) {
		if (index != -1) {
			history.remove(index);
		}
		history.add(0, findString);
		Point selection = combo.getSelection();
		updateCombo(combo, history);
		combo.setText(findString);
		combo.setSelection(selection);
	}
}