org.eclipse.core.runtime.IExtensionDelta Java Examples

The following examples show how to use org.eclipse.core.runtime.IExtensionDelta. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: IDEResourcesManager.java    From typescript.java with MIT License 6 votes vote down vote up
@Override
public void registryChanged(final IRegistryChangeEvent event) {
	IExtensionDelta[] deltas = event.getExtensionDeltas(TypeScriptCorePlugin.PLUGIN_ID,
			EXTENSION_TYPESCRIPT_RESOURCE_PARTICIPANTS);
	if (deltas != null) {
		synchronized (this) {
			for (IExtensionDelta delta : deltas) {
				IConfigurationElement[] cf = delta.getExtension().getConfigurationElements();
				if (delta.getKind() == IExtensionDelta.ADDED) {
					addExtensionResourceParticipants(cf);
				} else {
					removeExtensionResourceParticipants(cf);
				}
			}
		}
	}
}
 
Example #2
Source File: IDETypeScriptRepositoryManager.java    From typescript.java with MIT License 6 votes vote down vote up
@Override
public void registryChanged(final IRegistryChangeEvent event) {
	IExtensionDelta[] deltas = event.getExtensionDeltas(TypeScriptCorePlugin.PLUGIN_ID,
			EXTENSION_TYPESCRIPT_REPOSITORIES);
	if (deltas != null) {
		synchronized (this) {
			for (IExtensionDelta delta : deltas) {
				IConfigurationElement[] cf = delta.getExtension().getConfigurationElements();
				if (delta.getKind() == IExtensionDelta.ADDED) {
					addExtensionRepositories(cf);
				} else {
					removeExtensionRepositories(cf);
				}
			}
		}
	}
}
 
Example #3
Source File: TypeScriptConsoleConnectorManager.java    From typescript.java with MIT License 6 votes vote down vote up
protected void handleTypeScriptConsoleConnectorDelta(IExtensionDelta delta) {
	if (typeScriptConsoleConnectors == null) // not loaded yet
		return;

	IConfigurationElement[] cf = delta.getExtension().getConfigurationElements();

	List<ITypeScriptConsoleConnector> list = new ArrayList<ITypeScriptConsoleConnector>(
			typeScriptConsoleConnectors);
	if (delta.getKind() == IExtensionDelta.ADDED) {
		addTypeScriptConsoleConnectors(cf, list);
	} else {
		/*
		 * int size = list.size(); ITypeScriptConsoleConfiguration[] st = new
		 * ITypeScriptConsoleConfiguration[size]; list.toArray(st); int size2 =
		 * cf.length;
		 * 
		 * for (int i = 0; i < size; i++) { for (int j = 0; j < size2; j++)
		 * { if (st[i].getId().equals(cf[j].getAttribute("id"))) {
		 * st[i].dispose(); list.remove(st[i]); } } }
		 */
	}
	typeScriptConsoleConnectors = list;
}
 
Example #4
Source File: NodejsInstallManager.java    From typescript.java with MIT License 6 votes vote down vote up
protected void handleNodejsInstallDelta(IExtensionDelta delta) {
	if (nodeJSInstalls == null) // not loaded yet
		return;

	IConfigurationElement[] cf = delta.getExtension().getConfigurationElements();

	List<IEmbeddedNodejs> list = new ArrayList<IEmbeddedNodejs>(nodeJSInstalls);
	if (delta.getKind() == IExtensionDelta.ADDED) {
		addNodejsInstalls(cf, list);
	} else {
		int size = list.size();
		NodejsInstall[] st = new NodejsInstall[size];
		list.toArray(st);
		int size2 = cf.length;

		for (int i = 0; i < size; i++) {
			for (int j = 0; j < size2; j++) {
				if (st[i].getId().equals(cf[j].getAttribute("id"))) {
					st[i].dispose();
					list.remove(st[i]);
				}
			}
		}
	}
	nodeJSInstalls = list;
}
 
Example #5
Source File: DNDService.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public void registryChanged( IRegistryChangeEvent event )
{
	IExtensionDelta[] deltas = event.getExtensionDeltas( "org.eclipse.birt.report.designer.ui", //$NON-NLS-1$
			"DNDServices" ); //$NON-NLS-1$
	for ( int i = 0; i < deltas.length; i++ )
	{
		if ( deltas[i].getKind( ) == IExtensionDelta.ADDED )
		{
			addRegistry( deltas[i].getExtensionPoint( ) );
		}
		else if ( deltas[i].getKind( ) == IExtensionDelta.REMOVED )
		{
			removeRegistry( deltas[i].getExtensionPoint( ) );
		}
	}
}
 
Example #6
Source File: TypeScriptConsoleConnectorManager.java    From typescript.java with MIT License 5 votes vote down vote up
@Override
public void registryChanged(final IRegistryChangeEvent event) {
	IExtensionDelta[] deltas = event.getExtensionDeltas(TypeScriptCorePlugin.PLUGIN_ID,
			EXTENSION_TYPESCRIPT_CONSOLE_CONNECTORS);
	if (deltas != null) {
		for (IExtensionDelta delta : deltas)
			handleTypeScriptConsoleConnectorDelta(delta);
	}
}
 
Example #7
Source File: NodejsInstallManager.java    From typescript.java with MIT License 5 votes vote down vote up
@Override
public void registryChanged(final IRegistryChangeEvent event) {
	IExtensionDelta[] deltas = event.getExtensionDeltas(TypeScriptCorePlugin.PLUGIN_ID, EXTENSION_NODEJS_INSTALLS);
	if (deltas != null) {
		for (IExtensionDelta delta : deltas)
			handleNodejsInstallDelta(delta);
	}
}
 
Example #8
Source File: CustomPopupMenuExtender.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void registryChanged(final IRegistryChangeEvent event) {
    Display display = Display.getDefault();
    if (part != null) {
        display = part.getSite().getPage().getWorkbenchWindow().getWorkbench().getDisplay();
    }
    //check the delta to see if there are any viewer contribution changes.  if so, null our builder to cause reparsing on the next menu show
    IExtensionDelta[] deltas = event.getExtensionDeltas();
    for (IExtensionDelta delta : deltas) {
        IExtensionPoint extensionPoint = delta.getExtensionPoint();
        if (extensionPoint.getContributor().getName().equals(WorkbenchPlugin.PI_WORKBENCH)
                && extensionPoint.getSimpleIdentifier().equals(
                        IWorkbenchRegistryConstants.PL_POPUP_MENU)) {

            boolean clearPopups = false;
            IConfigurationElement[] elements = delta.getExtension().getConfigurationElements();
            for (IConfigurationElement element : elements) {
                if (element.getName().equals(IWorkbenchRegistryConstants.TAG_VIEWER_CONTRIBUTION)) {
                    clearPopups = true;
                    break;
                }
            }

            if (clearPopups) {
                display.syncExec(() -> clearStaticActions());
            }
        }
    }
}