Subclasses may override to customize how this dialog is built.
343760
protected void addDialogComponents() {
		JComponent dialogContentPane = createDialogContentPane();
		GuiStandardUtils.attachDialogBorder(dialogContentPane);
		if (getPreferredSize() != null) {
			dialogContentPane.setPreferredSize(getPreferredSize());
		}
		getDialogContentPane().add(dialogContentPane);
		getDialogContentPane().add(createButtonBar(), BorderLayout.SOUTH);
	}
977102
private void baseInstanceModified() {
        ContextServiceImpl[] listeners;

        lock.writeLock().lock();
        try {
            listeners = modificationListeners.toArray(new ContextServiceImpl[modificationListeners.size()]);
            modificationListeners.clear();
            threadContextConfigurations = null;
        } finally {
            lock.writeLock().unlock();
        }

        for (ContextServiceImpl listener : listeners)
            listener.baseInstanceModified();
    }
1274340
function custom (properties, property, key, event) {
  if (property === null) {
    properties[key] = null
  } else if (property.val) {
    property.val = parseProperty(property.val)
    var prototype = property.val.prototype
    if (prototype && prototype instanceof Base) {
      if (property.override) {
        properties._overrides = properties._overrides || {}
        properties._overrides[key] = property.override
        properties[key] = Properties
          .createPropertyConstructor(property.val, property.override, true)
        properties[key].override = property.override
        properties[property.override] = properties[key]
      } else {
        this[key] = properties[key] = prototype
        prototype._parent = this
      }
    } else {
      if (property.override) {
        properties[key] = Properties.createPrimitiveProperty(property.override)
      } else {
        properties[key] = Properties.default
      }
      properties[key].call(this, property.val, void 0, void 0, key)
    }
  } else if (key !== '_overrides') {
    if (property.type) {
      let res = this.getType(property, event, key, void 0)
      if (res instanceof Base) {
        properties[key] = Properties
        .createPropertyConstructor(new res.Constructor(property, false, this, key).Constructor, key)
        return
      }
    }
    properties[key] = Properties
      .createPropertyConstructor(new this.Child(property, false, this, key).Constructor, key)
  }
}
967948
def _override_cfg(container, yamlkeys, value):
    

    key = yamlkeys[0]
    rest = yamlkeys[1:]

    if len(rest) == 0:
        # no rest means we found the key to update.
        container[key] = value

    elif key in container:
        # still need to find the leaf in the tree, so recurse.
        _override_cfg(container[key], rest, value)

    else:
        # need to create a sub-tree down to the leaf to insert into.
        subtree = {}
        _override_cfg(subtree, rest, value)
        container[key] = subtree
515480
private void dialogChanged() {
		
		// TODO: Needs to be cleaned up, this design is tied to a two page design and can't handle a third page, e.g. used for some other component type...

		if (componentType.value == UTILITY_COMPONENT.ordinal()) {
			updateStatus("Utility components are not yet supported");
			return;
		}

		String artifactId = getArtifactId();
		if (artifactId == null) {
			updateStatus("Missing artifact id");
			return;
		}

		if (artifactId.toLowerCase().startsWith("test")) {
			updateStatus("Artifact id should not start with \"test\" since it will confuse JUnit to think that non unit-test classes are unit-test classes");
			return;
		}

		// If creating an integration component then force viewing page #2 otherwise mark it as completed
		ComponentEnum compEnum = ComponentEnum.get(componentType.value);
		CreateIntegrationComponentPage p = ((CreateComponentWizard)getWizard()).getCreateIntegrationComponentPage();
		p.setMustBeDisplayed(compEnum == INTEGRATION_COMPONENT);
		getContainer().updateButtons();

		// If creating an schema description integration component then force viewing page #2 otherwise mark it as completed
		CreateServiceDescriptionComponentPage p2 = ((CreateComponentWizard)getWizard()).getCreateServiceDescriptionComponentPage();
		p2.setMustBeDisplayed(compEnum == SD_SCHEMA_COMPONENT);
		getContainer().updateButtons();
		
		String rootFolderName = getRootFolder();

		if (rootFolderName.length() == 0) {
			updateStatus("The root folder must be specified");
			return;
		}

		File rootFolder = new File(rootFolderName);
		if (!rootFolder.isDirectory()) {
			updateStatus("The root folder must be an existing folder");
			return;
		}
		
		String projectFolderName = getComponentProjectName(componentType.value, getGroupId(), getArtifactId());
		
		System.err.println("comp-type: " + componentType + ", proj-namn: " + projectFolderName);
		if (projectFolderName != null) {
			File projectFolder = new File(rootFolderName + "/" + projectFolderName);
			if (projectFolder.exists()) {
				updateStatus("Project folder [" + projectFolderName + "] already exists in root folder [" + rootFolderName + "], select a name of a non-existing folder");
				return;
			}
		}
		
		// TODO: Also assert that a project with the selected name doesn't already exist in the workspace

		File mvnHome = new File(getMavenHome());
		if (!mvnHome.isDirectory()) {
			updateStatus("The maven home folder must be an existing folder, update in the soi-toolkit preferences page");
			return;
		}
		
		File mvn = new File(getMavenHome() + "/bin/mvn" + (SwtUtil.isWindows() ? ".bat" : ""));
		if (!mvn.isFile()) {
			updateStatus("The maven executable can't be found at: " + mvn.getAbsolutePath() + ", update in the soi-toolkit preferences page");
			return;
		}
		
		// Validate custom model by setting it on the model-factory-class
		String groovyClass = getCustomGroovyModelImpl();
		if (groovyClass == null || groovyClass.trim().length() == 0) {
			System.err.println("### Empty groovy-classname, reset model");
			ModelFactory.resetModelClass();
		} else {
			try {
				System.err.println("### Setting groovy-classname: " + groovyClass);
				ModelFactory.setModelGroovyClass(new URL(groovyClass));
			} catch (Throwable ex) {
				ModelFactory.resetModelClass();
				updateStatus("Invalid Groovy class for a custom model (update in the soi-toolkit preferences page), error: " + ex);
				return;
			}
		}

		updateStatus(null);
	}
848069
private void visitOverride(AnnotatedNode node, AnnotationNode visited) {
        ClassNode annotationClassNode = visited.getClassNode();
        if (annotationClassNode.isResolved() && annotationClassNode.getName().equals("java.lang.Override")) {
            if (node instanceof MethodNode) {
                MethodNode origMethod = (MethodNode) node;
                ClassNode cNode = node.getDeclaringClass();
                ClassNode next = cNode;
                outer:
                while (next != null) {
                    Map genericsSpec = createGenericsSpec(next);
                    MethodNode mn = correctToGenericsSpec(genericsSpec, origMethod);
                    if (next != cNode) {
                        ClassNode correctedNext = correctToGenericsSpecRecurse(genericsSpec, next);
                        MethodNode found = getDeclaredMethodCorrected(genericsSpec, mn, correctedNext);
                        if (found != null) break;
                    }
                    List<ClassNode> ifaces = new ArrayList<ClassNode>();
                    ifaces.addAll(Arrays.asList(next.getInterfaces()));
                    Map updatedGenericsSpec = new HashMap(genericsSpec);
                    while (!ifaces.isEmpty()) {
                        ClassNode origInterface = ifaces.remove(0);
                        if (!origInterface.equals(ClassHelper.OBJECT_TYPE)) {
                            updatedGenericsSpec = createGenericsSpec(origInterface, updatedGenericsSpec);
                            ClassNode iNode = correctToGenericsSpecRecurse(updatedGenericsSpec, origInterface);
                            MethodNode found2 = getDeclaredMethodCorrected(updatedGenericsSpec, mn, iNode);
                            if (found2 != null) break outer;
                            ifaces.addAll(Arrays.asList(iNode.getInterfaces()));
                        }
                    }
                    ClassNode superClass = next.getUnresolvedSuperClass();
                    if (superClass!=null) {
                        next =  correctToGenericsSpecRecurse(updatedGenericsSpec, superClass);
                    } else {
                        next = null;
                    }
                }
                if (next == null) {
                    addError("Method '" + origMethod.getName() + "' from class '" + cNode.getName() + "' does not override " +
                            "method from its superclass or interfaces but is annotated with @Override.", visited);
                }
            }
        }
    }
745526
def addHandlerClass(clazz):
    """"""
    if not issubclass(clazz, EventHandler):
        raise ValueError("%s must be subclassed from %s" % (clazz, EventHandler))
    _handler_classes[clazz.name] = clazz
162836
def kwargs(self):
        """"""
        # Subclasses must override this property if and only if they define
        # keyword-only arguments in their __init__ method
        if hasattr(self, '_has_kwargs') and self._has_kwargs:
            raise NotImplementedError(
                "Class %s does not provide a kwargs property"
                % str(self.__class__.__name__))
        return {}
840671
private void configureButtonBarDialogBuilder(
            @NonNull final AbstractButtonBarDialogBuilder builder) {
        if (shouldNegativeButtonBeShown()) {
            builder.setNegativeButton(getNegativeButtonText(), createNegativeButtonListener());
        }

        if (shouldNeutralButtonBeShown()) {
            builder.setNeutralButton(getNeutralButtonText(), createNeutralButtonListener());
        }

        if (shouldPositiveButtonBeShown()) {
            builder.setPositiveButton(getPositiveButtonText(), createPositiveButtonListener());
        }

        builder.stackButtons(shouldStackButtons());
        builder.showButtonBarDivider(shouldButtonBarDividerBeShown());
    }
29579
private void initializeShowCustomDialogPreference() {
        Preference preference =
                findPreference(getString(R.string.show_custom_dialog_preference_key));
        preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

            @Override
            public boolean onPreferenceClick(final Preference preference) {
                initializeCustomDialog();
                customDialog.setShowAnimation(createRectangularRevealAnimation(preference));
                customDialog.setDismissAnimation(createRectangularRevealAnimation(preference));
                customDialog.setCancelAnimation(createRectangularRevealAnimation(preference));
                customDialog.show();
                return true;
            }

        });
    }
1085391
def preferences_class_prepared(sender, *args, **kwargs):
    
    cls = sender
    if issubclass(cls, Preferences):
        # Add singleton manager to subclasses.
        cls.add_to_class('singleton', SingletonManager())
        # Add property for preferences object to preferences.preferences.
        setattr(preferences.Preferences, cls._meta.object_name, property(lambda x: cls.singleton.get()))
44360
protected void updateOverwriteExisting() {

        if (m_overwriteExisting != null) {
            boolean move = (m_dialogMode == DialogMode.move) || (m_actionCombo.getValue() == Action.move);
            if (move) {
                m_overwriteExisting.setValue(Boolean.FALSE);
                m_overwriteExisting.setVisible(false);
            } else {
                m_overwriteExisting.setVisible(true);
            }
        }
    }
1041461
function() {
    this.mask && this.mask.setPosition();

    if (!this.option('baseElement')) {
      this.option('baseElement', this.document);
    }

    Dialog.superclass.setPosition.apply(this);
  }
366573
private void processInheritsCall(Node n) {
    if (n.getChildCount() == 3) {
      Node subClass = n.getSecondChild();
      Node superClass = subClass.getNext();
      if (subClass.isUnscopedQualifiedName() && superClass.isUnscopedQualifiedName()) {
        knownClosureSubclasses.add(subClass.getQualifiedName());
      }
    }
  }
1088637
protected void buildAndShowDialog(@Nullable Bundle savedInstanceState) {
        final AlertDialog.Builder dialogBuilder = new AlertDialog.Builder(this);
        final String title = dialogConfiguration.title();
        if (title != null) {
            dialogBuilder.setTitle(title);
        }
        final int iconResourceId = dialogConfiguration.resIcon();
        if (iconResourceId != ACRAConstants.DEFAULT_RES_VALUE) {
            dialogBuilder.setIcon(iconResourceId);
        }
        dialogBuilder.setView(buildCustomView(savedInstanceState))
                .setPositiveButton(dialogConfiguration.positiveButtonText(), this)
                .setNegativeButton(dialogConfiguration.negativeButtonText(), this);

        mDialog = dialogBuilder.create();
        mDialog.setCanceledOnTouchOutside(false);
        mDialog.show();
    }
568688
private void overrideUseMavenPatterns(T overrider, Class overriderClass) {
        if (useMavenPatternsOverrideList.contains(overriderClass.getSimpleName())) {
            try {
                Field useMavenPatternsField = overriderClass.getDeclaredField("useMavenPatterns");
                useMavenPatternsField.setAccessible(true);
                Object useMavenPatterns = useMavenPatternsField.get(overrider);

                if (useMavenPatterns == null) {
                    Field notM2CompatibleField = overriderClass.getDeclaredField("notM2Compatible");
                    notM2CompatibleField.setAccessible(true);
                    Object notM2Compatible = notM2CompatibleField.get(overrider);
                    if (notM2Compatible instanceof Boolean && notM2Compatible != null) {
                        useMavenPatternsField.set(overrider, !(Boolean)notM2Compatible);
                    }
                }
            } catch (NoSuchFieldException | IllegalAccessException e) {
                converterErrors.add(getConversionErrorMessage(overrider, e));
            }
        }
    }
899304
public static boolean overrides(
      DeclaredType type, Types types, String methodName, TypeMirror... params) {
    return overrides(asElement(type), types, methodName, params);
  }