import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.GridData;
private Composite parent;
private TabFolder folders;
+ private Text filterText;
private LogColors colors;
/**
combo.setItems(comboItems);
combo.select(2);
combo.setToolTipText("Keyword Search: Pid or Tag, Message");
-
- final Text filterText = new Text(bottom, SWT.SINGLE | SWT.BORDER);
+ combo.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ if(filterText.getText() != null)
+ {
+ tab.setFilterMode((int) Math.pow(2, combo.getSelectionIndex()));
+ tab.setFilterWord(filterText.getText());
+ tab.refill();
+ }
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
+
+ filterText = new Text(bottom, SWT.SINGLE | SWT.BORDER);
filterText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
filterText.setMessage(" Input Keyword ");
filterText.addModifyListener(new ModifyListener() {
}
if (filterMode != FILTER_NONE && filterWord != null) {
- if ((filterMode & FILTER_PID) != 0) {
- if (!Integer.toString(logMessage.data.pid).contains(filterWord))
- return false;
+ if ((filterMode & FILTER_PID) == FILTER_PID) {
+ if (Integer.toString(logMessage.data.pid).contains(filterWord))
+ return true;
}
- if ((filterMode & FILTER_TAG) != 0) {
- if (!logMessage.data.tag.toLowerCase().contains(filterWord.toLowerCase()))
- return false;
+ if ((filterMode & FILTER_TAG) == FILTER_TAG) {
+ if (logMessage.data.tag.toLowerCase().contains(filterWord.toLowerCase()))
+ return true;
}
- if ((filterMode & FILTER_MSG) != 0) {
- if (!logMessage.msg.toLowerCase().contains(
+ if ((filterMode & FILTER_MSG) == FILTER_MSG) {
+ if (logMessage.msg.toLowerCase().contains(
filterWord.toLowerCase()))
- return false;
+ return true;
}
+ return false;
}
return true;
}