Exemple #1
0
  @Inject
  public TreeFrameManager(
      final WindowManager windowManager,
      @GlobalConfig final AggregateConfigProvider globalConfig,
      @GlobalConfig final ColourManager colourManager,
      final ActiveFrameManager activeFrameManager,
      final SwingWindowFactory windowFactory,
      @PluginDomain(SwingController.class) final String domain,
      final EventBus eventBus,
      final SwingEventBus swingEventBus,
      final IconManager iconManager) {
    this.windowFactory = windowFactory;
    this.windowManager = windowManager;
    this.nodes = new HashMap<>();
    this.config = globalConfig;
    this.colourManager = colourManager;
    this.activeFrameManager = activeFrameManager;
    this.eventBus = eventBus;
    this.swingEventBus = swingEventBus;
    this.iconManager = iconManager;

    UIUtilities.invokeLater(
        () -> {
          model = new TreeViewModel(config, new TreeViewNode(null, null));
          tree = new Tree(this, model, swingEventBus, globalConfig, domain);
          tree.setCellRenderer(new TreeViewTreeCellRenderer(config, colourManager, this));
          tree.setVisible(true);

          config.addChangeListener("treeview", this);
          config.addChangeListener("ui", "sortrootwindows", this);
          config.addChangeListener("ui", "sortchildwindows", this);
          config.addChangeListener("ui", "backgroundcolour", this);
          config.addChangeListener("ui", "foregroundcolour", this);
        });
  }
Exemple #2
0
 public void onLoad() {
   config.addChangeListener(domain, this);
   userConfig.setOption(domain, "general.icon", filesHelper.getFilesDirString() + "icon.png");
   setCachedSettings();
   // Extract the files needed
   try {
     filesHelper.extractResourcesEndingWith(".py");
     filesHelper.extractResourcesEndingWith(".png");
   } catch (IOException ex) {
     LOG.warn(
         USER_ERROR,
         "Unable to extract files for Free desktop notifications: {}",
         ex.getMessage(),
         ex);
   }
 }