Пример #1
0
    def __init__(self, out_of_scope):
        ColumnPanel.__init__(self)

        out_of_scope_list = JList(tuple(out_of_scope))
        self.add(JScrollPane(out_of_scope_list))
        self.setBorder(make_title_border("Out of scope"))
        self.setMaximumSize(Dimension(9999999, self.getPreferredSize().height))
Пример #2
0
 def __init__(self):
     panel = ColumnPanel()
     apibox = APIBox()
     panel.add(apibox)
     JScrollPane.__init__(self, panel)
     context.addon.register_on_connect(apibox.show_username)
     context.addon.register_on_error(apibox.show_error)
Пример #3
0
    def __init__(self, scopes):
        ColumnPanel.__init__(self)

        scope_list = JList(tuple(entry.scope for entry in scopes))
        scope_list.setVisibleRowCount(10)
        btn_list = RowPanel()
        select_all = JButton("Select all")
        select_all.setMaximumSize(select_all.getPreferredSize())
        select_all.addActionListener(
            CallbackActionListener(
                partial(self.do_selection, scope_list, scopes)))
        btn_list.add(select_all)

        add_scope = JButton("Add to scope")
        add_scope.setMaximumSize(add_scope.getPreferredSize())
        add_scope.addActionListener(
            CallbackActionListener(partial(self.add_to_scope, scope_list)))
        btn_list.add(add_scope)

        self.add(JScrollPane(scope_list))
        self.add(btn_list)
        self.setBorder(make_title_border("Scopes"))
        self.setMaximumSize(Dimension(9999999, self.getPreferredSize().height))
Пример #4
0
    def __init__(self, program):
        self.setLayout(BorderLayout())

        left_col = RulesBox(program.rules_html)

        right_col = ColumnPanel()

        scopes = ScopesBox(program.scopes)
        right_col.add(scopes)

        if program.out_of_scope:
            out_of_scopes = OutOfScopeBox(program.out_of_scope)
            right_col.add(out_of_scopes)
        if program.user_agent:
            right_col.add(UABox(program))

        reward_stat = FixedRowPanel()
        reward_stat.add(RewardBox(program))
        reward_stat.add(StatsBox(program))
        reward_stat.setMaximumSize(
            Dimension(99999, reward_stat.getPreferredSize().height)
        )

        right_col.add(reward_stat)
        right_col.add(Box.createVerticalGlue())

        cols = FixedRowPanel()
        cols.add(left_col)
        cols.add(right_col)

        self.add(TitleBox(program), BorderLayout.PAGE_START)
        self.add(cols, BorderLayout.CENTER)
Пример #5
0
 def __init__(self):
     panel = ColumnPanel()
     panel.add(APIBox())
     JScrollPane.__init__(self, panel)