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


Java Dialog.OK屬性代碼示例

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


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

示例1: getReplacementText

@Override
public String getReplacementText() {
	SelectEcoreIFileDialog dialog = new SelectEcoreIFileDialog();
	if (dialog.open() == Dialog.OK) {
		Object[] selections = dialog.getResult();
		if(selections != null 
			&& selections.length != 0
			&& selections[0] instanceof IResource 
		){
			IResource ecoreFile = (IResource) selections[0];
			ecoreProject = ecoreFile.getProject();
			String path = "/"+ecoreFile.getProject().getName() +"/"+ecoreFile.getProjectRelativePath();
			URI uri = URI.createPlatformResourceURI(path,true);
			String replacementText = "\""+uri.toString()+"\"";
			return replacementText;
		}
	}
	return "";
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:19,代碼來源:SelectEcoreProposal.java

示例2: getReplacementText

@Override
public String getReplacementText() {
	SelectAnyIProjectDialog dialog = new SelectAnyIProjectDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell());
	if (dialog.open() == Dialog.OK) {
		Object[] selections = dialog.getResult();
		if(selections != null 
			&& selections.length != 0
			&& selections[0] instanceof IProject 
		){
			dsaProject = (IProject) selections[0];
			Set<String> aspects = SequentialSingleLanguageTemplate.getAspectClassesList(dsaProject);
			final StringBuilder insertion = new StringBuilder();
			for (String asp : aspects) {
				insertion.append("\twith " + asp + "\n");
			}
			insertion.replace(0, 1, "");//remove the first \t
			return insertion.toString();
		}
	}
	
	return "";
}
 
開發者ID:eclipse,項目名稱:gemoc-studio-modeldebugging,代碼行數:22,代碼來源:SelectDsaProposal.java

示例3: chooseFile

private static final IStashing chooseFile(PersistType type) throws IOException {

		FileSelectionDialog dialog = new FileSelectionDialog(Display.getCurrent().getActiveShell(), previousFile);
		dialog.setExtensions(extensions);
		dialog.setFiles(files);
		dialog.setNewFile(type==PersistType.SAVE);
		dialog.setFolderSelector(false);
		dialog.create();
		if (dialog.open() != Dialog.OK) return null;

		String path = dialog.getPath();
		if (!path.endsWith(extensions[0])) { //should always be saved to .json
			path = path.concat("." + extensions[0]);
		}

		final File file = new File(path);
		previousFile    = file.getCanonicalPath();
		IStashing stash = ServiceHolder.getStashingService().createStash(file);
		return stash;
	}
 
開發者ID:eclipse,項目名稱:scanning,代碼行數:20,代碼來源:ModelPersistAction.java

示例4: execute

@Execute
public void execute(
		@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		@Optional TerminologyService terminologyService,
		@Optional ETerminology terminology,
		@Optional IndexedCorpus indexedCorpus
		) throws IOException {
	
	FileDialog fileDialog = new FileDialog(shell, SWT.SAVE);
	fileDialog.setText("Exporting terminology "+ TerminologyPart.toPartLabel(terminology) +" to " + formatName);
	String path = fileDialog.open();
	if(path != null) {
		if(withOptionDialog) {
			Dialog dialog = getDialog(shell);
			if(dialog.open() == Dialog.OK) 
				export(shell, terminology, getExporter(dialog), indexedCorpus, path);
		} else
			// no option dialog
			export(shell, terminology, getExporter(), indexedCorpus, path);
	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:21,代碼來源:ExportHandler.java

示例5: execute

@Execute
public void execute(
		@Optional @Named(IServiceConstants.ACTIVE_SHELL) Shell shell,
		@Optional TerminologyService terminologyService,
		@Optional ETerminoViewerConfig viewerConfig,
		@Optional MPart terminologyPart
		) {
	EList<String> viewerList = viewerConfig.getSelectedPropertyNames();
	List<Property<?>> selectedProperties = viewerList
			.stream()
			.map(s -> PropertyUtil.forName(s)).collect(Collectors.toList());
	
	SelectPropertyDialog dialog = new SelectPropertyDialog(shell, selectedProperties, p-> true, false);
	if(dialog.open() == Dialog.OK) {
		List<String> propertyNames = dialog.getSelectedPropertyNames();
		viewerList.retainAll(propertyNames);
		propertyNames.removeAll(viewerList);
		viewerList.addAll(propertyNames);
	}
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:20,代碼來源:SelectTerminologyPropertiesHandler.java

示例6: process

private void process(IFile file) {
	
	Shell activeShell = Display.getCurrent().getActiveShell();
	UIConfiguration uiConfig = prepareUIConfiguration(file);
	ConfigurationDialog dialog = new ConfigurationDialog(activeShell, uiConfig);
	
	if(dialog.open() != Dialog.OK ){
		return ;
	}
	
	if(!uiConfig.isValid()){
		return;
	}
	
	Configuration configuration = prepareConfiguraton(uiConfig);
	
	try {
		File ramlOSFile = uiConfig.getRamlFile().getLocation().toFile();
		InputStreamReader ramlReader = new InputStreamReader( new FileInputStream(ramlOSFile) );
		new GeneratorProxy().run(ramlReader, configuration,ramlOSFile.getAbsolutePath());
		uiConfig.getDstFolder().refreshLocal( IResource.DEPTH_ONE, new NullProgressMonitor() );
		
	} catch (Exception e) {
		e.printStackTrace();
	}
}
 
開發者ID:OnPositive,項目名稱:aml,代碼行數:26,代碼來源:GenerationHandler.java

示例7: openDialog

private ICoverageLaunch openDialog(ExecutionEvent event,
    List<ICoverageLaunch> launches) {
  final ListDialog dialog = new ListDialog(HandlerUtil.getActiveShell(event)) {
    @Override
    protected void configureShell(Shell shell) {
      super.configureShell(shell);
      ContextHelp.setHelp(shell, ContextHelp.DUMP_EXECUTION_DATA);
    }
  };
  dialog.setTitle(UIMessages.DumpExecutionDataDialog_title);
  dialog.setMessage(UIMessages.DumpExecutionDataDialog_message);
  dialog.setContentProvider(ArrayContentProvider.getInstance());
  dialog.setLabelProvider(new LaunchLabelProvider());
  dialog.setInput(launches);
  if (dialog.open() == Dialog.OK && dialog.getResult().length == 1) {
    return (ICoverageLaunch) dialog.getResult()[0];
  }
  return null;
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:19,代碼來源:DumpExecutionDataHandler.java

示例8: addDependency

public void addDependency() {
    if (isDBLoaded){
        ManualDepciesDialog dialog = new ManualDepciesDialog(parent.getShell(),
                manualDepciesSource, manualDepciesTarget,
                PgDatabase.listPgObjects(dbRemote.getDbObject()),
                PgDatabase.listPgObjects(dbProject.getDbObject()),
                Messages.database, Messages.ProjectEditorDiffer_project);
        if (dialog.open() == Dialog.OK) {
            manualDepciesSource = dialog.getDepciesSourceList();
            manualDepciesTarget = dialog.getDepciesTargetList();
        }
    }
}
 
開發者ID:pgcodekeeper,項目名稱:pgcodekeeper,代碼行數:13,代碼來源:ProjectEditorDiffer.java

示例9: addPreference

public void addPreference() {
	String parent = "";
	ISelection selection = viewer.getSelection();
	Object element = null;
	if (!selection.isEmpty()) {
		element = ((StructuredSelection) selection).getFirstElement();
	}
	if (element == null) {
		Object[] elements = contentProvider.getElements("");
		if (elements.length > 0) {
			element = elements[0];
		}
	}
	
	if (element != null) {		
		if (element instanceof KeyValue) {
			parent = ((KeyValue) element).getParentNode();
		} else {
			parent = String.valueOf(element);
		}
	}
	Object input = viewer.getInput();
	if (input instanceof IPreferenceProvider) {
		NewPreferenceDialog dialog =
			input instanceof PlatformPreferenceProvider?
				new NewPlatformPreferenceDialog(preferenceView.getSite().getShell(), parent, ((IPreferenceProvider) input).getNodeNames())
				:
				new NewPreferenceDialog(preferenceView.getSite().getShell(), parent, ((IPreferenceProvider) input).getNodeNames());
		if (dialog.open() == Dialog.OK) {
			parent = dialog.getParent();
			String name = dialog.getName();
			String value = dialog.getValue();
			KeyValue newElement = new KeyValue(parent, name, value);
			((IPreferenceProvider) input).add(newElement);
			refreshTree();
		}
	}
}
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:38,代碼來源:ViewerPage.java

示例10: doubleClick

@Override
public void doubleClick(DoubleClickEvent event) {
	ColumnDialog dialog = new ColumnDialog(getShell(), columnSelected, ColumnDialog.TYPE_MODIFY);
	if (dialog.open() == Dialog.OK) {
		tableViewer.refresh();
		tableViewer.setSelection(new StructuredSelection(columnSelected));
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:8,代碼來源:TableModifyWizardPage.java

示例11: execute

public void execute() {
	ColumnDialog dialog = new ColumnDialog(Display.getCurrent().getActiveShell(), column, ColumnDialog.TYPE_NEW);
	if (dialog.open() == Dialog.OK) {
		flag = true;
		column.setTable(parent);
		parent.addColumn(index, column);
	}

}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:ColumnCreateCommand.java

示例12: openDbDriverLocationDialog

private void openDbDriverLocationDialog() {
	if (currentDbDriverMetaData != null) {
		DbDriverLocationDialog dialog = new DbDriverLocationDialog(getShell(), currentDbDriverMetaData);
		if (dialog.open() == Dialog.OK) {
			currentDbDriverMetaData.setDriverLocation(dialog.getDriverLocation());
			tableViewer.refresh();
		}
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:DbToolPreferencePage.java

示例13: run

public void run() {
	int state = validateDb();
	if (getSchema() == null) {
		return;
	}
	if (state == Dialog.OK) {
		execute();
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:DatabaseAction.java

示例14: openDbDriverLocationDialog

private int openDbDriverLocationDialog(String dbType, String driverName, String driverLocation) {
	DbDriverMetaData dbDriverMetaData = new DbDriverMetaData();
	dbDriverMetaData.setDbNmae(dbType);
	dbDriverMetaData.setDriverClassName(driverName);
	dbDriverMetaData.setDriverLocation(driverLocation);
	DbDriverLocationDialog dialog = new DbDriverLocationDialog("請先配置數據庫驅動", getWorkbenchPart().getSite().getShell(), dbDriverMetaData);
	if (dialog.open() == Dialog.OK) {
		dbDriverMetaData.setDriverLocation(dialog.getDriverLocation());
		IPreferenceStore store = Activator.getDefault().getPreferenceStore();
		store.setValue(dbType, dialog.getDriverLocation());
		return attemptTestJdbcDriver(dbType, driverName, dbDriverMetaData.getDriverLocation());
	} else {
		return Dialog.CANCEL;
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:15,代碼來源:DatabaseAction.java

示例15: attemptTestJdbcDriver

private int attemptTestJdbcDriver(String dbType, String driverName, String driverLocation) {
	try {
		ClassUtils.loadJdbcDriverClass(driverName, driverLocation);
	} catch (Exception e) {
		errorMessage("Jdbc驅動加載失敗,請重新設置驅動位置!\n" + e.getMessage());
		return openDbDriverLocationDialog(dbType, driverName, driverLocation);
	}
	return Dialog.OK;
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:9,代碼來源:DatabaseAction.java


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