Java Code Examples for org.openide.NotifyDescriptor#getOptions()

The following examples show how to use org.openide.NotifyDescriptor#getOptions() . 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: IntroduceHintTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    IntroduceFieldPanel panel = (IntroduceFieldPanel) descriptor
            .getMessage();

    if (name != null) {
        panel
                .setFieldName(name);
    }

    if (replaceAll != null) {
        panel
                .setReplaceAll(replaceAll);
    }

    if (declareFinal != null) {
        panel
                .setDeclareFinal(declareFinal);
    }

    if (modifiers != null) {
        panel
                .setAccess(modifiers);
    }

    return ok ? descriptor
            .getOptions()[0] : descriptor
            .getOptions()[1];
}
 
Example 2
Source File: IntroduceHintTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    IntroduceFieldPanel panel = (IntroduceFieldPanel) descriptor
            .getMessage();

    if (fieldName != null) {
        panel
                .setFieldName(fieldName);
    }

    if (initializeIn != null) {
        panel
                .setInitializeIn(initializeIn);
    }

    if (replaceAll != null) {
        panel
                .setReplaceAll(replaceAll);
    }

    if (access != null) {
        panel
                .setAccess(access);
    }

    if (declareFinal != null) {
        panel
                .setDeclareFinal(declareFinal);
    }

    return ok ? descriptor
            .getOptions()[0] : descriptor
            .getOptions()[1];
}
 
Example 3
Source File: IntroduceHintTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    if (descriptor
            .getMessage() instanceof String) {
        //check that this is the "do replace" dialog
        return NotifyDescriptor.YES_OPTION;
    }

    IntroduceMethodPanel panel = (IntroduceMethodPanel) descriptor
            .getMessage();

    if (methodName != null) {
        panel
                .setMethodName(methodName);
    }

    if (access != null) {
        panel
                .setAccess(access);
    }

    panel
            .setReplaceOther(replaceDuplicates);

    return ok ? descriptor
            .getOptions()[0] : descriptor
            .getOptions()[1];
}
 
Example 4
Source File: CloneableEditorUserQuestionAsyncTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    assertNull (options);
    assertNotNull (toReturn);
    options = descriptor.getOptions();
    Object r = toReturn;
    toReturn = null;
    return r;
}
 
Example 5
Source File: CloneableEditorUserQuestionAsync2Test.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    assertNull (options);
    assertNotNull (toReturn);
    options = descriptor.getOptions();
    Object r = toReturn;
    toReturn = null;
    return r;
}
 
Example 6
Source File: CloneableEditorUserQuestionTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    assertNull (options);
    assertNotNull (toReturn);
    options = descriptor.getOptions();
    Object r = toReturn;
    toReturn = null;
    return r;
}
 
Example 7
Source File: DefaultDataObjectHasOpenTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    if (disableTest) {
        return toReturn;
    } else {
        assertNull(options);
        assertNotNull(toReturn);
        options = descriptor.getOptions();
        Object r = toReturn;
        toReturn = null;
        return r;
    }
}
 
Example 8
Source File: XMLDataObjectMimeTypeTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    if (disableTest) {
        return toReturn;
    } else {
        assertNull(options);
        assertNotNull(toReturn);
        options = descriptor.getOptions();
        Object r = toReturn;
        toReturn = null;
        return r;
    }
}
 
Example 9
Source File: DefaultDataObjectLookupTest.java    From netbeans with Apache License 2.0 5 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    if (disableTest) {
        return toReturn;
    } else {
        assertNull(options);
        assertNotNull(toReturn);
        options = descriptor.getOptions();
        Object r = toReturn;
        toReturn = null;
        return r;
    }
}
 
Example 10
Source File: MultiViewEditorDiscardTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Object notify(NotifyDescriptor descriptor) {
    return descriptor.getOptions()[1];
}
 
Example 11
Source File: ActivatedDeativatedTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    // last options allows to close usually
    return descriptor.getOptions()[descriptor.getOptions().length - 1];
}
 
Example 12
Source File: ShutdownFromAWTTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    assertAWT();
    
    // last options allows to close usually
    return descriptor.getOptions()[descriptor.getOptions().length - 1];
}
 
Example 13
Source File: DefaultDataObjectTest.java    From netbeans with Apache License 2.0 4 votes vote down vote up
@Override
public Object notify(NotifyDescriptor descriptor) {
    return descriptor.getOptions()[0];
}
 
Example 14
Source File: FeedbackSurveyTest.java    From netbeans with Apache License 2.0 3 votes vote down vote up
public Object notify(NotifyDescriptor descriptor) {
    assertNull("No dialog yet", nd);
    nd = descriptor;
    
    
    Object r = descriptor.getOptions()[toReturn];
    toReturn = -1;
    
    return r;
}