Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/ExecutableExtension.java')
-rw-r--r--launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/ExecutableExtension.java65
1 files changed, 0 insertions, 65 deletions
diff --git a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/ExecutableExtension.java b/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/ExecutableExtension.java
deleted file mode 100644
index eb27d3d2898..00000000000
--- a/launch/org.eclipse.cdt.launchbar.core/src/org/eclipse/cdt/launchbar/core/internal/ExecutableExtension.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2014 QNX Software Systems and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Doug Schaefer
- *******************************************************************************/
-package org.eclipse.cdt.launchbar.core.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-
-/**
- * A wrapper class that delays instantiation of classes until they're needed
- * to prevent early plug-in loading.
- *
- * @param <T> the type of the object created
- */
-public class ExecutableExtension<T> {
-
- private IConfigurationElement element;
- private String propertyName;
- private T object;
-
- public ExecutableExtension(IConfigurationElement element, String propertyName) {
- this.element = element;
- this.propertyName = propertyName;
- }
-
- // For testing, pre-populate the object
- public ExecutableExtension(T object) {
- this.object = object;
- }
-
- /**
- * Get the object instantiating it if necessary.
- * @return object
- * @throws CoreException
- */
- @SuppressWarnings("unchecked")
- public T get() throws CoreException {
- if (element != null) {
- object = (T) element.createExecutableExtension(propertyName);
- element = null;
- propertyName = null;
- }
- return object;
- }
-
- /**
- * Creates a new object. Can't be done if you've done a get already.
- * @return a new object from the extension or null if get was called earlier
- * @throws CoreException
- */
- @SuppressWarnings("unchecked")
- public T create() throws CoreException {
- if (element != null) {
- return (T) element.createExecutableExtension(propertyName);
- }
- return null;
- }
-}

Back to the top