Example usage for java.lang System.Shutdown System.Shutdown

List of usage examples for java.lang System.Shutdown System.Shutdown

Introduction

In this page you can find the example usage for java.lang System.Shutdown System.Shutdown.

Prototype

System.Shutdown

Source Link

Usage

From source file:com.syncedsynapse.kore2.ui.RemoteActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here.
    switch (item.getItemId()) {
    case R.id.action_wake_up:
        UIUtils.sendWolAsync(this, hostManager.getHostInfo());
        return true;
    case R.id.action_quit:
        Application.Quit actionQuit = new Application.Quit();
        // Fire and forget
        actionQuit.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.action_suspend:
        System.Suspend actionSuspend = new System.Suspend();
        // Fire and forget
        actionSuspend.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.action_shutdown:
        System.Shutdown actionShutdown = new System.Shutdown();
        // Fire and forget
        actionShutdown.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.send_text:
        SendTextDialogFragment dialog = SendTextDialogFragment.newInstance(getString(R.string.send_text));
        dialog.show(getSupportFragmentManager(), null);
        return true;
    case R.id.toggle_fullscreen:
        //                GUI.SetFullscreen actionSetFullscreen = new GUI.SetFullscreen();
        Input.ExecuteAction actionSetFullscreen = new Input.ExecuteAction(Input.ExecuteAction.TOGGLEFULLSCREEN);
        actionSetFullscreen.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.clean_video_library:
        VideoLibrary.Clean actionCleanVideo = new VideoLibrary.Clean();
        actionCleanVideo.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.clean_audio_library:
        AudioLibrary.Clean actionCleanAudio = new AudioLibrary.Clean();
        actionCleanAudio.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.update_video_library:
        VideoLibrary.Scan actionScanVideo = new VideoLibrary.Scan();
        actionScanVideo.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.update_audio_library:
        AudioLibrary.Scan actionScanAudio = new AudioLibrary.Scan();
        actionScanAudio.execute(hostManager.getConnection(), null, null);
        return true;
    default:/*from  w w  w.ja  v  a2 s  .  c om*/
        break;
    }

    return super.onOptionsItemSelected(item);
}

From source file:org.xbmc.kore.ui.RemoteActivity.java

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    // Handle action bar item clicks here.
    switch (item.getItemId()) {
    case R.id.action_wake_up:
        UIUtils.sendWolAsync(this, hostManager.getHostInfo());
        return true;
    case R.id.action_quit:
        Application.Quit actionQuit = new Application.Quit();
        // Fire and forget
        actionQuit.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.action_suspend:
        System.Suspend actionSuspend = new System.Suspend();
        // Fire and forget
        actionSuspend.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.action_reboot:
        System.Reboot actionReboot = new System.Reboot();
        // Fire and forget
        actionReboot.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.action_shutdown:
        System.Shutdown actionShutdown = new System.Shutdown();
        // Fire and forget
        actionShutdown.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.send_text:
        SendTextDialogFragment dialog = SendTextDialogFragment.newInstance(getString(R.string.send_text));
        dialog.show(getSupportFragmentManager(), null);
        return true;
    case R.id.toggle_fullscreen:
        GUI.SetFullscreen actionSetFullscreen = new GUI.SetFullscreen();
        //                Input.ExecuteAction actionSetFullscreen = new Input.ExecuteAction(Input.ExecuteAction.TOGGLEFULLSCREEN);
        actionSetFullscreen.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.clean_video_library:
        VideoLibrary.Clean actionCleanVideo = new VideoLibrary.Clean();
        actionCleanVideo.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.clean_audio_library:
        AudioLibrary.Clean actionCleanAudio = new AudioLibrary.Clean();
        actionCleanAudio.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.update_video_library:
        VideoLibrary.Scan actionScanVideo = new VideoLibrary.Scan();
        actionScanVideo.execute(hostManager.getConnection(), null, null);
        return true;
    case R.id.update_audio_library:
        AudioLibrary.Scan actionScanAudio = new AudioLibrary.Scan();
        actionScanAudio.execute(hostManager.getConnection(), null, null);
        return true;
    default:/*from   w w w . j  a  v  a 2  s  .co  m*/
        break;
    }

    return super.onOptionsItemSelected(item);
}