本文整理匯總了Java中org.eclipse.ui.plugin.AbstractUIPlugin類的典型用法代碼示例。如果您正苦於以下問題:Java AbstractUIPlugin類的具體用法?Java AbstractUIPlugin怎麽用?Java AbstractUIPlugin使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
AbstractUIPlugin類屬於org.eclipse.ui.plugin包,在下文中一共展示了AbstractUIPlugin類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createFilterControls
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
protected void createFilterControls(Composite con) {
Label filterLabel = new Label(con,SWT.NONE);
filterLabel.setText("Filter:");
GridDataFactory.swtDefaults().applyTo(filterLabel);
Text filterText = new Text(con, SWT.BORDER);
filterText.setMessage("(" + PreferenceFilter.MIN_FILTER_CHARS + " chars at least)");
filterText.addModifyListener(event -> {
filterChanged(filterText.getText());
});
GridDataFactory.fillDefaults().grab(true,false).applyTo(filterText);
Button clearBtn = new Button(con, SWT.PUSH);
clearBtn.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(PrefEditorPlugin.PLUGIN_ID,"icons/clear.gif").createImage());
GridDataFactory.swtDefaults().applyTo(clearBtn);
clearBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
filterText.setText("");
filterChanged("");
}
});
}
示例2: createActions
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
private void createActions() {
newNodeAction = new NewNodeAction(this);
renameNodeAction = new RenameNodeAction(this);
deleteNodeAction = new DeleteNodeAction(this);
moveUpNodeAction = new MoveUpNodeAction(this);
moveDownNodeAction = new MoveDownNodeAction(this);
promoteNodeAction = new PromoteNodeAction(this);
demoteNodeAction = new DemoteNodeAction(this);
refreshAction = new Action() {
@Override
public void run() {
refresh();
}
};
refreshAction.setText(Messages.getString("CommonStructureControl.RefreshActionText")); //$NON-NLS-1$
refreshAction.setImageDescriptor(
AbstractUIPlugin.imageDescriptorFromPlugin(TFSCommonUIClientPlugin.PLUGIN_ID, "icons/Refresh.gif")); //$NON-NLS-1$
}
示例3: init
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
@Override
public void init(final IBuildDefinition buildDefinition) {
this.buildDefinition = buildDefinition;
setWindowTitle(Messages.getString("V1AntBuildWizard.WizardTitle")); //$NON-NLS-1$
setDefaultPageImageDescriptor(
AbstractUIPlugin.imageDescriptorFromPlugin(TFSTeamBuildPlugin.PLUGIN_ID, "icons/ant_wiz.png")); //$NON-NLS-1$
setNeedsProgressMonitor(true);
// setup default workspace.
if (buildDefinition.getWorkspace().getMappings().length == 0) {
buildDefinition.getWorkspace().map(
ServerPath.ROOT + buildDefinition.getTeamProject(),
BuildConstants.SOURCE_DIR_ENVIRONMENT_VARIABLE);
}
}
示例4: QueuedBuildsTableControl
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
/**
* Constructs a {@link QueuedBuildsTableControl}. The {@link IBuildServer}
* may be <code>null</code> (column text for a V3 build server will be
* shown); call {@link #setBuildServer(IBuildServer)} to update the control.
*
* @param buildServer
* the build server to use (may be <code>null</code>)
*/
public QueuedBuildsTableControl(
final Composite parent,
final int style,
final IBuildServer buildServer,
final String viewDataKey) {
super(parent, style, IQueuedBuild.class, viewDataKey);
this.buildServer = buildServer;
reasonHeaderImage = AbstractUIPlugin.imageDescriptorFromPlugin(
TFSTeamBuildPlugin.PLUGIN_ID,
"/icons/ColumnHeaderReason.gif").createImage(); //$NON-NLS-1$
statusHeaderImage = AbstractUIPlugin.imageDescriptorFromPlugin(
TFSTeamBuildPlugin.PLUGIN_ID,
"/icons/ColumnHeaderStatus.gif").createImage(); //$NON-NLS-1$
setupTableColumns();
setUseDefaultContentProvider();
getViewer().setSorter(createSorter());
getViewer().setLabelProvider(new LabelProvider());
setEnableTooltips(true, true);
}
示例5: SVNPluginAction
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
public SVNPluginAction(IConfigurationElement element) {
super(element.getAttribute(ATT_LABEL), getStyleFromElement(element));
this.element = element;
pluginId = element.getContributor().getName();
createDelegate();
setId(element.getAttribute(ATT_ID));
setToolTipText(element.getAttribute(ATT_TOOLTIP));
if ((getStyle() == AS_RADIO_BUTTON) || (getStyle() == AS_CHECK_BOX)) {
String bool = element.getAttribute(ATT_STATE);
setChecked("true".equals(bool)); //$NON-NLS-1$
}
String iconPath = element.getAttribute(ATT_ICON);
if ((iconPath != null) && (iconPath.length() > 0)) {
ImageDescriptor desc = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, iconPath);
if (desc != null) {
setImageDescriptor(desc);
}
}
// Give delegate a chance to adjust enable state
selectionChanged(StructuredSelection.EMPTY);
}
示例6: getImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
public static Image getImage( String pluginID, String image){
/*--- create from class file location
ImageDescriptor iDescr = ImageDescriptor.createFromFile(CoreResources.class, name);
Image image = resourceCache.getImage(iDescr);
return image;
--- get workbench shared image
IWorkbench workbench = PlatformUI.getWorkbench();
ISharedImages images = workbench.getSharedImages();
image = images.getImage(ISharedImages.IMG_OBJ_FOLDER);
--- image from plugin
MyPlugin.getImageDescriptor("icons/a_image.gif").createImage();
AbstractUIPlugin.imageDescriptorFromPlugin(myPluginID, image)).createImage();
*/
if (Utils.isIDE()) {
return resourceCache.getImage(AbstractUIPlugin.imageDescriptorFromPlugin(pluginID, image));
} else {
return resourceCache.getImage(image);
}
}
示例7: newPluginImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
/**
* Register an image from the workspace shared image pool. If the image
* resource does not exist or fails to load, a default "error" resource is
* supplied.
*
* @param name name of the image
* @param sharedName name of the shared image ({@link ISharedImages})
* @return whether the image has correctly been loaded
*/
private boolean newPluginImage(String name, String pluginId,
String filename) {
boolean success = true;
ImageDescriptor id =
AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, filename);
if (id == null) {
id = ImageDescriptor.getMissingImageDescriptor();
// id = getSharedByName(ISharedImages.IMG_OBJS_ERROR_TSK);
success = false;
}
descMap.put(name, id);
imageMap.put(name, id.createImage(true));
return success;
}
示例8: TabDescriptor
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
/**
* Constructor for TabDescriptor.
*
* @param configurationElement
* the configuration element for the tab descriptor.
*/
public TabDescriptor(IConfigurationElement configurationElement) {
super();
if (configurationElement != null) {
id = configurationElement.getAttribute(ATT_ID);
label = configurationElement.getAttribute(ATT_LABEL);
String imageString = configurationElement.getAttribute(ATT_IMAGE);
if (imageString != null) {
image = AbstractUIPlugin.imageDescriptorFromPlugin(
configurationElement.getDeclaringExtension()
.getNamespaceIdentifier(), imageString);
}
String indentedString = configurationElement.getAttribute(ATT_INDENTED);
indented = indentedString != null && indentedString.equals("true"); //$NON-NLS-1$
String scrollableString = configurationElement.getAttribute(ATT_SCROLLABLE);
scrollable= scrollableString == null || scrollableString.toLowerCase().equals("true"); //$NON-NLS-1$
category = configurationElement.getAttribute(ATT_CATEGORY);
afterTab = configurationElement.getAttribute(ATT_AFTER_TAB);
if (id == null || label == null || category == null) {
// the tab id, label and category are mandatory - log error
handleTabError(configurationElement, null);
}
}
selected = false;
}
示例9: getImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
public static Image getImage(AbstractUIPlugin plugin, String path)
{
ImageRegistry registry = plugin.getImageRegistry();
Image image = registry.get(path);
if (image == null)
{
ImageDescriptor id = getImageDescriptor(plugin.getBundle().getSymbolicName(), path);
if (id == null)
{
return null;
}
registry.put(path, id);
image = registry.get(path);
}
return image;
}
示例10: getImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
private static Image getImage(String bundleSymbolicName, String path, ImageDescriptor id)
{
String computedName = bundleSymbolicName + path;
Image image = JFaceResources.getImage(computedName);
if (image != null)
{
return image;
}
if (id == null)
{
id = AbstractUIPlugin.imageDescriptorFromPlugin(bundleSymbolicName, path);
}
if (id != null)
{
JFaceResources.getImageRegistry().put(computedName, id);
return JFaceResources.getImage(computedName);
}
return null;
}
示例11: init
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
@Override
public void init(IWorkbench workbench, IStructuredSelection currentSelection) {
this.selection = currentSelection;
setWindowTitle(NFARExportMessages.WizardTitle_export);
setDefaultPageImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(
"org.eclipse.ui.ide", "$nl$/icons/full/wizban/exportzip_wiz.png"));//$NON-NLS-1$
setNeedsProgressMonitor(true);
}
示例12: getDialogSettings
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
@Override
protected final IDialogSettings getDialogSettings() {
AbstractUIPlugin activator = getUIPlugin();
if (activator == null) {
return null;
}
return activator.getDialogSettings();
}
示例13: loadImage
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
/**
* Loads image in Image Registry is not available in it
*
* @param pluginId
* : Id of the plugin containing thie image
* @param imageFilePath
* : image File Path in plugin
* @return Image if loaded
*/
private synchronized Image loadImage(String pluginId, String imageFilePath) {
String id = pluginId + ":" + imageFilePath;
Image image = Activator.getDefault().getImageRegistry().get(id);
if (image != null)
return image;
ImageDescriptor imageDescriptor = AbstractUIPlugin.imageDescriptorFromPlugin(pluginId, imageFilePath);
if (imageDescriptor != null) {
image = imageDescriptor.createImage();
Activator.getDefault().getImageRegistry().put(pluginId + ":" + imageFilePath, image);
}
return image;
}
示例14: CSSNodeAction
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
public CSSNodeAction(
final CommonStructureControl cssControl,
final String text,
final String toolTipText,
final String iconPath) {
super(cssControl);
this.cssControl = cssControl;
setText(text);
if (toolTipText != null && toolTipText.length() > 0) {
setToolTipText(toolTipText);
}
if (iconPath != null && iconPath.length() > 0) {
setImageDescriptor(AbstractUIPlugin.imageDescriptorFromPlugin(TFSCommonUIClientPlugin.PLUGIN_ID, iconPath));
}
}
示例15: getImageDescriptor
import org.eclipse.ui.plugin.AbstractUIPlugin; //導入依賴的package包/類
public static ImageDescriptor getImageDescriptor(
final IConfigurationElement configElement,
final String attributeName,
final String extensionPointName) {
final String s = configElement.getAttribute(attributeName);
if (s == null) {
return null;
}
final String contributor = getContributorFor(configElement);
return AbstractUIPlugin.imageDescriptorFromPlugin(contributor, s);
}