id stringlengths 36 36 | text stringlengths 1 1.25M |
|---|---|
12c4d0c0-8f16-45bc-aa93-8380ada2926e | public String getNotificationRingtoneName() {
return mCursor.getString(mColumnNotifRingtoneName);
} |
fb11b666-2e9b-4231-b91f-1e3b1538b5c7 | public Uri getThumbnailUri() {
return parseUriNullSafe(mCursor.getString(mColumnThumbnailUri));
} |
9ab85fef-c3e1-44c6-911f-b5a1abe0ca23 | public Uri getPreviewUri(int orientation) {
Uri uri = parseUriNullSafe(mCursor.getString(mColumnPreviewUri));
if (null != uri) {
uri = uri.buildUpon().appendQueryParameter(Themes.KEY_ORIENTATION,
String.valueOf(orientation)).build();
}
return uri;
} |
e04592a8-0017-44dd-9438-f0dd0b47fe9d | public String getSoundPackName() {
return null;
} |
3cca295f-b124-45af-ad63-36db393a81e5 | public boolean isRemovable() {
return mCursor.getInt(mColumnIsSystem) == 0;
} |
fb0a8d3a-9686-4fe6-8ef3-7d6df23d1ae3 | public boolean isApplied() {
return mCursor.getInt(mColumnIsApplied) != 0;
} |
1d878a0f-6520-4d47-9f97-623854e9a092 | public boolean hasHostDensity() {
return mCursor.getInt(mColumnHasHostDensity) != 0;
} |
38c4f0ca-bd49-4bd0-ba3e-f889dd5ad1ae | public boolean hasThemePackageScope() {
return mCursor.getInt(mColumnHasThemePackageScope) != 0;
} |
490acfd6-b18f-44d3-b4fe-76772fb0a01b | public boolean equals(CustomTheme theme) {
if (theme == null) {
return false;
}
if (getPackageName().equals(theme.getThemePackageName()) == false) {
return false;
}
return theme.getThemeId().equals(getThemeId());
} |
c2166051-891e-4ab9-96a7-e3ad2db84610 | public String toString() {
StringBuilder b = new StringBuilder();
b.append('{');
b.append("pkg=").append(getPackageName()).append("; ");
b.append("themeId=").append(getThemeId()).append("; ");
b.append("name=").append(getName()).append("; ");
b.append("drm=").append(isDR... |
11e35365-49a4-48e5-8219-35972bddca0f | private Themes() {} |
d37fa2c3-16d5-419c-8028-d91b1216de97 | public static Uri getThemeUri(Context context, String packageName, String themeId) {
if (TextUtils.isEmpty(packageName) && TextUtils.isEmpty(themeId)) {
return ThemeColumns.CONTENT_URI.buildUpon()
.appendEncodedPath("system").build();
} else {
return ThemeColu... |
fc1d7aa6-a063-4961-8c91-6ccffbb607fe | public static Cursor listThemes(Context context) {
return listThemes(context, null);
} |
0f121323-43f3-4e60-b6a4-1384ce6592f5 | public static Cursor listThemes(Context context, String[] projection) {
return context.getContentResolver().query(ThemeColumns.CONTENT_PLURAL_URI,
projection, null, null, null);
} |
1f8f5266-a8e8-4284-9fa3-7ac4ab23a594 | public static Cursor listThemesByPackage(Context context, String packageName) {
return context.getContentResolver().query(ThemeColumns.CONTENT_PLURAL_URI,
null, ThemeColumns.THEME_PACKAGE + " = ?",
new String[] { packageName }, null);
} |
85043fa7-5b75-4ec1-9558-6799dadabf3a | public static Cursor getAppliedTheme(Context context) {
return context.getContentResolver().query(ThemeColumns.CONTENT_PLURAL_URI,
null, ThemeColumns.IS_APPLIED + "=1", null, null);
} |
eace24f1-90f1-47f8-9c6e-0817defbf252 | public static void deleteTheme(Context context, String packageName,
String themeId) {
context.getContentResolver().delete(
ThemeColumns.CONTENT_PLURAL_URI, ThemeColumns.THEME_PACKAGE + " = ? AND " +
ThemeColumns.THEME_ID + " = ?",
new String[] { pa... |
16f95112-e48c-4b84-ac0b-71ba62d01a91 | public static void deleteThemesByPackage(Context context, String packageName) {
context.getContentResolver().delete(
ThemeColumns.CONTENT_PLURAL_URI, ThemeColumns.THEME_PACKAGE + " = ?",
new String[] { packageName });
} |
040ea0c7-b0d1-41e6-8f3d-ab30b277c9d6 | public static void markAppliedTheme(Context context, String packageName, String themeId) {
ContentValues values = new ContentValues();
values.put(ThemeColumns.IS_APPLIED, 0);
context.getContentResolver().update(ThemeColumns.CONTENT_PLURAL_URI, values, null, null);
values.put(ThemeColumns... |
a214bf6e-c86b-422f-92b5-7082f04c7b12 | public static void changeTheme(Context context, Uri themeUri) {
changeTheme(context, new Intent(ThemeManager.ACTION_CHANGE_THEME, themeUri));
} |
cc55fd54-7ab7-430c-88f3-a6cf422438d2 | public static void changeStyle(Context context, Uri styleUri) {
changeTheme(context, new Intent(ThemeManager.ACTION_CHANGE_THEME).setDataAndType(styleUri,
ThemeColumns.STYLE_CONTENT_ITEM_TYPE));
} |
eaef9514-7254-481a-abe1-1fe91a86048b | public static void changeTheme(Context context, Intent intent) {
context.sendOrderedBroadcast(intent, Manifest.permission.CHANGE_CONFIGURATION);
} |
a69cfae1-2e62-4c5f-8ae9-90be09ddb94c | public AbstractDAOItem(Cursor c) {
if (c == null) {
throw new IllegalArgumentException("Cursor cannot be null");
}
mCursor = c;
} |
a2cf7d96-f634-41ce-b232-9b27e2a2f6d1 | public Cursor getCursor() {
return mCursor;
} |
37dcfabc-b83e-4a91-a8c5-3ab1e4f651a9 | public void close() {
mCursor.close();
} |
8e3d2ef6-81f2-460c-ba47-4783ad85007e | public void setPosition(int position) {
mCursor.moveToPosition(position);
} |
48f0283b-dfa6-4e17-99f8-0c80b65418a1 | public int getPosition() {
return mCursor.getPosition();
} |
47a5e41b-dc14-4cd4-9d44-26c8258a7b64 | public int getCount() {
return mCursor.getCount();
} |
fe27b523-f42d-4604-8783-6310905f5cf2 | protected static Uri parseUriNullSafe(String uriString) {
return (uriString != null ? Uri.parse(uriString) : null);
} |
7ba2ea51-364b-4f29-86c3-4362282eab42 | public abstract Uri getUri(Context context); |
a36c1d96-9634-4d4c-adf2-368edb72ac92 | public T newInstance(Context context, Uri uri) {
if (uri != null) {
Cursor c = context.getContentResolver().query(uri, null, null, null, null);
return newInstance(c);
}
return null;
} |
cc13f3e6-d70b-4bc8-8bbb-a16d4b4baeea | public T newInstance(Cursor c) {
if (c != null) {
if (c.moveToFirst() == true) {
return init(c);
} else {
c.close();
}
}
return null;
} |
09ef7a88-207d-4cbe-8eaa-d3042088ff95 | public abstract T init(Cursor c); |
b46b98e3-02cd-42ae-a2cb-8c5d1b56041e | public RestClient(String baseUri, String username, String password,String contentType,String clientId, String grant_type, String scope) throws Exception {
this.baseUri = baseUri;
SslContextFactory sslContextFactory = new SslContextFactory();
httpClient = new HttpClient(sslContextFactory);
... |
e7ada66b-a8e3-48d1-bc9d-82ff9f502cda | public RestClient(String baseUri, OAuthAuthenticationBuilder builder) throws Exception {
this.baseUri = baseUri;
SslContextFactory sslContextFactory = new SslContextFactory();
httpClient = new HttpClient(sslContextFactory);
httpClient.start();
oAuth = new OAuthAuthentication(http... |
71f6a7ab-01f9-4b61-aaf5-139550efdf62 | public ContentResponse send() throws InterruptedException, ExecutionException, TimeoutException, IOException {
String urlRequest = baseUri + resource;
Request httpRequest = httpClient
.newRequest(urlRequest)
.param("access_token", token);
for (String key : headers... |
c3eadc3a-6ced-493d-a76c-5df1a95a8ed1 | public RestClient setResource(String resource){
this.resource = resource;
return this;
} |
ccb865f4-68a5-46fa-9cfd-eb34ebafae94 | public RestClient method(HttpMethod method){
this.method = method;
return this;
} |
cae16071-5c70-426f-bd1b-4a2dcf3b1883 | public RestClient header(String key,String value){
this.headers.put(key,value);
return this;
} |
cb209221-0a32-4ef6-bc49-b406ff3919b4 | public RestClient param(String key,String value){
this.params.put(key,value);
return this;
} |
0f178f3b-e1fa-44c9-93fd-bca20920340b | public RestClient payload(String payload){
this.payload = new BytesContentProvider(payload.getBytes());
return this;
} |
d4a9992e-3f5f-4d65-a4c4-2c09a21129dd | public RestClient baseUri(String baseUri){
this.baseUri = baseUri;
return this;
} |
7c8b29f9-641b-4a74-951d-28037f97e91f | public synchronized void oAuthUsername(String username){
oAuth.username(username);
} |
55a307dc-c4e1-4140-b6e4-92dc8971efdf | public synchronized void oAuthPassword(String password){
oAuth.password(password);
} |
eab32410-bac2-47e3-8559-91a9d477af93 | public RestClient get(String resource){
this.method = HttpMethod.GET;
this.resource = resource;
return this;
} |
decbdc26-7e3b-46bf-b7d1-4a342c17cb46 | public RestClient post(String resource){
this.method = HttpMethod.POST;
this.resource = resource;
return this;
} |
715ed623-e559-4398-9511-4e42b17b160d | public RestClient put(String resource){
this.method = HttpMethod.PUT;
this.resource = resource;
return this;
} |
3d127376-f9f3-4fae-8862-42a5da678d26 | public RestClient delete(String resource){
this.method = HttpMethod.DELETE;
this.resource = resource;
return this;
} |
f4b01129-9c5c-40e5-bea3-8c09da3aae17 | public OAuthAuthentication(HttpClient httpClient)
{
this.httpClient = httpClient;
username = "incorrect username";
password = "incorrect password";
grant_type = "password";
baseUri = "http://registry-qa.mulesoft.com/api";
contentType = "application/x-www-form-urlencod... |
6bba0e95-5943-4ca1-b64d-d69fe0fc7802 | public synchronized OAuthAuthentication username(String username){
this.username = username;
return this;
} |
67987900-ec6b-461c-afb9-afcc97d85137 | public synchronized OAuthAuthentication password(String password){
this.password = password;
return this;
} |
0137c455-f365-48f8-aa50-82e7751df082 | public synchronized OAuthAuthentication baseUri(String baseUri){
this.baseUri = baseUri;
return this;
} |
c211c92c-0618-4f56-94d0-a5010fcf0ee1 | public synchronized OAuthAuthentication contentType(String contentType){
this.contentType = contentType;
return this;
} |
4739a15e-98b4-488c-9b5b-4faeb8b47767 | public synchronized OAuthAuthentication clientId(String clientId){
this.clientId = clientId;
return this;
} |
02cd6916-8c18-49bd-87b2-b875aecd8611 | public synchronized OAuthAuthentication scope(String scope){
this.scope = scope;
return this;
} |
c8dd4783-0ae0-41d3-82cd-a8dffbe2f848 | public synchronized OAuthAuthentication grantType(String grant_type){
this.grant_type = grant_type;
return this;
} |
c6e140f3-019a-466a-af38-c1c01398621d | public synchronized ContentResponse authenticate() throws InterruptedException, ExecutionException, TimeoutException {
Request request = httpClient
.newRequest(baseUri + "/access-token")
.header("Content-Type", contentType)
.header("grant_type", grant_type)
... |
b283b4cd-8728-4737-9565-4dfeada3584c | public synchronized String getNewToken() throws InterruptedException, ExecutionException, TimeoutException, IOException {
ContentResponse response = authenticate();
String json = response.getContentAsString();
String token = findValueInJson(json,"access_token");
System.out.println("OAuth... |
e434844c-a2bd-4062-9371-3414ecf38c81 | private String findValueInJson(String json,String value) throws IOException {
ObjectMapper mapper = new ObjectMapper();
JsonFactory factory = mapper.getFactory();
JsonParser parser = factory.createParser(json);
JsonNode node = mapper.readTree(parser);
return node.findValues(value... |
77eb7e60-26da-4b9b-9d07-ccc5126432a4 | public RequestBuilder setResource(String resource){
this.resource = resource;
return this;
} |
2ae627ee-9a72-4b39-8b64-09a02f7fd096 | public String getResource(){
return resource;
} |
2581fb1b-408c-40f0-b807-26d11595573f | public RequestBuilder setMethod(HttpMethod method){
this.method = method;
return this;
} |
445f73c7-4136-4fe9-af37-946ec94840f9 | public HttpMethod getMethod(){
return method;
} |
9934841d-0746-42ca-ba14-7854a3b0b951 | public RequestBuilder addHeader(String key,String value){
this.headers.put(key,value);
return this;
} |
04fcc73a-09ff-48cc-be5e-a58b7a795291 | public String getHeader(String key){
return this.headers.get(key);
} |
bc45e6b6-2d88-45e2-b530-29edf04d7318 | public Set<String> getHeadersSet(){
return this.headers.keySet();
} |
8640c3c1-7e12-4e01-a6f2-0c9229a9e913 | public RequestBuilder addParam(String key,String value){
this.params.put(key,value);
return this;
} |
bfb422ce-7e4c-49e1-99a9-3f65d4bae862 | public String getParam(String key){
return this.params.get(key);
} |
95d05381-937f-45b8-8d23-ce3df82d986d | public Set<String> getParamsSet(){
return this.params.keySet();
} |
b4f132d8-4b7a-4234-be97-a27b2e9da479 | public RequestBuilder setPayload(String payload){
this.payload = new BytesContentProvider(payload.getBytes());
return this;
} |
b30c5309-402e-4f40-b831-c1c68dbb1a97 | public BytesContentProvider getPayload(){
return payload;
} |
132e6fa4-c3de-4777-a8cb-270a4cadbe00 | public RequestBuilder setBaseUri(String baseUri){
this.baseUri = baseUri;
return this;
} |
e3e1c388-1a51-4f56-9a5d-05cf1c2cfe8a | public String getBaseUri(){
return baseUri;
} |
945bcf5c-70d9-451d-bd94-0584da236bde | public OAuthAuthenticationBuilder()
{
username = "incorrect username";
password = "incorrect password";
grantType = "password";
baseUri = "http://registry-qa.mulesoft.com/api";
contentType = "application/x-www-form-urlencoded";
clientId = "WEBUI";
scope = "ADM... |
20ce9b20-7e2b-44ab-8c31-de273c7ad616 | public synchronized OAuthAuthenticationBuilder username(String username){
this.username = username;
return this;
} |
fcfd3f0e-4375-4c87-b82a-f759e4a34b7a | public String username(){
return username;
} |
58fd4e55-66bf-457c-b1a6-7bd7bcf47cda | public synchronized OAuthAuthenticationBuilder password(String password){
this.password = password;
return this;
} |
4ebfacc3-83a1-4fda-b6b3-4aeaddc0524a | public String password(){
return password;
} |
ed4a9429-d866-4f36-9364-c3a0edf2eddc | public synchronized OAuthAuthenticationBuilder baseUri(String baseUri){
this.baseUri = baseUri;
return this;
} |
d8054762-ac18-4ba1-bc35-e4c36cde8c68 | public String baseUri(){
return baseUri;
} |
3aa4d69a-8fde-448f-8204-c0de613e0881 | public synchronized OAuthAuthenticationBuilder contentType(String contentType){
this.contentType = contentType;
return this;
} |
1a39c0dc-40f2-48eb-9de7-d53c162fc845 | public String contentType(){
return contentType;
} |
7921b944-3ef8-4091-b309-cf064754d1df | public synchronized OAuthAuthenticationBuilder clientId(String clientId){
this.clientId = clientId;
return this;
} |
0549347f-3c51-4ff6-a3ae-b04dc37a1390 | public String clientId(){
return clientId;
} |
8c89eacb-93df-420d-adcb-6b12e0a20f42 | public synchronized OAuthAuthenticationBuilder scope(String scope){
this.scope = scope;
return this;
} |
928698cd-fc69-41f6-8054-86c95cb2d0df | public String scope(){
return scope;
} |
c86be47c-bbab-45da-af68-35ee8a4388c5 | public synchronized OAuthAuthenticationBuilder grantType(String grantType){
this.grantType = grantType;
return this;
} |
ea866ba5-2834-4082-ac1a-5dc26da2edec | public String grantType(){
return grantType;
} |
92279bcd-9c06-4482-8eb5-909841bf94a8 | public static void main(String[] args) throws Exception {
} |
209bcc21-f7a3-4355-9996-413fe83d699a | public static void main(String[] args)
{
try
{
/**
* download kunststoff.jar at:
* http://www.incors.org/index.php3
*/
//UIManager.setLookAndFeel(new KunststoffLookAndFeel());
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
catch(Exception e)
{
e.printStackTr... |
2fd37b33-a433-45eb-a1ac-498add05323b | Main()
{
mainFrame=new MainFrame();
if (packFrame)
{
mainFrame.pack();
}
else
{
mainFrame.validate();
}
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
mainFrame.setSize(new Dimension(screenSize.width-100,screenSize.height-100));
Dimension frameSize = mainFrame.getS... |
be8b439b-aa39-42b8-8a73-b5b10bbfdb13 | public WholeNumberTextField(int value, int columns)
{
super(columns);
toolkit = Toolkit.getDefaultToolkit();
integerFormatter = NumberFormat.getNumberInstance(Locale.US);
integerFormatter.setParseIntegerOnly(true);
setValue(value);
} |
80507a48-7419-4d13-a993-e01367dbf2c8 | public WholeNumberTextField(int columns)
{
super(columns);
toolkit = Toolkit.getDefaultToolkit();
integerFormatter = NumberFormat.getNumberInstance(Locale.US);
integerFormatter.setParseIntegerOnly(true);
} |
95cf7c7d-135c-4556-9278-9ed25306cfec | public int getValue()
{
int retVal = 0;
try
{
retVal = integerFormatter.parse(getText()).intValue();
}
catch (ParseException e)
{
// This should never happen because insertString allows
// only properly formatted data to get in the field.
toolkit.beep();
}
ret... |
fc8f983d-2862-482f-8e07-c0d1d360236e | public void setValue(int value)
{
setText(integerFormatter.format(value));
} |
9766c70c-c5e6-4e9c-b411-7dd2dbd72972 | protected Document createDefaultModel()
{
return new WholeNumberDocument();
} |
e19796af-4944-4995-97ef-4f120669b89b | public void insertString(int offs, String str,AttributeSet a)
throws BadLocationException
{
char[] source = str.toCharArray();
char[] result = new char[source.length];
int j = 0;
for (int i = 0; i < result.length; i++)
{
if (Character.isDigit(source... |
04ae2687-2edd-4a94-8445-d3ca0d19affe | public static String getExtension(File file)
{
String ext = null;
String s = file.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1)
{
ext = s.substring(i+1).toLowerCase();
}
return ext;
} |
9ad760ff-936a-4fe8-9145-e5f775175ac6 | public static boolean approveSelection(File file)
{
String ext = null;
String s = file.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1)
{
ext = s.substring(i+1).toLowerCase();
}
if (ext.equals(sqcif.toLowerCase()))
{
return true;
}
else if (ext.equals(qcif.toLo... |
a67084e7-88fa-4b9b-96d5-139d48a325e2 | public static Dimension getDimension(File file)
{
String ext = null;
String s = file.getName();
int i = s.lastIndexOf('.');
if (i > 0 && i < s.length() - 1)
{
ext = s.substring(i+1).toLowerCase();
}
if (ext.equals(sqcif.toLowerCase()))
{
return SQCIF;
}
else if (ext.equals(qcif.toLow... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.