/*----------------------------------------------------------------------------
Copyright (c)2000 TogetherSoft Corporation. Patents pending. All rights reserved.
----------------------------------------------------------------------------*/

package com.togethersoft.modules.inspector.customproperties;

import com.togethersoft.openapi.ide.IdeScript;
import com.togethersoft.openapi.ide.IdeContext;
import com.togethersoft.openapi.ide.inspector.IdeInspector;
import com.togethersoft.openapi.ide.inspector.IdeInspectorComponent;
import com.togethersoft.openapi.ide.inspector.IdeInspectorBuilder;
import com.togethersoft.openapi.ide.inspector.IdeInspectorManager;
import com.togethersoft.openapi.ide.inspector.IdeInspectorManagerAccess;

public class DeactivateScript implements IdeScript, IdeInspectorBuilder {
  public void run(IdeContext context) {
    IdeInspectorManager manager = IdeInspectorManagerAccess.getInspectorManager();
    manager.addInspectorBuilder(this);
  }

  public IdeInspector buildInspector(IdeContext context, IdeInspector inspector) {
    IdeInspectorComponent component = inspector.findComponent(CustomPropertiesInspectorComponent.NAME);
    if(component != null) inspector.removeComponent(component);
    return inspector;
  }
}
