当前位置: 首页>>代码示例>>Java>>正文


Java IDEWorkbenchPlugin类代码示例

本文整理汇总了Java中org.eclipse.ui.internal.ide.IDEWorkbenchPlugin的典型用法代码示例。如果您正苦于以下问题:Java IDEWorkbenchPlugin类的具体用法?Java IDEWorkbenchPlugin怎么用?Java IDEWorkbenchPlugin使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDEWorkbenchPlugin类属于org.eclipse.ui.internal.ide包,在下文中一共展示了IDEWorkbenchPlugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: resourceExistsInWorkspace

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Return true if another project having the same project name exists in
 * workspace
 */
private boolean resourceExistsInWorkspace() {
	boolean existsInWorkspace = false;
	if (!getProjectName().isEmpty()) {
		IProject[] projects = IDEWorkbenchPlugin.getPluginWorkspace()
				.getRoot().getProjects();
		for (int i = 0; i < projects.length && !existsInWorkspace; i++) {
			if (getProjectName().toUpperCase().equals(
					projects[i].getName().toUpperCase())
					&& isMacOrWindowsOS()) {
				setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage);
				existsInWorkspace = true;
			} else {
				if (getProjectName().equals(projects[i].getName())) {
					setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage);
					return true;
				}
			}
		}
	}
	return existsInWorkspace;
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:26,代码来源:NewGemocModelingProjectCreationWizardPage.java

示例2: updatePinActionToolbar

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Update the pin action's tool bar
 */
void updatePinActionToolbar() {

	ICoolBarManager coolBarManager = getActionBarConfigurer()
			.getCoolBarManager();
	IContributionItem cbItem = coolBarManager
			.find(IWorkbenchActionConstants.TOOLBAR_NAVIGATE);
	if (!(cbItem instanceof IToolBarContributionItem)) {
		// This should not happen
		IDEWorkbenchPlugin
				.log("Navigation toolbar contribution item is missing"); //$NON-NLS-1$
		return;
	}
	IToolBarContributionItem toolBarItem = (IToolBarContributionItem) cbItem;
	IToolBarManager toolBarManager = toolBarItem.getToolBarManager();
	if (toolBarManager == null) {
		// error if this happens, navigation toolbar assumed to always exist
		IDEWorkbenchPlugin.log("Navigate toolbar is missing"); //$NON-NLS-1$
		return;
	}

	toolBarManager.update(false);
	toolBarItem.update(ICoolBarManager.SIZE);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:27,代码来源:ApplicationActionBarAdvisor.java

示例3: makeFeatureDependentActions

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Creates the feature-dependent actions for the menu bar.
 */
private void makeFeatureDependentActions(final IWorkbenchWindow window) {
	final AboutInfo[] infos = null;

	final IPreferenceStore prefs = IDEWorkbenchPlugin.getDefault().getPreferenceStore();

	// Optimization: avoid obtaining the about infos if the platform state is
	// unchanged from last time. See bug 75130 for details.
	final String stateKey = "platformState"; //$NON-NLS-1$
	final String prevState = prefs.getString(stateKey);
	final String currentState = String.valueOf(Platform.getStateStamp());
	final boolean sameState = currentState.equals(prevState);
	if ( !sameState ) {
		prefs.putValue(stateKey, currentState);
	}
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:19,代码来源:GamaActionBarAdvisor.java

示例4: queryNewResourceName

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Return the new name to be given to the target resource.
 *
 * @return java.lang.String
 * @param resource
 *            the resource to query status on
 */
protected String queryNewResourceName(final IResource resource) {
	final IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace();
	final IPath prefix = resource.getFullPath().removeLastSegments(1);
	final IInputValidator validator = string -> {
		if (resource.getName()
				.equals(string)) { return IDEWorkbenchMessages.RenameResourceAction_nameMustBeDifferent; }
		final IStatus status = workspace.validateName(string, resource.getType());
		if (!status.isOK()) { return status.getMessage(); }
		if (workspace.getRoot()
				.exists(prefix.append(string))) { return IDEWorkbenchMessages.RenameResourceAction_nameExists; }
		return null;
	};

	final InputDialog dialog =
			new InputDialog(WorkbenchHelper.getShell(), IDEWorkbenchMessages.RenameResourceAction_inputDialogTitle,
					IDEWorkbenchMessages.RenameResourceAction_inputDialogMessage, resource.getName(), validator);
	dialog.setBlockOnOpen(true);
	final int result = dialog.open();
	if (result == Window.OK)
		return dialog.getValue();
	return null;
}
 
开发者ID:gama-platform,项目名称:gama,代码行数:30,代码来源:RenameResourceAction.java

示例5: activateProxyService

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Activate the proxy service by obtaining it.
 */
@SuppressWarnings(
{"rawtypes", "unchecked"})
private void activateProxyService()
{
  Bundle bundle = Platform.getBundle("org.eclipse.ui.ide"); //$NON-NLS-1$
  Object proxyService = null;
  if (bundle != null)
  {
    ServiceReference ref =
        bundle.getBundleContext().getServiceReference(
            IProxyService.class.getName());
    if (ref != null)
    {
      proxyService = bundle.getBundleContext().getService(ref);
    }
  }
  if (proxyService == null)
  {
    IDEWorkbenchPlugin.log("Proxy service could not be found."); //$NON-NLS-1$
  }
}
 
开发者ID:debrief,项目名称:limpet,代码行数:25,代码来源:ApplicationWorkbenchAdvisor.java

示例6: postShutdown

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
public void postShutdown()
{
  if (activityHelper != null)
  {
    activityHelper.shutdown();
    activityHelper = null;
  }
  if (idleHelper != null)
  {
    idleHelper.shutdown();
    idleHelper = null;
  }
  if (workspaceUndoMonitor != null)
  {
    workspaceUndoMonitor.shutdown();
    workspaceUndoMonitor = null;
  }
  if (IDEWorkbenchPlugin.getPluginWorkspace() != null)
  {
    disconnectFromWorkspace();
  }
}
 
开发者ID:debrief,项目名称:limpet,代码行数:23,代码来源:ApplicationWorkbenchAdvisor.java

示例7: createNewBundleGroupsMap

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Updates the old features setting and returns a map of new features.
 */
private Map<String, AboutInfo> createNewBundleGroupsMap()
{
  // retrieve list of installed bundle groups from last session
  IDialogSettings settings =
      IDEWorkbenchPlugin.getDefault().getDialogSettings();
  String[] previousFeaturesArray = settings.getArray(INSTALLED_FEATURES);

  // get a map of currently installed bundle groups and store it for next
  // session
  Map<String, AboutInfo> bundleGroups = computeBundleGroupMap();
  String[] currentFeaturesArray = new String[bundleGroups.size()];
  bundleGroups.keySet().toArray(currentFeaturesArray);
  settings.put(INSTALLED_FEATURES, currentFeaturesArray);

  // remove the previously known from the current set
  if (previousFeaturesArray != null)
  {
    for (int i = 0; i < previousFeaturesArray.length; ++i)
    {
      bundleGroups.remove(previousFeaturesArray[i]);
    }
  }

  return bundleGroups;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:29,代码来源:ApplicationWorkbenchAdvisor.java

示例8: openIntro

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Tries to open the intro, if one exists and otherwise will open the legacy Welcome pages.
 * 
 * @see org.eclipse.ui.application.WorkbenchWindowAdvisor#openIntro()
 */
@SuppressWarnings("deprecation")
public void openIntro()
{
  if (editorsAndIntrosOpened)
  {
    return;
  }

  editorsAndIntrosOpened = true;

  // don't try to open the welcome editors if there is an intro
  if (wbAdvisor.hasIntro())
  {
    super.openIntro();
  }
  else
  {
    openWelcomeEditors(getWindowConfigurer().getWindow());
    // save any preferences changes caused by the above actions
    IDEWorkbenchPlugin.getDefault().savePluginPreferences();
  }
}
 
开发者ID:debrief,项目名称:limpet,代码行数:28,代码来源:ApplicationWorkbenchWindowAdvisor.java

示例9: dispose

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
public void dispose()
{
  if (propertyChangeListener != null)
  {
    IDEWorkbenchPlugin.getDefault().getPreferenceStore()
        .removePropertyChangeListener(propertyChangeListener);
    propertyChangeListener = null;
  }

  if (openPerspectiveAction != null)
  {
    openPerspectiveAction.dispose();
    openPerspectiveAction = null;
  }
  super.dispose();
}
 
开发者ID:debrief,项目名称:limpet,代码行数:17,代码来源:ApplicationWorkbenchWindowAdvisor.java

示例10: updatePinActionToolbar

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Update the pin action's tool bar
 */
void updatePinActionToolbar()
{

  ICoolBarManager coolBarManager =
      getActionBarConfigurer().getCoolBarManager();
  IContributionItem cbItem =
      coolBarManager.find(IWorkbenchActionConstants.TOOLBAR_NAVIGATE);
  if (!(cbItem instanceof IToolBarContributionItem))
  {
    // This should not happen
    IDEWorkbenchPlugin.log("Navigation toolbar contribution item is missing"); //$NON-NLS-1$
    return;
  }
  IToolBarContributionItem toolBarItem = (IToolBarContributionItem) cbItem;
  IToolBarManager toolBarManager = toolBarItem.getToolBarManager();
  if (toolBarManager == null)
  {
    // error if this happens, navigation toolbar assumed to always exist
    IDEWorkbenchPlugin.log("Navigate toolbar is missing"); //$NON-NLS-1$
    return;
  }

  toolBarManager.update(false);
  toolBarItem.update(ICoolBarManager.SIZE);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:29,代码来源:ApplicationActionBarAdvisor.java

示例11: validatePage

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
protected boolean validatePage() {
  	canFinish=false;	
  	   getShell().setText(Messages.CREATEPROJECTWIZARD);
      IWorkspace workspace = IDEWorkbenchPlugin.getPluginWorkspace();

      String projectFieldContents = getProjectNameFieldValue();
      if (projectFieldContents.equals("")) {
          setErrorMessage(null);
          setMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectNameEmpty);
          return false;
      }

      IStatus nameStatus = workspace.validateName(projectFieldContents,
              IResource.PROJECT);
      if (!nameStatus.isOK()) {
          setErrorMessage(nameStatus.getMessage());
          return false;
      }
     
      IProject handle = getProjectHandle();
      if (handle.exists()) {
          setErrorMessage(IDEWorkbenchMessages.WizardNewProjectCreationPage_projectExistsMessage);
          return false;
      }
return dialogChanged();
  }
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:27,代码来源:NewUZProjectWizardPage.java

示例12: ImportProjectWizard

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
    * Constructor for ExternalProjectImportWizard.
    * 
    * @param initialPath Default path for wizard to import
    * @since 3.5
    */
public ImportProjectWizard(String initialPath)
   {
       super();
       this.initialPath = initialPath;
       setWindowTitle(DataTransferMessages.DataTransfer_importTitle);
       setNeedsProgressMonitor(true);
       IDialogSettings workbenchSettings = IDEWorkbenchPlugin.getDefault()
       		.getDialogSettings();
       
	IDialogSettings wizardSettings = workbenchSettings
	        .getSection(IMPORT_PROJECT_SECTION);
	if (wizardSettings == null) {
		wizardSettings = workbenchSettings
	            .addNewSection(IMPORT_PROJECT_SECTION);
	}
	setDialogSettings(wizardSettings);        
   }
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:24,代码来源:ImportProjectWizard.java

示例13: validate

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
public IStatus validate(Object[] selection) {
	int nSelected = selection.length;
	String pluginId = IDEWorkbenchPlugin.IDE_WORKBENCH;

	if (nSelected == 0 || (nSelected > 1 && multiSelect == false)) {
		return new Status(IStatus.ERROR, pluginId, IStatus.ERROR,
				IDEResourceInfoUtils.EMPTY_STRING, null);
	}
	for (int i = 0; i < selection.length; i++) {
		Object curr = selection[i];
		if (curr instanceof IFileStore) {
			IFileStore file = (IFileStore) curr;
			if (acceptFolders == false
					&& file.fetchInfo().isDirectory()) {
				return new Status(IStatus.ERROR, pluginId,
						IStatus.ERROR,
						IDEResourceInfoUtils.EMPTY_STRING, null);
			}

		}
	}
	return Status.OK_STATUS;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:24,代码来源:FileFolderSelectionDialog.java

示例14: initialize

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
@Override
public void initialize(IWorkbenchConfigurer configurer) {
	super.initialize(configurer);
	
     configurer.setSaveAndRestore(true);
     PlatformUI.getPreferenceStore().setValue(
            IWorkbenchPreferenceConstants.SHOW_TRADITIONAL_STYLE_TABS, false);
     

	// inserted: register workbench adapters
	IDE.registerAdapters();

	// inserted: register images for rendering explorer view
	final String ICONS_PATH = "icons/full/";
	final String PATH_OBJECT = ICONS_PATH + "obj16/";
	Bundle ideBundle = Platform.getBundle(IDEWorkbenchPlugin.IDE_WORKBENCH);
	declareWorkbenchImage(configurer, ideBundle,
		IDE.SharedImages.IMG_OBJ_PROJECT, PATH_OBJECT + "prj_obj.gif", true);
	declareWorkbenchImage(configurer, ideBundle,
		IDE.SharedImages.IMG_OBJ_PROJECT_CLOSED, PATH_OBJECT + "cprj_obj.gif", true);
}
 
开发者ID:CloudScale-Project,项目名称:Environment,代码行数:22,代码来源:ApplicationWorkbenchAdvisor.java

示例15: buildFileStores

import org.eclipse.ui.internal.ide.IDEWorkbenchPlugin; //导入依赖的package包/类
/**
 * Build the collection of fileStores that map to fileNames. If any of them
 * cannot be found then match then return <code>null</code>.
 *
 * @param uris
 * @return IFileStore[]
 */
private IFileStore[] buildFileStores(URI[] uris) {
    IFileStore[] stores = new IFileStore[uris.length];
    for (int i = 0; i < uris.length; i++) {
        IFileStore store;
        try {
            store = EFS.getStore(uris[i]);
        } catch (CoreException e) {
            IDEWorkbenchPlugin.log(e.getMessage(), e);
            reportFileInfoNotFound(uris[i].toString());
            return null;
        }
        if (store == null) {
            reportFileInfoNotFound(uris[i].toString());
            return null;
        }
        stores[i] = store;
    }
    return stores;

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:28,代码来源:CopyFilesAndFoldersOperation.java


注:本文中的org.eclipse.ui.internal.ide.IDEWorkbenchPlugin类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。