當前位置: 首頁>>代碼示例>>Java>>正文


Java ContainerSelectionDialog.getResult方法代碼示例

本文整理匯總了Java中org.eclipse.ui.dialogs.ContainerSelectionDialog.getResult方法的典型用法代碼示例。如果您正苦於以下問題:Java ContainerSelectionDialog.getResult方法的具體用法?Java ContainerSelectionDialog.getResult怎麽用?Java ContainerSelectionDialog.getResult使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.ui.dialogs.ContainerSelectionDialog的用法示例。


在下文中一共展示了ContainerSelectionDialog.getResult方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

private void handleBrowse() {
	ContainerSelectionDialog dialog =
		new ContainerSelectionDialog(
			getShell(),
			ResourcesPlugin.getWorkspace().getRoot(),
			false,
			"Select new file container");
	if (dialog.open() == ContainerSelectionDialog.OK) {
		Object[] result = dialog.getResult();
		if (result.length == 1) {
			containerText.setText(((Path)result[0]).toOSString());
		}
	}
}
 
開發者ID:convertigo,項目名稱:convertigo-eclipse,代碼行數:20,代碼來源:SampleNewWizardPage.java

示例2: ContainerSelectionDialog

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

/*default*/ void handleBrowse() {
    ContainerSelectionDialog dialog =
        new ContainerSelectionDialog(
            getShell(),
            ResourcesPlugin.getWorkspace().getRoot(),
            false,
            MessagesEditorPlugin.getString(
                    "editor.wiz.selectFolder")); //$NON-NLS-1$
    if (dialog.open() == Window.OK) {
        Object[] result = dialog.getResult();
        if (result.length == 1) {
            containerText.setText(((Path)result[0]).toOSString());
        }
    }
}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:21,代碼來源:ResourceBundleNewWizardPage.java

示例3: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to choose the new value for the container field.
 */

private void handleBrowse()
{
  final ContainerSelectionDialog dialog =
      new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace()
          .getRoot(), false, "Select new file container");
  if (dialog.open() == Window.OK)
  {
    final Object[] result = dialog.getResult();
    if (result.length == 1)
    {
      containerText.setText(((Path) result[0]).toString());
    }
  }
}
 
開發者ID:debrief,項目名稱:limpet,代碼行數:19,代碼來源:NewWizardPage.java

示例4: saveWitness

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
public void saveWitness(AtlProblemExplanation explanation) {
	IWitnessModel witness = explanation.getWitness();
	if ( witness != null ) {
		
		ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), null, true, "Select a folder to save the witness");
		dialog.setTitle("Container Selection");
		if ( dialog.open() == Window.OK ) {
			Resource r = witness.getModelAsOriginal();
			
			Object[] files = dialog.getResult();
			if ( files.length > 0 ) {
				String path = ResourcesPlugin.getWorkspace().getRoot().getFile(((Path) files[0]).append("witness.xmi")).getLocation().toOSString();
				try {
					r.save(new FileOutputStream(path), null);
					System.out.println("Witness saved: " + path);
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
					throw new RuntimeException(e);
				}
			}
			
		}
	}
}
 
開發者ID:anatlyzer,項目名稱:anatlyzer,代碼行數:26,代碼來源:ExplanationComposite.java

示例5: handleBrowseWorkspace

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
protected void handleBrowseWorkspace( )
{
	ContainerSelectionDialog dialog = new ContainerSelectionDialog( getControl( ).getShell( ),
			ResourcesPlugin.getWorkspace( ).getRoot( ),
			true,
			ContainerSelectionDialog_Message );
	if ( dialog.open( ) == Window.OK )
	{
		Object[] result = dialog.getResult( );
		if ( result.length == 0 )
			return;
		IPath path = (IPath) result[0];
		//fLocationText.setText("${workspace_loc:" + path.makeRelative().toString() + "}"); //$NON-NLS-1$ //$NON-NLS-2$
		notifyTextChange( "${workspace_loc:" //$NON-NLS-1$
				+ path.makeRelative( ).toString( )
				+ "}" ); //$NON-NLS-1$
	}
}
 
開發者ID:eclipse,項目名稱:birt,代碼行數:19,代碼來源:IDEResourcePageHelper.java

示例6: pyQueryDestinationResource

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
private IPath pyQueryDestinationResource() {
    // start traversal at root resource, should probably start at a
    // better location in the tree
    String title;
    if (selected.size() == 1) {
        title = "Choose destination for ''" + selected.get(0).getName() + "'':";
    } else {
        title = "Choose destination for " + selected.size() + " selected resources:";
    }
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(shellProvider.getShell(),
            selected.get(0).getParent(), true, title);
    dialog.setTitle("Move Resources");
    dialog.setValidator(this);
    dialog.showClosedProjects(false);
    dialog.open();
    Object[] result = dialog.getResult();
    if (result != null && result.length == 1) {
        return (IPath) result[0];
    }
    return null;
}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:22,代碼來源:PyMoveResourceAction.java

示例7: ContainerSelectionDialog

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to
 * choose the new value for the container field.
 */

/*default*/ void handleBrowse() {
    ContainerSelectionDialog dialog =
        new ContainerSelectionDialog(
            getShell(),
            ResourcesPlugin.getWorkspace().getRoot(),
            false,
            RBEPlugin.getString(
                    "editor.wiz.selectFolder")); //$NON-NLS-1$
    if (dialog.open() == Window.OK) {
        Object[] result = dialog.getResult();
        if (result.length == 1) {
            containerText.setText(((Path)result[0]).toOSString());
        }
    }
}
 
開發者ID:allati,項目名稱:eclipse-rbe,代碼行數:21,代碼來源:ResourceBundleNewWizardPage.java

示例8: run

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
@Override
public void run() {
    ContainerSelectionDialog dialog = new ContainerSelectionDialog(getSite().getShell(), null, false,
            "Choose folder to be analyzed in the code-coverage");
    dialog.showClosedProjects(false);
    if (dialog.open() != Window.OK) {
        return;
    }
    Object[] objects = dialog.getResult();
    if (objects.length == 1) { //only one folder can be selected
        if (objects[0] instanceof IPath) {
            IPath p = (IPath) objects[0];

            IWorkspace w = ResourcesPlugin.getWorkspace();
            IContainer folderForLocation = (IContainer) w.getRoot().findMember(p);
            setSelectedContainer(folderForLocation);
        }
    }
}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:20,代碼來源:PyCodeCoverageView.java

示例9: selectFolder

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
private void selectFolder()
{
	ContainerSelectionDialog chooser = new ContainerSelectionDialog(
			getShell(), folder, false, "Wähle ein Verzeichnis");
	chooser.showClosedProjects(false);
	if (chooser.open() != Window.OK) return;
	
	Object[] results = chooser.getResult();
	if(results.length == 1)
	{
		if(results[0] instanceof IPath)
		{
			IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
			URI uri = root.findMember((IPath)results[0]).getLocationURI();

			IContainer[] folders = root.findContainersForLocationURI(uri);
			if(folders != null && folders.length > 0)
			{
				folder = (IFolder) folders[0];
				inFolder.setText((folder != null) ? folder.getFullPath().toString() : "");
				update();
			}
		}
	}
}
 
開發者ID:TheWhiteShadow3,項目名稱:cuina,代碼行數:26,代碼來源:MapCreationPage.java

示例10: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to choose the new value for the container field.
 */

private void handleBrowse ()
{
    final ContainerSelectionDialog dialog = new ContainerSelectionDialog ( getShell (), ResourcesPlugin.getWorkspace ().getRoot (), false, "Select new file container" );
    if ( dialog.open () == Window.OK )
    {
        final Object[] result = dialog.getResult ();
        if ( result.length == 1 )
        {
            this.containerText.setText ( ( (Path)result[0] ).toString () );
        }
    }
}
 
開發者ID:eclipse,項目名稱:neoscada,代碼行數:17,代碼來源:NewArchiveWizardPage.java

示例11: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to choose the new value for
 * the container field.
 */

private void handleBrowse() {
	ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, "Select new file container");
	if (dialog.open() == ContainerSelectionDialog.OK) {
		Object[] result = dialog.getResult();
		if (result.length == 1) {
			containerText.setText(((Path) result[0]).toString());
		}
	}
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:15,代碼來源:CompImplMainPage.java

示例12: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
private void handleBrowse() {
	ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(), ResourcesPlugin.getWorkspace().getRoot(), false, "Select new file container");
	if (dialog.open() == ContainerSelectionDialog.OK) {
		Object[] result = dialog.getResult();
		if (result.length == 1) {
			containerText.setText(((Path) result[0]).toString());
		}
	}
}
 
開發者ID:dstl,項目名稱:Open_Source_ECOA_Toolset_AS5,代碼行數:10,代碼來源:TypesMainPage.java

示例13: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to choose the new value for the
 * container field.
 */
private void handleBrowse() {
	ContainerSelectionDialog dialog = new ContainerSelectionDialog(getShell(),
			ResourcesPlugin.getWorkspace().getRoot(), false,
			EditorConfigMessages.NewEditorConfigFileWizardPage_containerSelectionDialog_title);
	if (dialog.open() == ContainerSelectionDialog.OK) {
		Object[] result = dialog.getResult();
		if (result.length == 1) {
			folderText.setText(((Path) result[0]).toString());
		}
	}
}
 
開發者ID:angelozerr,項目名稱:ec4e,代碼行數:16,代碼來源:NewEditorConfigFileWizardPage.java

示例14: handleBrowse

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
/**
 * Uses the standard container selection dialog to choose the new value for
 * the container field.
 */

private void handleBrowse() {
	ContainerSelectionDialog dialog = new ContainerSelectionDialog(
			getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
			"Select new file container");
	if (dialog.open() == ContainerSelectionDialog.OK) {
		Object[] result = dialog.getResult();
		if (result.length == 1) {
			containerSourceText.setText(((Path) result[0]).toString());
		}
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:17,代碼來源:TargetHandlerDialog.java

示例15: handleBrowse2

import org.eclipse.ui.dialogs.ContainerSelectionDialog; //導入方法依賴的package包/類
private void handleBrowse2() {
	ContainerSelectionDialog dialog = new ContainerSelectionDialog(
			getShell(), ResourcesPlugin.getWorkspace().getRoot(), false,
			"Select new file container");
	if (dialog.open() == ContainerSelectionDialog.OK) {
		Object[] result = dialog.getResult();
		if (result.length == 1) {
			containerTargetText.setText(((Path) result[0]).toString());
		}
	}
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:12,代碼來源:TargetHandlerDialog.java


注:本文中的org.eclipse.ui.dialogs.ContainerSelectionDialog.getResult方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。