Java 类java.awt.Taskbar.Feature 实例源码

项目:openjdk-jdk10    文件:XTaskbarPeer.java   
@Override
public boolean isSupported(Feature feature) {
    switch (feature) {
        case ICON_BADGE_NUMBER:
        case MENU:
        case PROGRESS_VALUE:
        case USER_ATTENTION:
            return true;
        default:
            return false;
    }
}
项目:openjdk-jdk10    文件:XTaskbarPeer.java   
@Override
public void setIconBadge(String badge) {
    boolean visible = false;
    long val = 0;
    if (badge != null) {
        try {
            val = Long.parseLong(badge);
            visible = true;
        } catch (NumberFormatException e) {
            throw new UnsupportedOperationException("The " + Feature.ICON_BADGE_TEXT
                + " feature is not supported on the current platform!");
        }
    }
    setBadge(val, visible);
}
项目:openjdk-jdk10    文件:CTaskbarPeer.java   
@Override
public boolean isSupported(Feature feature) {
    switch(feature) {
        case ICON_BADGE_TEXT:
        case ICON_BADGE_NUMBER:
        case ICON_IMAGE:
        case MENU:
        case PROGRESS_VALUE:
        case USER_ATTENTION:
            return true;
        default:
            return false;
    }
}
项目:openjdk-jdk10    文件:WTaskbarPeer.java   
@Override
public boolean isSupported(Feature feature) {
    switch(feature) {
        case ICON_BADGE_IMAGE_WINDOW:
        case PROGRESS_STATE_WINDOW:
        case PROGRESS_VALUE_WINDOW:
            return supported;
        case USER_ATTENTION_WINDOW:
            return true;
        default:
            return false;
    }
}
项目:openjdk9    文件:XTaskbarPeer.java   
@Override
public boolean isSupported(Feature feature) {
    switch (feature) {
        case ICON_BADGE_NUMBER:
        case MENU:
        case PROGRESS_VALUE:
        case USER_ATTENTION:
            return true;
        default:
            return false;
    }
}
项目:openjdk9    文件:CTaskbarPeer.java   
@Override
public boolean isSupported(Feature feature) {
    switch(feature) {
        case ICON_BADGE_TEXT:
        case ICON_BADGE_NUMBER:
        case ICON_IMAGE:
        case MENU:
        case PROGRESS_VALUE:
        case USER_ATTENTION:
            return true;
        default:
            return false;
    }
}
项目:openjdk9    文件:WTaskbarPeer.java   
@Override
public boolean isSupported(Feature feature) {
    switch(feature) {
        case ICON_BADGE_IMAGE_WINDOW:
        case PROGRESS_STATE_WINDOW:
        case PROGRESS_VALUE_WINDOW:
            return supported;
        case USER_ATTENTION_WINDOW:
            return true;
        default:
            return false;
    }
}
项目:demo-java-9    文件:DesktopFeatures.java   
public static void main(String[] args) {
    if (Taskbar.isTaskbarSupported()) {
        System.out.println("Taskbar is supported - feature support breakdown:");
        Taskbar taskbar = Taskbar.getTaskbar();
        stream(Feature.values())
                .forEach(feature -> System.out.printf(" - %s: %s%n", feature, taskbar.isSupported(feature)));
    } else {
        System.out.println("Taskbar is not on your platform. :(");
    }
}
项目:openjdk-jdk10    文件:TaskbarPeer.java   
/**
 * Tests support of {@code Feature} on current platform.
 * @param f feature to test
 * @return true if feature supported supported
 */
default public boolean isSupported(Feature f) { return false; }
项目:openjdk9    文件:TaskbarPeer.java   
/**
 * Tests support of {@code Feature} on current platform.
 * @param f feature to test
 * @return true if feature supported supported
 */
default public boolean isSupported(Feature f) { return false; }