@Override
 public void setPageComplete(boolean complete) {
   if (packageNameIsDiscouraged()) {
     setMessage(getDiscouragedNamespaceMessage(), WARNING);
   } else {
     setMessage(null);
   }
   if (complete) {
     if (!packageFragment.exists()) {
       setMessage(
           "Package does not exist: " + packageFragment.getElementName(), IMessageProvider.ERROR);
       super.setPageComplete(false);
       return;
     }
     for (String file : getFileNames()) {
       IPath path = packageFragment.getPath().append(file).addFileExtension("ceylon");
       if (getWorkspace().getRoot().getFile(path).exists()) {
         setMessage(
             "Existing unit will not be overwritten: " + path.toPortableString(),
             IMessageProvider.ERROR);
         super.setPageComplete(false);
         return;
       }
     }
     MoveToNewUnitRefactoring refactoring = (MoveToNewUnitRefactoring) getRefactoring();
     refactoring.setTargetProject(getPackageFragment().getResource().getProject());
     refactoring.setTargetFile(getFile());
     refactoring.setTargetPackage(getPackageFragment());
     refactoring.setIncludePreamble(isIncludePreamble());
   }
   super.setPageComplete(complete);
 }
 private void runInUI() {
   IWizard wizard = page.getWizard();
   if (wizard != null) {
     IWizardContainer container = wizard.getContainer();
     if (container != null) {
       page.setPageComplete(optionsStatus);
       container.updateButtons();
     }
   }
 }
 @Override
 public void setVisible(boolean visible) {
   if (visible) {
     if (fFirstTime) {
       fFirstTime = false;
       setPageComplete(false);
       updatePreview(getText());
       fTextField.setFocus();
     } else {
       setPageComplete(validatePage(true));
     }
   }
   super.setVisible(visible);
 }
 public void setVisible(boolean visible) {
   if (visible) {
     IMember[] membersToMove = getMoveProcessor().getMembersToMove();
     int membersToMoveCount = membersToMove.length;
     String label =
         JavaElementLabels.getElementLabel(
             getMoveProcessor().getDeclaringType(), JavaElementLabels.ALL_FULLY_QUALIFIED);
     String message =
         membersToMoveCount == 1
             ? Messages.format(
                 RefactoringMessages.MoveMembersInputPage_descriptionKey_singular,
                 new String[] {
                   JavaElementLabels.getTextLabel(
                       membersToMove[0], JavaElementLabels.ALL_FULLY_QUALIFIED),
                   label
                 })
             : Messages.format(
                 RefactoringMessages.MoveMembersInputPage_descriptionKey_plural,
                 new String[] {new Integer(membersToMoveCount).toString(), label});
     setDescription(message);
   }
   super.setVisible(visible);
 }
 public void dispose() {
   DelegateUIHelper.saveLeaveDelegateSetting(fLeaveDelegateCheckBox);
   DelegateUIHelper.saveDeprecateDelegateSetting(fDeprecateDelegateCheckBox);
   super.dispose();
 }
Esempio n. 6
0
 @Override
 public void setVisible(final boolean visible) {
   super.setVisible(visible);
   fVariableNameControl.setFocus();
 }