Examples of ConfigurationManager


Examples of org.exoplatform.container.configuration.ConfigurationManager

    * {@inheritDoc}
    */
   @Override
   public void start()
   {
      ConfigurationManager cm = super.getComponentInstanceOfType(ConfigurationManager.class, false);
      // We check if the component has been defined in the configuration of the current container
      // The goal is to enable the WeldContainer only if it is needed
      Component component = cm.getComponent(WeldContainerHelper.class);
      if (component == null)
      {
         if (LOG.isDebugEnabled())
         {
            LOG.debug("No WeldContainerHelper has been defined, thus the WeldContainer will be disabled."
View Full Code Here

Examples of org.exoplatform.webui.application.ConfigurationManager

            log.debug("Application " + key + " not found");
        }

        //
        if (uiapp == null) {
            ConfigurationManager cmanager = app.getConfigurationManager();
            String uirootClass = cmanager.getApplication().getUIRootComponent().trim();
            Class<? extends UIApplication> type = (Class<UIApplication>) Thread.currentThread().getContextClassLoader()
                    .loadClass(uirootClass);
            uiapp = app.createUIComponent(type, null, null, context);
        }
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

   
    Map.Entry entry;
    String key;
    Iterator itr = this.data_map.entrySet().iterator();
   
    ConfigurationManager config = ConfigurationManager.getInstance();
    while (itr.hasNext()) {
      entry = (Map.Entry)itr.next();
      key = this.key_prefix + (String)entry.getKey();
      this.params_monitored.add(key);
      config.registerTransientParameter(key);
      config.setParameterRawNoNotify(key, entry.getValue());
      config.addParameterListener(key, this);
    }
   
    config.addListener(this);
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

 
  // Not exposed in the plugin API...
  public void registerParameter(String full_param) {
    shouldBeInitialised(true);
    if (!this.params_monitored.add(full_param)) {return;}
    ConfigurationManager config = ConfigurationManager.getInstance();
    config.registerTransientParameter(full_param);
    config.addParameterListener(full_param, this);
    if (this.migrate_settings && COConfigurationManager.hasParameter(full_param, true)) {
      this.parameterChanged(full_param);
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

 
  private ArrayList listeners = new ArrayList();

  public void initialize() {
    // Shorten from COConfigurationManager To make code more readable
    final ConfigurationManager config = ConfigurationManager.getInstance();
    boolean overrideLog = System.getProperty("azureus.overridelog") != null;

    for (int i = 0; i < ignoredComponents.length; i++) {
      ignoredComponents[i] = new ArrayList();
    }

    if (!overrideLog) {
      config.addListener(new COConfigurationListener() {
        public void configurationSaved() {
          checkLoggingConfig();
        }
      });
    }

    checkLoggingConfig();
    config.addParameterListener(CFG_ENABLELOGTOFILE, new ParameterListener() {
      public void parameterChanged(String parameterName) {
        FileLogging.this.reloadLogToFileParam();
      }
    });
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

  /**
   *
   */
  protected void reloadLogToFileParam() {
    final ConfigurationManager config = ConfigurationManager.getInstance();
    boolean bNewLogToFile = System.getProperty("azureus.overridelog") != null || config.getBooleanParameter(CFG_ENABLELOGTOFILE);
    if (bNewLogToFile != bLogToFile) {
      bLogToFile = bNewLogToFile;
      if (bLogToFile)
        Logger.addListener(this);
      else{
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

  }

  private void checkLoggingConfig() {
    try {
      // Shorten from COConfigurationManager To make code more readable
      final ConfigurationManager config = ConfigurationManager.getInstance();
     
      String timeStampFormat;

      boolean overrideLog = System.getProperty("azureus.overridelog") != null;
      if (overrideLog) {
       
        // Don't set this - reloadLogToFileParam will do it.
        //bLogToFile = true;
        sLogDir = System.getProperty("azureus.overridelogdir", ".");
        iLogFileMaxMB = 2;
        timeStampFormat = "HH:mm:ss.SSS ";

        for (int i = 0; i < ignoredComponents.length; i++) {
          ignoredComponents[i].clear();
        }
       
        reloadLogToFileParam();
      } else {
        reloadLogToFileParam();

        sLogDir = config.getStringParameter("Logging Dir", "");

        iLogFileMaxMB = config.getIntParameter("Logging Max Size");
       
        timeStampFormat = config.getStringParameter("Logging Timestamp")+" ";

        for (int i = 0; i < ignoredComponents.length; i++) {
          ignoredComponents[i].clear();
          int logType = indexToLogType(i);
          for (int j = 0; j < configurableLOGIDs.length; j++) {
            if (!config.getBooleanParameter("bLog." + logType + "."
                + configurableLOGIDs[j], true))
              ignoredComponents[i].add(configurableLOGIDs[j]);
          }
        }
      }
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

    // temporarily set to true, to log any errors between now and setting
    // bEnabled properly.
    bEventLoggingEnabled = true;
   
    // Shorten from COConfigurationManager To make code more readable
    final ConfigurationManager config = ConfigurationManager.getInstance();

    boolean overrideLog = System.getProperty("azureus.overridelog") != null;
    if (overrideLog) {
      bEventLoggingEnabled = true;
    } else {
      bEventLoggingEnabled = config.getBooleanParameter("Logger.Enabled");

      config.addParameterListener("Logger.Enabled", new ParameterListener() {
        public void parameterChanged(String parameterName) {
          bEventLoggingEnabled = config.getBooleanParameter("Logger.Enabled");
        }
      });
    }
  }
View Full Code Here

Examples of org.gudy.azureus2.core3.config.impl.ConfigurationManager

   * @return The composite containing the legend
   */
  public static Composite createLegendComposite(final Composite panel,
      final Color[] blockColors, final String[] keys, Object layoutData) {
   
    final ConfigurationManager config = ConfigurationManager.getInstance();

    if (blockColors.length != keys.length)
      return null;

    final Color[] defaultColors = new Color[blockColors.length];
    final ParameterListener[] paramListeners = new ParameterListener[keys.length];
    System.arraycopy(blockColors, 0, defaultColors, 0, blockColors.length);

    Composite legend = new Composite(panel, SWT.NONE);
    if (layoutData != null)
      legend.setLayoutData(layoutData);

    RowLayout layout = new RowLayout(SWT.HORIZONTAL);
    layout.wrap = true;
    layout.marginBottom = 0;
    layout.marginTop = 0;
    layout.marginLeft = 0;
    layout.marginRight = 0;
    layout.spacing = 0;
    legend.setLayout(layout);

    RowData data;
    for (int i = 0; i < blockColors.length; i++) {
      int r = config.getIntParameter(keys[i] + ".red", -1);
      if (r >= 0) {
        int g = config.getIntParameter(keys[i] + ".green");
        int b = config.getIntParameter(keys[i] + ".blue");
       
        Color color = ColorCache.getColor(panel.getDisplay(), r, g, b);
        blockColors[i] = color;
      }

      Composite colorSet = new Composite(legend, SWT.NONE);

      colorSet.setLayout(new RowLayout(SWT.HORIZONTAL));

      final Canvas cColor = new Canvas(colorSet, SWT.BORDER);
      cColor.setData("Index", new Integer(i));
      // XXX Use paint instead of setBackgrond, because OSX does translucent
      // crap
      cColor.addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent e) {
          int i = ((Integer)cColor.getData("Index")).intValue();
          e.gc.setBackground(blockColors[i]);
          e.gc.fillRectangle(e.x, e.y, e.width, e.height);
        }
      });

      cColor.addMouseListener(new MouseAdapter() {
        public void mouseUp(MouseEvent e) {
          Integer iIndex = (Integer)cColor.getData("Index");
          if (iIndex == null)
            return;
          int index = iIndex.intValue();

          if (e.button == 1) {
            ColorDialog cd = new ColorDialog(panel.getShell());
            cd.setRGB(blockColors[index].getRGB());
           
            RGB rgb = cd.open();
            if (rgb != null)
              config.setRGBParameter(keys[index], rgb.red, rgb.green, rgb.blue);
          } else {
            config.removeRGBParameter(keys[index]);
          }
        }
      });

      Label lblDesc = new Label(colorSet, SWT.NULL);
      Messages.setLanguageText(lblDesc, keys[i]);

      data = new RowData();
      data.width = 20;
      data.height = lblDesc.computeSize(SWT.DEFAULT, SWT.DEFAULT).y - 3;
      cColor.setLayoutData(data);
     
      // If color changes, update our legend
      config.addParameterListener(keys[i],paramListeners[i] = new ParameterListener() {
        public void parameterChanged(String parameterName) {
          for (int j = 0; j < keys.length; j++) {
            if (keys[j].equals(parameterName)) {
              final int index = j;

              final int r = config.getIntParameter(keys[j] + ".red", -1);
              if (r >= 0) {
                final int g = config.getIntParameter(keys[j] + ".green");
                final int b = config.getIntParameter(keys[j] + ".blue");
               
                final RGB rgb = new RGB(r, g, b);
                if (blockColors[j].isDisposed()
                    || !rgb.equals(blockColors[j].getRGB())) {

                  Utils.execSWTThread(new AERunnable() {
                    public void runSupport() {
                      if (panel == null || panel.isDisposed())
                        return;
                      Color color = ColorCache.getColor(panel.getDisplay(), r, g, b);
                      blockColors[index] = color;
                      cColor.redraw();
                    }
                  });
                }
              } else {
                if (blockColors[j].isDisposed()
                    || !blockColors[j].equals(defaultColors[j])) {
                  Utils.execSWTThread(new AERunnable() {
                    public void runSupport() {
                      if (panel == null || panel.isDisposed())
                        return;
                      blockColors[index] = defaultColors[index];
                      cColor.redraw();
                    }
                  });
                }
              }
            }
          }
        }
      });
    }
   
    legend.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        // We don't want to give them disposed colors
        // Restore defaults in case blockColors is a static or is used
        // afterwards, or if the view wants to dispose of the old colors.
        for (int i = 0; i < blockColors.length; i++)
          blockColors[i] = defaultColors[i];
        for (int i = 0; i < keys.length;i++)
          config.removeParameterListener(keys[i], paramListeners[i]);
      }
    });

    return legend;
  }
View Full Code Here

Examples of org.jboss.ide.eclipse.freemarker.configuration.ConfigurationManager

            SelectionDialog sd = JavaUI.createTypeDialog(new Shell(), null, SearchEngine.createWorkspaceScope(),
                IJavaElementSearchConstants.CONSIDER_CLASSES_AND_INTERFACES, false);
            sd.open();
            Object[] objects = sd.getResult();
            if (null != objects && objects.length > 0) {
              ConfigurationManager configuration = ConfigurationManager.getInstance(interpolation.getResource().getProject());
              IType type = (IType) objects[0];
              try {
                configuration.addContextValue(
                    new ContextValue(interpolation.getFirstToken(),
                        configuration.getClass(type.getFullyQualifiedName()), null), interpolation.getResource());
              }
              catch (ClassNotFoundException e) {
                Plugin.log(e);
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.