Ejemplo n.º 1
0
  @Override
  public void createPartControl(Composite parent) {
    if (engine == null) {
      init();
    }
    Display display = parent.getDisplay();
    fBackgroundColor = display.getSystemColor(SWT.COLOR_LIST_BACKGROUND);
    fForegroundColor = display.getSystemColor(SWT.COLOR_LIST_FOREGROUND);
    fSeparatorColor = ColorManager.getColor(152, 170, 203);

    fComposite = createComposite(parent);
    fComposite.setLayout(new GridLayout());

    createTitleLabel(fComposite, Messages.getString("ReportDocumentEditor.1")); // $NON-NLS-1$
    createLabel(fComposite, null);
    createLabel(fComposite, null);

    createHeadingLabel(fComposite, Messages.getString("ReportDocumentEditor.2")); // $NON-NLS-1$

    Composite separator = createCompositeSeparator(fComposite);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    data.heightHint = 2;
    separator.setLayoutData(data);

    createInfomation(fComposite);
  }
Ejemplo n.º 2
0
/** The main plugin class to be used in the desktop. */
public class CorePlugin extends AbstractUIPlugin {
  public static final RGB defaultRootBackGroundRGB = new RGB(157, 167, 195);
  public static final Color ReportRootBackgroundColor =
      ColorManager.getColor(
          "org.eclipse.birt.report.designer.ui.ReportRootBackgroundColor",
          defaultRootBackGroundRGB); // 0xEFEFF7
  public static final Color ReportForeground =
      ColorManager.getColor(
          "org.eclipse.birt.report.designer.ui.ReportForeground", new RGB(0, 0, 0)); // 0xEFEFF7
  // The shared instance.

  private static final String RESOURCE_BUNDLE_BASE_NAME =
      "org.eclipse.birt.report.designer.core.CorePluginResources"; //$NON-NLS-1$

  private static CorePlugin plugin;

  // Resource bundle.
  private ResourceBundle resourceBundle;

  public static String RESOURCE_FOLDER;

  /** The constructor. */
  public CorePlugin() {
    super();
    plugin = this;
    try {
      resourceBundle = ResourceBundle.getBundle(RESOURCE_BUNDLE_BASE_NAME);
    } catch (MissingResourceException x) {
      resourceBundle = null;
    }
  }

  /** Returns the shared instance. */
  public static CorePlugin getDefault() {
    return plugin;
  }

  /** Returns the string from the plugin's resource bundle, or 'key' if not found. */
  public static String getResourceString(String key) {
    ResourceBundle bundle = Platform.getResourceBundle(getDefault().getBundle());

    try {
      return (bundle != null) ? bundle.getString(key) : key;
    } catch (MissingResourceException e) {
      return key;
    }
  }

  /** Returns the plugin's resource bundle, */
  public ResourceBundle getResourceBundle() {
    return resourceBundle;
  }

  /*
   * (non-Javadoc)
   *
   * @org.eclipse.ui.plugin#start( BundleContext context )
   */
  public void start(BundleContext context) throws Exception {
    super.start(context);
  }

  /**
   * If use the default color.
   *
   * @return
   */
  public static boolean isUseNormalTheme() {
    return ReportRootBackgroundColor.getRGB().equals(defaultRootBackGroundRGB);
  }
}