def METHOD_NAME(self, parent):
    """Creates the Traits UI for displaying the array."""
    # Make sure that the value is an array of the correct shape:
    shape = self.value.shape
    len_shape = len(shape)
    if (len_shape == 0) or (len_shape > 2):
        raise ValueError(
            "ArrayViewEditor can only display 1D or 2D " "arrays"
        )
    factory = self.factory
    cols = 1
    titles = factory.titles
    n = len(titles)
    self.show_titles = n > 0
    is_2d = len_shape == 2
    if is_2d:
        index = 1
        if factory.transpose:
            index = 0
        cols = shape[index]
        if self.show_titles:
            if n > cols:
                titles = titles[:cols]
            elif n < cols:
                if (cols % n) == 0:
                    titles, old_titles, i = [], titles, 0
                    while len(titles) < cols:
                        titles.extend(
                            "%s%d" % (title, i) for title in old_titles
                        )
                        i += 1
                else:
                    titles.extend([""] * (cols - n))
        else:
            titles = ["Data %d" % i for i in range(cols)]
    columns = [(title, i) for i, title in enumerate(titles)]
    if factory.show_index:
        columns.insert(0, ("Index", "index"))
    self.adapter = ArrayViewAdapter(
        is_2d=is_2d,
        columns=columns,
        transpose=factory.transpose,
        format=factory.format,
        font=factory.font,
    )
    return self.edit_traits(
        view="_array_view", parent=parent, kind="subpanel"
    )