コード例 #1
0
 private void updateConnectToDropDownButton(
     boolean isEmulatorRunning, boolean isCompanionRunning, boolean isUsbRunning) {
   if (!isEmulatorRunning && !isCompanionRunning && !isUsbRunning) {
     connectDropDown.setItemEnabled(MESSAGES.wirelessButton(), true);
     connectDropDown.setItemEnabled(MESSAGES.emulatorButton(), true);
     connectDropDown.setItemEnabled(MESSAGES.usbButton(), true);
   } else {
     connectDropDown.setItemEnabled(MESSAGES.wirelessButton(), false);
     connectDropDown.setItemEnabled(MESSAGES.emulatorButton(), false);
     connectDropDown.setItemEnabled(MESSAGES.usbButton(), false);
   }
 }
コード例 #2
0
 /**
  * Enables and/or disables buttons based on how many projects exist (in the case of "Download All
  * Projects") or are selected (in the case of "Delete" and "Download Source").
  */
 public void updateFileMenuButtons(int view) {
   if (view == 0) { // We are in the Projects view
     fileDropDown.setItemEnabled(
         MESSAGES.deleteMenuItemButton(),
         Ode.getInstance().getProjectManager().getProjects() == null);
     fileDropDown.setItemEnabled(
         MESSAGES.exportAllProjectsButton(),
         Ode.getInstance().getProjectManager().getProjects().size() > 0);
     fileDropDown.setItemEnabled(MESSAGES.exportProjectButton(), false);
     fileDropDown.setItemEnabled(MESSAGES.saveMenuItem(), false);
     fileDropDown.setItemEnabled(MESSAGES.saveAsMenuItem(), false);
     fileDropDown.setItemEnabled(MESSAGES.checkpointButton(), false);
     buildDropDown.setItemEnabled(MESSAGES.showBarcodeButton(), false);
     buildDropDown.setItemEnabled(MESSAGES.downloadToComputerButton(), false);
   } else { // We have to be in the Designer/Blocks view
     fileDropDown.setItemEnabled(MESSAGES.deleteMenuItemButton(), false);
     fileDropDown.setItemEnabled(MESSAGES.exportAllProjectsButton(), false);
     fileDropDown.setItemEnabled(MESSAGES.exportProjectButton(), false);
     fileDropDown.setItemEnabled(MESSAGES.saveMenuItem(), true);
     fileDropDown.setItemEnabled(MESSAGES.saveAsMenuItem(), true);
     fileDropDown.setItemEnabled(MESSAGES.checkpointButton(), true);
     buildDropDown.setItemEnabled(MESSAGES.showBarcodeButton(), true);
     buildDropDown.setItemEnabled(MESSAGES.downloadToComputerButton(), true);
   }
   updateKeystoreFileMenuButtons();
 }