Ejemplo n.º 1
0
 private void newVLVIndexClicked() {
   if (newVLVIndexPanel == null) {
     newVLVIndexPanel =
         new NewVLVIndexPanel(
             (String) backends.getSelectedItem(), Utilities.getParentDialog(this));
     newVLVIndexPanel.setInfo(getInfo());
     newVLVIndexDialog = new GenericDialog(null, newVLVIndexPanel);
     Utilities.centerGoldenMean(newVLVIndexDialog, Utilities.getParentDialog(this));
     newVLVIndexPanel.addConfigurationElementCreatedListener(
         new ConfigurationElementCreatedListener() {
           /** {@inheritDoc} */
           public void elementCreated(ConfigurationElementCreatedEvent ev) {
             Object o = ev.getConfigurationObject();
             if (o instanceof AbstractIndexDescriptor) {
               lastCreatedIndex = (AbstractIndexDescriptor) o;
             }
           }
         });
   } else if (!newVLVIndexDialog.isVisible()) {
     String backendID = (String) backends.getSelectedItem();
     for (BackendDescriptor backend : getInfo().getServerDescriptor().getBackends()) {
       if (backend.getBackendID().equalsIgnoreCase(backendID)) {
         newVLVIndexPanel.update(backend);
         break;
       }
     }
   }
   newVLVIndexDialog.setVisible(true);
 }
Ejemplo n.º 2
0
 /** {@inheritDoc} */
 public void toBeDisplayed(boolean visible) {
   super.toBeDisplayed(visible);
   Window w = Utilities.getParentDialog(this);
   if (w instanceof GenericDialog) {
     ((GenericDialog) w).getRootPane().setDefaultButton(null);
   } else if (w instanceof GenericFrame) {
     ((GenericFrame) w).getRootPane().setDefaultButton(null);
   }
 }