org-netbeans-modules-options-api

16:40:02.224 INFO  jd.cli.Main - Decompiling org-netbeans-modules-options-api.jar
package org.netbeans.api.options;

import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import org.netbeans.modules.options.CategoryModel;
import org.netbeans.modules.options.OptionsDisplayerImpl;
import org.openide.util.Mutex.Action;

class OptionsDisplayer$1
  implements Mutex.Action<Boolean>
{
  OptionsDisplayer$1(OptionsDisplayer paramOptionsDisplayer, String paramString1, String paramString2) {}
  
  public Boolean run()
  {
    Boolean localBoolean = Boolean.valueOf(OptionsDisplayer.access$000(this$0).isOpen());
    boolean bool = !localBoolean.booleanValue();
    if (bool)
    {
      bool = Arrays.asList(CategoryModel.getInstance().getCategoryIDs()).contains(val$categoryId);
      if (!bool) {
        OptionsDisplayer.access$100().warning("Unknown categoryId: " + val$categoryId);
      }
    }
    else
    {
      OptionsDisplayer.access$100().warning("Options Dialog is opened");
    }
    if (bool) {
      OptionsDisplayer.access$000(this$0).showOptionsDialog(val$categoryId, val$subpath);
    }
    return Boolean.valueOf(bool);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.api.options.OptionsDisplayer.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.api.options;

import java.awt.Component;
import java.awt.Cursor;
import javax.swing.JFrame;
import org.netbeans.modules.options.OptionsDisplayerImpl;
import org.openide.awt.StatusDisplayer;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;

final class OptionsDisplayer$2
  implements Runnable
{
  public void run()
  {
    JFrame localJFrame = (JFrame)WindowManager.getDefault().getMainWindow();
    localJFrame.getGlassPane().setCursor(Cursor.getPredefinedCursor(3));
    localJFrame.getGlassPane().setVisible(true);
    StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(OptionsDisplayerImpl.class, "CTL_Loading_Options"));
  }
}

/* Location:
 * Qualified Name:     org.netbeans.api.options.OptionsDisplayer.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.api.options;

import java.awt.Component;
import javax.swing.JFrame;
import org.openide.awt.StatusDisplayer;
import org.openide.windows.WindowManager;

final class OptionsDisplayer$3
  implements Runnable
{
  public void run()
  {
    StatusDisplayer.getDefault().setStatusText("");
    JFrame localJFrame = (JFrame)WindowManager.getDefault().getMainWindow();
    localJFrame.getGlassPane().setVisible(false);
    localJFrame.getGlassPane().setCursor(null);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.api.options.OptionsDisplayer.3
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.api.options;

import java.awt.Component;
import java.awt.Cursor;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;
import javax.swing.JFrame;
import org.netbeans.modules.options.CategoryModel;
import org.netbeans.modules.options.OptionsDisplayerImpl;
import org.openide.awt.StatusDisplayer;
import org.openide.util.Mutex;
import org.openide.util.Mutex.Action;
import org.openide.util.NbBundle;
import org.openide.windows.WindowManager;

public final class OptionsDisplayer
{
  private static final OptionsDisplayer INSTANCE = new OptionsDisplayer();
  private final OptionsDisplayerImpl impl = new OptionsDisplayerImpl(false);
  private static Logger log = Logger.getLogger(OptionsDisplayer.class.getName());
  public static final String ADVANCED = "Advanced";
  
  public static OptionsDisplayer getDefault()
  {
    return INSTANCE;
  }
  
  public boolean open()
  {
    showWaitCursor();
    return open(CategoryModel.getInstance().getCurrentCategoryID());
  }
  
  public boolean open(String paramString)
  {
    log.fine("Open Options Dialog: " + paramString);
    showWaitCursor();
    try
    {
      return openImpl(paramString);
    }
    finally
    {
      hideWaitCursor();
    }
  }
  
  private boolean openImpl(String paramString)
  {
    if (paramString == null)
    {
      log.warning("Category to open is null.");
      return false;
    }
    final String str1 = paramString.indexOf('/') == -1 ? paramString : paramString.substring(0, paramString.indexOf('/'));
    final String str2 = paramString.indexOf('/') == -1 ? null : paramString.substring(paramString.indexOf('/') + 1);
    Boolean localBoolean = (Boolean)Mutex.EVENT.readAccess(new Mutex.Action()
    {
      public Boolean run()
      {
        Boolean localBoolean = Boolean.valueOf(impl.isOpen());
        boolean bool = !localBoolean.booleanValue();
        if (bool)
        {
          bool = Arrays.asList(CategoryModel.getInstance().getCategoryIDs()).contains(str1);
          if (!bool) {
            OptionsDisplayer.log.warning("Unknown categoryId: " + str1);
          }
        }
        else
        {
          OptionsDisplayer.log.warning("Options Dialog is opened");
        }
        if (bool) {
          impl.showOptionsDialog(str1, str2);
        }
        return Boolean.valueOf(bool);
      }
    });
    return localBoolean.booleanValue();
  }
  
  private static void showWaitCursor()
  {
    Mutex.EVENT.readAccess(new Runnable()
    {
      public void run()
      {
        JFrame localJFrame = (JFrame)WindowManager.getDefault().getMainWindow();
        localJFrame.getGlassPane().setCursor(Cursor.getPredefinedCursor(3));
        localJFrame.getGlassPane().setVisible(true);
        StatusDisplayer.getDefault().setStatusText(NbBundle.getMessage(OptionsDisplayerImpl.class, "CTL_Loading_Options"));
      }
    });
  }
  
  private static void hideWaitCursor()
  {
    Mutex.EVENT.readAccess(new Runnable()
    {
      public void run()
      {
        StatusDisplayer.getDefault().setStatusText("");
        JFrame localJFrame = (JFrame)WindowManager.getDefault().getMainWindow();
        localJFrame.getGlassPane().setVisible(false);
        localJFrame.getGlassPane().setCursor(null);
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.netbeans.api.options.OptionsDisplayer
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import org.netbeans.spi.options.AdvancedOption;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.Exceptions;

public class AdvancedOptionImpl
  extends AdvancedOption
{
  private String displayName;
  private String tooltip;
  private String keywords;
  private Callable<OptionsPanelController> controller;
  private String keywordsCategory;
  
  public AdvancedOptionImpl(Callable<OptionsPanelController> paramCallable, String paramString1, String paramString2, String paramString3, String paramString4)
  {
    controller = paramCallable;
    displayName = paramString1;
    tooltip = paramString2;
    keywords = paramString3;
    keywordsCategory = paramString4;
  }
  
  public String getDisplayName()
  {
    return displayName;
  }
  
  public String getTooltip()
  {
    return tooltip;
  }
  
  public Map<String, Set<String>> getKeywordsByCategory()
  {
    if ((keywordsCategory != null) && (keywords != null)) {
      return Collections.singletonMap(keywordsCategory, new HashSet(Arrays.asList(keywords.split(","))));
    }
    return Collections.emptyMap();
  }
  
  public OptionsPanelController create()
  {
    try
    {
      return (OptionsPanelController)controller.call();
    }
    catch (Exception localException)
    {
      Exceptions.printStackTrace(localException);
    }
    return new TabbedController("<error>");
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.AdvancedOptionImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.util.ArrayList;
import java.util.List;
import org.openide.util.Lookup;

class CategoryModel$1
  implements Runnable
{
  CategoryModel$1(CategoryModel paramCategoryModel) {}
  
  public void run()
  {
    String[] arrayOfString = this$0.getCategoryIDs();
    ArrayList localArrayList = new ArrayList();
    for (int i = 0; i < arrayOfString.length; i++)
    {
      CategoryModel.Category localCategory = this$0.getCategory(arrayOfString[i]);
      Lookup localLookup = CategoryModel.Category.access$000(localCategory);
      assert (localLookup != null);
      if (localLookup != Lookup.EMPTY) {
        localArrayList.add(localLookup);
      }
    }
    CategoryModel.MasterLookup.access$200(CategoryModel.access$100(this$0), localArrayList);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.CategoryModel.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.netbeans.spi.options.OptionsCategory;
import org.openide.util.RequestProcessor.Task;

class CategoryModel$2
  implements Runnable
{
  CategoryModel$2(CategoryModel paramCategoryModel) {}
  
  public void run()
  {
    Map localMap = CategoryModel.access$300(this$0);
    LinkedHashMap localLinkedHashMap = new LinkedHashMap();
    for (Iterator localIterator = localMap.entrySet().iterator(); localIterator.hasNext();)
    {
      Map.Entry localEntry = (Map.Entry)localIterator.next();
      OptionsCategory localOptionsCategory = (OptionsCategory)localEntry.getValue();
      String str = (String)localEntry.getKey();
      CategoryModel.Category localCategory = new CategoryModel.Category(this$0, str, localOptionsCategory, null);
      localLinkedHashMap.put(localCategory.getID(), localCategory);
    }
    CategoryModel.access$500(this$0).clear();
    CategoryModel.access$500(this$0).putAll(localLinkedHashMap);
    CategoryModel.access$600(this$0).schedule(0);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.CategoryModel.2
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.beans.PropertyChangeListener;
import javax.swing.Icon;
import javax.swing.JComponent;
import org.netbeans.spi.options.OptionsCategory;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;

final class CategoryModel$Category
{
  private OptionsCategory category;
  private OptionsPanelController controller;
  private boolean isUpdated;
  private JComponent component;
  private Lookup lookup;
  private final String id;
  
  private CategoryModel$Category(CategoryModel paramCategoryModel, String paramString, OptionsCategory paramOptionsCategory)
  {
    category = paramOptionsCategory;
    id = paramString;
  }
  
  boolean isCurrent()
  {
    return getID().equals(this$0.getCurrentCategoryID());
  }
  
  boolean isHighlited()
  {
    return getID().equals(this$0.getHighlitedCategoryID());
  }
  
  private void setCurrent()
  {
    this$0.setCurrentCategoryID(getID());
  }
  
  public void setCurrentSubcategory(String paramString)
  {
    OptionsPanelControllerAccessor.getDefault().setCurrentSubcategory(create(), paramString);
  }
  
  private void setHighlited(boolean paramBoolean)
  {
    if (paramBoolean) {
      CategoryModel.access$1502(this$0, getID());
    } else {
      CategoryModel.access$1502(this$0, CategoryModel.access$1600());
    }
  }
  
  public Icon getIcon()
  {
    return category.getIcon();
  }
  
  public String getID()
  {
    return id;
  }
  
  public String getCategoryName()
  {
    return category.getCategoryName();
  }
  
  private synchronized OptionsPanelController create()
  {
    if (controller == null) {
      controller = category.create();
    }
    return controller;
  }
  
  final void update(PropertyChangeListener paramPropertyChangeListener, boolean paramBoolean)
  {
    if (((!isUpdated) && (!paramBoolean)) || ((isUpdated) && (paramBoolean)))
    {
      isUpdated = true;
      getComponent();
      create().update();
      if (paramPropertyChangeListener != null) {
        create().addPropertyChangeListener(paramPropertyChangeListener);
      }
    }
  }
  
  private void applyChanges()
  {
    if (isUpdated) {
      create().applyChanges();
    }
    isUpdated = false;
  }
  
  private void cancel()
  {
    if (isUpdated) {
      create().cancel();
    }
    isUpdated = false;
  }
  
  private boolean isValid()
  {
    boolean bool = true;
    if (isUpdated) {
      bool = create().isValid();
    }
    return bool;
  }
  
  private boolean isChanged()
  {
    boolean bool = false;
    if (isUpdated) {
      bool = create().isChanged();
    }
    return bool;
  }
  
  public JComponent getComponent()
  {
    if (component == null) {
      component = create().getComponent(CategoryModel.access$100(this$0));
    }
    return component;
  }
  
  private HelpCtx getHelpCtx()
  {
    return create().getHelpCtx();
  }
  
  private Lookup getLookup()
  {
    if (lookup == null) {
      lookup = create().getLookup();
    }
    return lookup;
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.CategoryModel.Category
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.util.List;
import org.openide.util.Lookup;
import org.openide.util.Lookup.Template;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.lookup.ProxyLookup;

class CategoryModel$MasterLookup
  extends ProxyLookup
{
  private CategoryModel$MasterLookup(CategoryModel paramCategoryModel) {}
  
  private void setLookups(List<Lookup> paramList)
  {
    setLookups((Lookup[])paramList.toArray(new Lookup[paramList.size()]));
  }
  
  protected void beforeLookup(Lookup.Template paramTemplate)
  {
    super.beforeLookup(paramTemplate);
    CategoryModel.access$600(this$0).waitFinished();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.CategoryModel.MasterLookup
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.beans.PropertyChangeListener;
import java.lang.ref.Reference;
import java.lang.ref.WeakReference;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import javax.swing.Icon;
import javax.swing.JComponent;
import org.netbeans.spi.options.OptionsCategory;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.HelpCtx;
import org.openide.util.Lookup;
import org.openide.util.Lookup.Item;
import org.openide.util.Lookup.Result;
import org.openide.util.Lookup.Template;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;
import org.openide.util.RequestProcessor;
import org.openide.util.RequestProcessor.Task;
import org.openide.util.lookup.Lookups;
import org.openide.util.lookup.ProxyLookup;

public final class CategoryModel
  implements LookupListener
{
  private static final RequestProcessor RP = new RequestProcessor("org.netbeans.modules.options.CategoryModel");
  private static Reference<CategoryModel> INSTANCE = new WeakReference(new CategoryModel());
  private static String currentCategoryID = null;
  private String highlitedCategoryID = null;
  private boolean categoriesValid = true;
  private final Map<String, Category> id2Category = Collections.synchronizedMap(new LinkedHashMap());
  private MasterLookup masterLookup;
  static final String OD_LAYER_FOLDER_NAME = "OptionsDialog";
  private Lookup.Result<OptionsCategory> result;
  
  Set<Map.Entry<String, Category>> getCategories()
  {
    return id2Category.entrySet();
  }
  
  private final RequestProcessor.Task masterLookupTask = RP.create(new Runnable()
  {
    public void run()
    {
      String[] arrayOfString = getCategoryIDs();
      ArrayList localArrayList = new ArrayList();
      for (int i = 0; i < arrayOfString.length; i++)
      {
        CategoryModel.Category localCategory = getCategory(arrayOfString[i]);
        Lookup localLookup = localCategory.getLookup();
        assert (localLookup != null);
        if (localLookup != Lookup.EMPTY) {
          localArrayList.add(localLookup);
        }
      }
      CategoryModel.access$100(CategoryModel.this).setLookups(localArrayList);
    }
  }, true);
  private final RequestProcessor.Task categoryTask = RP.create(new Runnable()
  {
    public void run()
    {
      Map localMap = CategoryModel.this.loadOptionsCategories();
      LinkedHashMap localLinkedHashMap = new LinkedHashMap();
      for (Iterator localIterator = localMap.entrySet().iterator(); localIterator.hasNext();)
      {
        Map.Entry localEntry = (Map.Entry)localIterator.next();
        OptionsCategory localOptionsCategory = (OptionsCategory)localEntry.getValue();
        String str = (String)localEntry.getKey();
        CategoryModel.Category localCategory = new CategoryModel.Category(CategoryModel.this, str, localOptionsCategory, null);
        localLinkedHashMap.put(localCategory.getID(), localCategory);
      }
      id2Category.clear();
      id2Category.putAll(localLinkedHashMap);
      masterLookupTask.schedule(0);
    }
  }, true);
  
  private CategoryModel()
  {
    categoryTask.schedule(0);
  }
  
  public static CategoryModel getInstance()
  {
    CategoryModel localCategoryModel = (CategoryModel)INSTANCE.get();
    if (localCategoryModel == null)
    {
      localCategoryModel = new CategoryModel();
      INSTANCE = new WeakReference(localCategoryModel);
    }
    return localCategoryModel;
  }
  
  boolean needsReinit()
  {
    synchronized (CategoryModel.class)
    {
      return !categoriesValid;
    }
  }
  
  boolean isInitialized()
  {
    return categoryTask.isFinished();
  }
  
  boolean isLookupInitialized()
  {
    return masterLookupTask.isFinished();
  }
  
  void waitForInitialization()
  {
    categoryTask.waitFinished();
  }
  
  public String getCurrentCategoryID()
  {
    return verifyCategoryID(currentCategoryID);
  }
  
  public void setCurrentCategoryID(String paramString)
  {
    currentCategoryID = verifyCategoryID(paramString);
  }
  
  String getHighlitedCategoryID()
  {
    return verifyCategoryID(highlitedCategoryID);
  }
  
  private String verifyCategoryID(String paramString)
  {
    String str = findCurrentCategoryID(paramString) != -1 ? paramString : null;
    if (str == null)
    {
      String[] arrayOfString = getCategoryIDs();
      if (arrayOfString.length > 0) {
        str = paramString = arrayOfString[0];
      }
    }
    return str;
  }
  
  private int findCurrentCategoryID(String paramString)
  {
    return paramString == null ? -1 : Arrays.asList(getCategoryIDs()).indexOf(paramString);
  }
  
  public String[] getCategoryIDs()
  {
    categoryTask.waitFinished();
    Set localSet = id2Category.keySet();
    return (String[])localSet.toArray(new String[localSet.size()]);
  }
  
  Category getCurrent()
  {
    String str = getCurrentCategoryID();
    return str == null ? null : getCategory(str);
  }
  
  void setCurrent(Category paramCategory)
  {
    paramCategory.setCurrent();
  }
  
  void setHighlited(Category paramCategory, boolean paramBoolean)
  {
    paramCategory.setHighlited(paramBoolean);
  }
  
  HelpCtx getHelpCtx()
  {
    Category localCategory = getCurrent();
    return localCategory == null ? null : localCategory.getHelpCtx();
  }
  
  void update(PropertyChangeListener paramPropertyChangeListener, boolean paramBoolean)
  {
    String[] arrayOfString = getCategoryIDs();
    for (int i = 0; i < arrayOfString.length; i++)
    {
      Category localCategory = getCategory(arrayOfString[i]);
      localCategory.update(paramPropertyChangeListener, paramBoolean);
    }
  }
  
  void save()
  {
    String[] arrayOfString = getCategoryIDs();
    for (int i = 0; i < arrayOfString.length; i++)
    {
      Category localCategory = getCategory(arrayOfString[i]);
      localCategory.applyChanges();
    }
  }
  
  void cancel()
  {
    String[] arrayOfString = getCategoryIDs();
    for (int i = 0; i < arrayOfString.length; i++)
    {
      Category localCategory = getCategory(arrayOfString[i]);
      localCategory.cancel();
    }
  }
  
  boolean dataValid()
  {
    boolean bool = true;
    String[] arrayOfString = getCategoryIDs();
    for (int i = 0; (bool) && (i < arrayOfString.length); i++)
    {
      Category localCategory = getCategory(arrayOfString[i]);
      bool = localCategory.isValid();
    }
    return bool;
  }
  
  boolean isChanged()
  {
    boolean bool = false;
    String[] arrayOfString = getCategoryIDs();
    for (int i = 0; (!bool) && (i < arrayOfString.length); i++)
    {
      Category localCategory = getCategory(arrayOfString[i]);
      bool = localCategory.isChanged();
    }
    return bool;
  }
  
  Category getNextCategory()
  {
    int i = findCurrentCategoryID(getCurrentCategoryID());
    String[] arrayOfString = getCategoryIDs();
    String str = "";
    if ((i >= 0) && (i < arrayOfString.length) && (arrayOfString.length > 0))
    {
      if (i + 1 < arrayOfString.length) {
        str = arrayOfString[(i + 1)];
      } else {
        str = arrayOfString[0];
      }
    }
    else {
      str = null;
    }
    return str != null ? getCategory(str) : null;
  }
  
  Category getPreviousCategory()
  {
    int i = findCurrentCategoryID(getCurrentCategoryID());
    String[] arrayOfString = getCategoryIDs();
    String str = "";
    if ((i >= 0) && (i < arrayOfString.length) && (arrayOfString.length > 0))
    {
      if (i - 1 >= 0) {
        str = arrayOfString[(i - 1)];
      } else {
        str = arrayOfString[(arrayOfString.length - 1)];
      }
    }
    else {
      str = null;
    }
    return str != null ? getCategory(str) : null;
  }
  
  Category getCategory(String paramString)
  {
    categoryTask.waitFinished();
    return (Category)id2Category.get(paramString);
  }
  
  private MasterLookup getMasterLookup()
  {
    if (masterLookup == null) {
      masterLookup = new MasterLookup(null);
    }
    return masterLookup;
  }
  
  private Map<String, OptionsCategory> loadOptionsCategories()
  {
    Lookup localLookup = Lookups.forPath("OptionsDialog");
    if (result != null) {
      result.removeLookupListener(this);
    }
    result = localLookup.lookup(new Lookup.Template(OptionsCategory.class));
    result.addLookupListener(this);
    LinkedHashMap localLinkedHashMap = new LinkedHashMap();
    for (Iterator localIterator = result.allItems().iterator(); localIterator.hasNext();)
    {
      Lookup.Item localItem = (Lookup.Item)localIterator.next();
      localLinkedHashMap.put(localItem.getId().substring("OptionsDialog".length() + 1), localItem.getInstance());
    }
    return Collections.unmodifiableMap(localLinkedHashMap);
  }
  
  public void resultChanged(LookupEvent paramLookupEvent)
  {
    synchronized (CategoryModel.class)
    {
      categoriesValid = false;
      OptionsDisplayerImpl.lookupListener.resultChanged(paramLookupEvent);
      INSTANCE = new WeakReference(new CategoryModel());
    }
  }
  
  final class Category
  {
    private OptionsCategory category;
    private OptionsPanelController controller;
    private boolean isUpdated;
    private JComponent component;
    private Lookup lookup;
    private final String id;
    
    private Category(String paramString, OptionsCategory paramOptionsCategory)
    {
      category = paramOptionsCategory;
      id = paramString;
    }
    
    boolean isCurrent()
    {
      return getID().equals(getCurrentCategoryID());
    }
    
    boolean isHighlited()
    {
      return getID().equals(getHighlitedCategoryID());
    }
    
    private void setCurrent()
    {
      setCurrentCategoryID(getID());
    }
    
    public void setCurrentSubcategory(String paramString)
    {
      OptionsPanelControllerAccessor.getDefault().setCurrentSubcategory(create(), paramString);
    }
    
    private void setHighlited(boolean paramBoolean)
    {
      if (paramBoolean) {
        highlitedCategoryID = getID();
      } else {
        highlitedCategoryID = CategoryModel.currentCategoryID;
      }
    }
    
    public Icon getIcon()
    {
      return category.getIcon();
    }
    
    public String getID()
    {
      return id;
    }
    
    public String getCategoryName()
    {
      return category.getCategoryName();
    }
    
    private synchronized OptionsPanelController create()
    {
      if (controller == null) {
        controller = category.create();
      }
      return controller;
    }
    
    final void update(PropertyChangeListener paramPropertyChangeListener, boolean paramBoolean)
    {
      if (((!isUpdated) && (!paramBoolean)) || ((isUpdated) && (paramBoolean)))
      {
        isUpdated = true;
        getComponent();
        create().update();
        if (paramPropertyChangeListener != null) {
          create().addPropertyChangeListener(paramPropertyChangeListener);
        }
      }
    }
    
    private void applyChanges()
    {
      if (isUpdated) {
        create().applyChanges();
      }
      isUpdated = false;
    }
    
    private void cancel()
    {
      if (isUpdated) {
        create().cancel();
      }
      isUpdated = false;
    }
    
    private boolean isValid()
    {
      boolean bool = true;
      if (isUpdated) {
        bool = create().isValid();
      }
      return bool;
    }
    
    private boolean isChanged()
    {
      boolean bool = false;
      if (isUpdated) {
        bool = create().isChanged();
      }
      return bool;
    }
    
    public JComponent getComponent()
    {
      if (component == null) {
        component = create().getComponent(CategoryModel.this.getMasterLookup());
      }
      return component;
    }
    
    private HelpCtx getHelpCtx()
    {
      return create().getHelpCtx();
    }
    
    private Lookup getLookup()
    {
      if (lookup == null) {
        lookup = create().getLookup();
      }
      return lookup;
    }
  }
  
  private class MasterLookup
    extends ProxyLookup
  {
    private MasterLookup() {}
    
    private void setLookups(List<Lookup> paramList)
    {
      setLookups((Lookup[])paramList.toArray(new Lookup[paramList.size()]));
    }
    
    protected void beforeLookup(Lookup.Template paramTemplate)
    {
      super.beforeLookup(paramTemplate);
      masterLookupTask.waitFinished();
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.CategoryModel
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.awt.Image;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.concurrent.Callable;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import org.netbeans.spi.options.OptionsCategory;
import org.netbeans.spi.options.OptionsPanelController;
import org.openide.util.Exceptions;
import org.openide.util.ImageUtilities;

public class OptionsCategoryImpl
  extends OptionsCategory
{
  private String title;
  private String categoryName;
  private String iconBase;
  private ImageIcon icon;
  private Callable<OptionsPanelController> controller;
  private String keywords;
  private String keywordsCategory;
  private String advancedOptionsFolder;
  
  public OptionsCategoryImpl(String paramString1, String paramString2, String paramString3, Callable<OptionsPanelController> paramCallable, String paramString4, String paramString5, String paramString6)
  {
    title = paramString1;
    categoryName = paramString2;
    iconBase = paramString3;
    controller = paramCallable;
    advancedOptionsFolder = paramString6;
    keywords = paramString4;
    keywordsCategory = paramString5;
  }
  
  public Icon getIcon()
  {
    if (icon == null)
    {
      Image localImage = ImageUtilities.loadImage(iconBase);
      if (localImage != null) {
        return new ImageIcon(localImage);
      }
      localImage = ImageUtilities.loadImage(iconBase + ".png");
      if (localImage != null) {
        return new ImageIcon(localImage);
      }
      localImage = ImageUtilities.loadImage(iconBase + ".gif");
      if (localImage == null) {
        return null;
      }
      icon = new ImageIcon(localImage);
    }
    return icon;
  }
  
  public String getCategoryName()
  {
    return categoryName;
  }
  
  public String getTitle()
  {
    return title;
  }
  
  public OptionsPanelController create()
  {
    if (advancedOptionsFolder != null) {
      return new TabbedController(advancedOptionsFolder);
    }
    try
    {
      return (OptionsPanelController)controller.call();
    }
    catch (Exception localException)
    {
      Exceptions.printStackTrace(localException);
    }
    return new TabbedController("<error>");
  }
  
  final Map<String, Set<String>> getKeywordsByCategory()
  {
    if ((keywordsCategory != null) && (keywords != null)) {
      return Collections.singletonMap(keywordsCategory, new HashSet(Arrays.asList(keywords.split(","))));
    }
    return Collections.emptyMap();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsCategoryImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

class OptionsDisplayerImpl$1 {}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import org.openide.filesystems.FileAttributeEvent;
import org.openide.filesystems.FileChangeListener;
import org.openide.filesystems.FileEvent;
import org.openide.filesystems.FileRenameEvent;

class OptionsDisplayerImpl$DefaultFSListener
  implements FileChangeListener
{
  private OptionsDisplayerImpl$DefaultFSListener(OptionsDisplayerImpl paramOptionsDisplayerImpl) {}
  
  public void fileRenamed(FileRenameEvent paramFileRenameEvent)
  {
    OptionsDisplayerImpl.access$700(this$0);
  }
  
  public void fileChanged(FileEvent paramFileEvent)
  {
    OptionsDisplayerImpl.access$700(this$0);
  }
  
  public void fileFolderCreated(FileEvent paramFileEvent)
  {
    OptionsDisplayerImpl.access$700(this$0);
  }
  
  public void fileDataCreated(FileEvent paramFileEvent)
  {
    OptionsDisplayerImpl.access$700(this$0);
  }
  
  public void fileDeleted(FileEvent paramFileEvent)
  {
    OptionsDisplayerImpl.access$700(this$0);
  }
  
  public void fileAttributeChanged(FileAttributeEvent paramFileAttributeEvent)
  {
    OptionsDisplayerImpl.access$700(this$0);
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.DefaultFSListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.awt.Dialog;
import java.lang.ref.WeakReference;
import org.openide.util.LookupEvent;
import org.openide.util.LookupListener;

class OptionsDisplayerImpl$LookupListenerImpl
  implements LookupListener
{
  public void resultChanged(LookupEvent paramLookupEvent)
  {
    synchronized (OptionsDisplayerImpl.lookupListener)
    {
      OptionsDisplayerImpl.access$602(new WeakReference(null));
      if (OptionsDisplayerImpl.access$300() != null)
      {
        OptionsDisplayerImpl.access$300().setVisible(false);
        OptionsDisplayerImpl.access$302(null);
      }
    }
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.LookupListenerImpl
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.awt.Dialog;
import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;
import java.lang.ref.WeakReference;
import java.util.logging.Logger;
import java.util.prefs.Preferences;
import javax.swing.JButton;
import org.openide.util.NbPreferences;

class OptionsDisplayerImpl$MyWindowListener
  implements WindowListener
{
  private OptionsPanel optionsPanel;
  private Dialog originalDialog;
  
  OptionsDisplayerImpl$MyWindowListener(OptionsDisplayerImpl paramOptionsDisplayerImpl, OptionsPanel paramOptionsPanel)
  {
    optionsPanel = paramOptionsPanel;
    originalDialog = OptionsDisplayerImpl.access$300();
  }
  
  public void windowClosing(WindowEvent paramWindowEvent)
  {
    if (OptionsDisplayerImpl.access$300() == null) {
      return;
    }
    OptionsDisplayerImpl.access$200().fine("Options Dialog - windowClosing ");
    optionsPanel.cancel();
    OptionsDisplayerImpl.access$500(this$0).setEnabled(true);
    if (originalDialog == OptionsDisplayerImpl.access$300()) {
      OptionsDisplayerImpl.access$302(null);
    }
  }
  
  public void windowClosed(WindowEvent paramWindowEvent)
  {
    optionsPanel.storeUserSize();
    
    NbPreferences.forModule(OptionsDisplayerImpl.class).putInt("OptionsX", originalDialog.getX());
    NbPreferences.forModule(OptionsDisplayerImpl.class).putInt("OptionsY", originalDialog.getY());
    if (optionsPanel.needsReinit()) {
      synchronized (OptionsDisplayerImpl.lookupListener)
      {
        OptionsDisplayerImpl.access$602(new WeakReference(null));
      }
    }
    if (originalDialog == OptionsDisplayerImpl.access$300()) {
      OptionsDisplayerImpl.access$302(null);
    }
    OptionsDisplayerImpl.access$200().fine("Options Dialog - windowClosed");
  }
  
  public void windowDeactivated(WindowEvent paramWindowEvent) {}
  
  public void windowOpened(WindowEvent paramWindowEvent) {}
  
  public void windowIconified(WindowEvent paramWindowEvent) {}
  
  public void windowDeiconified(WindowEvent paramWindowEvent) {}
  
  public void windowActivated(WindowEvent paramWindowEvent) {}
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.MyWindowListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.util.logging.Logger;
import org.netbeans.api.options.OptionsDisplayer;

class OptionsDisplayerImpl$OpenOptionsListener$1$1
  implements Runnable
{
  OptionsDisplayerImpl$OpenOptionsListener$1$1(OptionsDisplayerImpl.OpenOptionsListener.1 param1) {}
  
  public void run()
  {
    OptionsDisplayerImpl.access$200().fine("Options Dialog - Back to modern.");
    
    OptionsDisplayer.getDefault().open();
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.OpenOptionsListener.1.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import org.netbeans.api.options.OptionsDisplayer;

class OptionsDisplayerImpl$OpenOptionsListener$1
  implements Runnable
{
  OptionsDisplayerImpl$OpenOptionsListener$1(OptionsDisplayerImpl.OpenOptionsListener paramOpenOptionsListener) {}
  
  public void run()
  {
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        OptionsDisplayerImpl.access$200().fine("Options Dialog - Back to modern.");
        
        OptionsDisplayer.getDefault().open();
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.OpenOptionsListener.1
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import org.netbeans.api.options.OptionsDisplayer;
import org.openide.util.RequestProcessor;

class OptionsDisplayerImpl$OpenOptionsListener
  implements ActionListener
{
  OptionsDisplayerImpl$OpenOptionsListener(OptionsDisplayerImpl paramOptionsDisplayerImpl) {}
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    RequestProcessor.getDefault().post(new Runnable()
    {
      public void run()
      {
        SwingUtilities.invokeLater(new Runnable()
        {
          public void run()
          {
            OptionsDisplayerImpl.access$200().fine("Options Dialog - Back to modern.");
            
            OptionsDisplayer.getDefault().open();
          }
        });
      }
    });
  }
}

/* Location:
 * Qualified Name:     org.netbeans.modules.options.OptionsDisplayerImpl.OpenOptionsListener
 * Java Class Version: 6 (50.0)
 * JD-Core Version:    0.7.1
 */
package org.netbeans.modules.options;

import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.logging.Logger;
import javax.swing.JButton;
import org.netbeans.modules.options.classic.OptionsAction;
import org.netbeans.modules.options.export.OptionsChooserPanel;
import org.openide.DialogDescriptor;
import org.openide.DialogDisplayer;
import org.openide.NotifyDescriptor;
import org.openide.NotifyDescriptor.Confirmation;
import org.openide.util.Exceptions;
import org.openide.util.actions.CallableSystemAction;
import org.openide.util.actions.SystemAction;

class OptionsDisplayerImpl$OptionsPanelListener
  implements PropertyChangeListener, ActionListener
{
  private DialogDescriptor descriptor;
  private OptionsPanel optionsPanel;
  private JButton bOK;
  private JButton bClassic;
  private JButton btnExport;
  private JButton btnImport;
  
  OptionsDisplayerImpl$OptionsPanelListener(OptionsDisplayerImpl paramOptionsDisplayerImpl, DialogDescriptor paramDialogDescriptor, OptionsPanel paramOptionsPanel, JButton paramJButton1, JButton paramJButton2, JButton paramJButton3, JButton paramJButton4)
  {
    descriptor = paramDialogDescriptor;
    optionsPanel = paramOptionsPanel;
    bOK = paramJButton1;
    bClassic = paramJButton2;
    btnExport = paramJButton3;
    btnImport = paramJButton4;
  }
  
  public void propertyChange(PropertyChangeEvent paramPropertyChangeEvent)
  {
    if (paramPropertyChangeEvent.getPropertyName().equals("buranhelpCtx")) {
      descriptor.setHelpCtx(optionsPanel.getHelpCtx());
    } else if (paramPropertyChangeEvent.getPropertyName().equals("buranvalid")) {
      bOK.setEnabled(optionsPanel.dataValid());
    }
  }
  
  public void actionPerformed(ActionEvent paramActionEvent)
  {
    if (!this$0.isOpen()) {
      return;
    }
    Dialog localDialog;
    if (paramActionEvent.getSource() == bOK)
    {
      OptionsDisplayerImpl.access$200().fine("Options Dialog - Ok pressed.");
      localDialog = OptionsDisplayerImpl.access$300();
      OptionsDisplayerImpl.access$302(null);
      optionsPanel.save();
      localDialog.dispose();
    }
    else if ((paramActionEvent.getSource() == DialogDescriptor.CANCEL_OPTION) || (paramActionEvent.getSource() == DialogDescriptor.CLOSED_OPTION))
    {
      OptionsDisplayerImpl.access$200().fine("Options Dialog - Cancel pressed.");
      localDialog = OptionsDisplayerImpl.access$300();
      OptionsDisplayerImpl.access$302(null);
      optionsPanel.cancel();
      bOK.setEnabled(true);
      localDialog.dispose();
    }
    else if (paramActionEvent.getSource() == bClassic)
    {
      OptionsDisplayerImpl.access$200().fine("Options Dialog - Classic pressed.");
      localDialog = OptionsDisplayerImpl.access$300();
      OptionsDisplayerImpl.access$302(null);
      Object localObject1;
      if (optionsPanel.isChanged())
      {
        localObject1 = new NotifyDescriptor.Confirmation(OptionsDisplayerImpl.access$400("CTL_Some_values_changed"), 1, 3);
        
        Object localObject2 = DialogDisplayer.getDefault().notify((NotifyDescriptor)localObject1);
        if (localObject2 == NotifyDescriptor.YES_OPTION)
        {
          optionsPanel.save();
          localDialog.dispose();
        }
        else if (localObject2
1 2 3 4 5 6 7 8 9 10

Further reading...

For more information on Java 1.5 Tiger, you may find Java 1.5 Tiger, A developer's Notebook by D. Flanagan and B. McLaughlin from O'Reilly of interest.

New!JAR listings


Copyright 2006-2017. Infinite Loop Ltd