Package org.openbp.common.rc

Examples of org.openbp.common.rc.ResourceCollection


   * @param locale Locale
   * @return The string or null
   */
  public static String getOptionalString(String key, Locale locale)
  {
    ResourceCollection res = ResourceCollectionMgr.getDefaultInstance().getResource(CoreConstants.RC_CORE, CoreResources.class, locale);
    if (res != null)
    {
      return res.getOptionalString(key);
    }
    return null;
  }
View Full Code Here


   * @param skin Skin to add
   * @param skinName ame of the skin or null to add the icons as default icons
   */
  private void addToIconModel(Skin skin, String skinName)
  {
    ResourceCollection res = skin.getResource();

    for (Iterator it = res.getKeys(); it.hasNext();)
    {
      String key = (String) it.next();
      ResourceItem ri = res.getResourceItem(key);

      Object object = ri.getObject();
      if (object instanceof Icon)
      {
        ItemIconMgr.getInstance().registerIcon(skinName, key, (Icon) object);
View Full Code Here

    defaultIcon = getIcon();

    treeModel = new DefaultTreeTableModel(null);

    ResourceCollection res = getPluginResourceCollection();
    if (tableHeader == null)
    {
      tableHeader = new String [] { res.getRequiredString("header.column1"), res.getRequiredString("header.column2"), res.getRequiredString("header.column3") };

      titleStatus = res.getRequiredString("titlestatus");
    }
    treeModel.setColumnHeader(tableHeader);

    treeTable = new JTreeTable(treeModel);
    treeTable.setDefaultRowHeight(24);
View Full Code Here

  protected void initializeComponents()
  {
    if (tableHeaders == null)
    {
      // Initialize static resources
      ResourceCollection res = getPluginResourceCollection();

      tableHeaders = new Vector();
      tableHeaders.add(res.getRequiredString("header.column1"));
      tableHeaders.add(res.getRequiredString("header.column2"));

      titleStatus = res.getRequiredString("titlestatus");
    }

    // Create the table
    tableModel = new StackTraceTableModel();
View Full Code Here

      {
        // Double-clicking a placeholder w/o reference path means creating a reference to a process or process element.
        // We may either create a new one or choose an existing one.
        // Ask the user what he wants:

        ResourceCollection res = getDrawing().getEditor().getPluginResourceCollection();
        String title = res.getRequiredString("placeholder.referencedialog.title");
        String text = res.getRequiredString("placeholder.referencedialog.text");

        JMsgBox msgBox = new JMsgBox(null, title, text, JMsgBox.TYPE_YESNOCANCEL);
        msgBox.setResource(res);
        msgBox.setResourcePrefix("placeholder.referencedialog.");

        msgBox.initDialog();
        SwingUtil.show(msgBox);

        int choice = msgBox.getUserChoice();

        Model model = node.getOwningModel();

        if (choice == JMsgBox.TYPE_YES)
        {
          // Yes means create a new process
          final Item item = ItemCreationUtil.createItem(model, placeholderNode.getName(), placeholderNode.getDisplayName(), ItemTypes.PROCESS, null);
          if (item != null)
          {
            assignPlaceholderReference(item);

            // Open the new process
            SwingUtilities.invokeLater(new Runnable()
            {
              public void run()
              {
                getDrawing().getEditor().fireEvent("plugin.association.open", new BasicTransferable(item));
              }
            });
          }
        }
        else if (choice == JMsgBox.TYPE_NO)
        {
          // Yes means reference an existing process
          ItemSelectionDialog dlg = new ItemSelectionDialog(ApplicationUtil.getActiveWindow(), true);

          String dlgTitle = res.getRequiredString("placeholder.referencedialog.select");
          dlg.setTitle(dlgTitle);

          // We may select a single object only
          dlg.setSelectionMode(ItemTree.SELECTION_SINGLE);
          dlg.setShowGroups(false);
View Full Code Here

        if (nExit > 0)
          msgType |= DO_EXIT;
        if (nEntry > 0 && nExit > 0)
          msgType |= DO_ALL;

        ResourceCollection res = getDrawing().getEditor().getPluginResourceCollection();
        String title = res.getRequiredString("node.addparam.title");
        String text = res.getRequiredString("node.addparam.text");

        try
        {
          DataTypeItem type = (DataTypeItem) data.getTransferData(ClientFlavors.TYPE_ITEM);
          text = MsgFormat.format(text, type.getDisplayText());
View Full Code Here

    rootNode = new GeneratorNode();
    treeModel = new DefaultTreeTableModel(rootNode);

    if (tableHeader == null)
    {
      ResourceCollection resourceCollection = wizard.getResource();
      tableHeader = new String [] { resourceCollection.getRequiredString("wizard.selection.header1"), resourceCollection.getRequiredString("wizard.selection.header2"), };
    }
    treeModel.setColumnHeader(tableHeader);

    treeTable = new JTreeTable(treeModel);
    treeTable.setRootVisible(false);
View Full Code Here

   * Loads the plugin resources.
   */
  protected void initializeResources()
  {
    // Get the default resource if none given yet
    ResourceCollection res = getPluginResourceCollection();
    if (res == null)
    {
      res = ResourceCollectionMgr.getDefaultInstance().getResource(getResourceCollectionContainerName(), getClass());
      if (res == null)
        throw new RuntimeException("Cannot find resource for class '" + getClass().getName() + "' in resource container '"
          + getResourceCollectionContainerName() + "'.");
      setResourceCollection(res);
    }

    // Name and description are optional, title and icon not
    name = getNonNullResourceString(PROPERTY_NAME, name);
    title = getNonNullResourceString(PROPERTY_TITLE, title);
    description = getNonNullResourceString(PROPERTY_DESCRIPTION, description);

    icon = (MultiIcon) res.getRequiredObject(PROPERTY_ICON);

    vendor = getNonNullResourceString(PROPERTY_VENDOR, vendor);
    version = getNonNullResourceString(PROPERTY_VERSION, version);

    condition = getNonNullResourceString(PROPERTY_CONDITION, condition);
View Full Code Here

        {
          try
          {
            Color c = (Color) data.getTransferData(ModelerFlavors.COLOR);

            ResourceCollection res = getPluginResourceCollection();
            StringBuffer description = new StringBuffer();
            description.append(res.getOptionalString("color.red"));
            description.append(' ');
            description.append(c.getRed());
            description.append('\n');
            description.append(res.getOptionalString("color.green"));
            description.append(' ');
            description.append(c.getGreen());
            description.append('\n');
            description.append(res.getOptionalString("color.blue"));
            description.append(' ');
            description.append(c.getBlue());

            addToolBoxItem(new ToolBoxItem(res.getOptionalString("color.title"), ColorChooserPlugin.createColorDragIcon(c).getIcon(
              FlexibleSize.MEDIUM), description.toString(), new BasicTransferable(c)));
            refreshContent();
          }
          catch (UnsupportedFlavorException e)
          {
View Full Code Here

     */
    public OptionWidget createOptionWidget()
    {
      List values = new ArrayList(4);

      ResourceCollection res = getPlugin().getPluginResourceCollection();
      values.add(new LocalizableOptionString(res.getRequiredString("debugger.option.linktrace.skip"), DebuggerPlugin.LINKTRACE_SKIP));
      values.add(new LocalizableOptionString(res.getRequiredString("debugger.option.linktrace.target"), DebuggerPlugin.LINKTRACE_TARGET));
      values.add(new LocalizableOptionString(res.getRequiredString("debugger.option.linktrace.animationstop"), DebuggerPlugin.LINKTRACE_ANIMATION_STOP));
      values.add(new LocalizableOptionString(res.getRequiredString("debugger.option.linktrace.animationgo"), DebuggerPlugin.LINKTRACE_ANIMATION_GO));

      return new SelectionWidget(this, values);
    }
View Full Code Here

TOP

Related Classes of org.openbp.common.rc.ResourceCollection

Copyright © 2018 www.massapicom. 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.