本文整理匯總了Java中com.csipsimple.models.Filter.getMatcherForPosition方法的典型用法代碼示例。如果您正苦於以下問題:Java Filter.getMatcherForPosition方法的具體用法?Java Filter.getMatcherForPosition怎麽用?Java Filter.getMatcherForPosition使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.csipsimple.models.Filter
的用法示例。
在下文中一共展示了Filter.getMatcherForPosition方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: saveFilter
import com.csipsimple.models.Filter; //導入方法依賴的package包/類
private void saveFilter() {
//Update filter object
filter.account = (int) accountId;
filter.action = Filter.getActionForPosition(actionSpinner.getSelectedItemPosition());
RegExpRepresentation repr = new RegExpRepresentation();
//Matcher
repr.type = Filter.getMatcherForPosition(matcherSpinner.getSelectedItemPosition());
repr.fieldContent = matchesTextEditor.getText().toString();
filter.setMatcherRepresentation(repr);
//Rewriter
if(filter.action == Filter.ACTION_REPLACE) {
repr.fieldContent = replaceTextEditor.getText().toString();
repr.type = Filter.getReplaceForPosition(replaceSpinner.getSelectedItemPosition());
filter.setReplaceRepresentation(repr);
}else if(filter.action == Filter.ACTION_AUTO_ANSWER){
filter.replacePattern = replaceTextEditor.getText().toString();
}else{
filter.replacePattern = "";
}
//Save
if(filterId < 0) {
Cursor currentCursor = getContentResolver().query(SipManager.FILTER_URI, new String[] {Filter._ID},
Filter.FIELD_ACCOUNT + "=?",
new String[] {
filter.account.toString()
}, null);
filter.priority = 0;
if(currentCursor != null) {
filter.priority = currentCursor.getCount();
currentCursor.close();
}
getContentResolver().insert(SipManager.FILTER_URI, filter.getDbContentValues());
}else {
getContentResolver().update(ContentUris.withAppendedId(SipManager.FILTER_ID_URI_BASE, filterId), filter.getDbContentValues(), null, null);
}
}
示例2: matcherNeedsText
import com.csipsimple.models.Filter; //導入方法依賴的package包/類
private boolean matcherNeedsText() {
int fmatcher = Filter.getMatcherForPosition(matcherSpinner.getSelectedItemPosition() );
return fmatcher != Filter.MATCHER_ALL &&
fmatcher != Filter.MATCHER_BLUETOOTH &&
fmatcher != Filter.MATCHER_CALLINFO_AUTOREPLY;
}