本文整理汇总了Java中org.pentaho.di.ui.core.gui.GUIResource类的典型用法代码示例。如果您正苦于以下问题:Java GUIResource类的具体用法?Java GUIResource怎么用?Java GUIResource使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
GUIResource类属于org.pentaho.di.ui.core.gui包,在下文中一共展示了GUIResource类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getRowForData
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
private Object[] getRowForData( TableItem item, int rowNr ) throws KettleException {
try {
Object[] row = RowDataUtil.allocateRowData( rowMeta.size() );
for ( int i = 0; i < rowMeta.size(); i++ ) {
ValueMetaInterface valueMeta = rowMeta.getValueMeta( i );
ValueMetaInterface stringValueMeta = stringRowMeta.getValueMeta( i );
int colnr = i + 1;
if ( GUIResource.getInstance().getColorBlue().equals( item.getForeground( colnr ) ) ) {
row[i] = null; // <null> value
} else {
String string = item.getText( colnr );
row[i] = valueMeta.convertDataFromString( string, stringValueMeta,
null, null, ValueMetaInterface.TRIM_TYPE_NONE );
}
}
return row;
} catch ( KettleException e ) {
throw new KettleException( BaseMessages.getString( PKG, "EditRowsDialog.Error.ErrorGettingRowForData",
Integer.toString( rowNr ) ), e );
}
}
示例2: checkWidgets
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
protected void checkWidgets() {
wtvScriptLocation.setEnabled( wbLoadScriptFile.getSelection() );
wstcScriptEditor.setEnabled( !wbLoadScriptFile.getSelection() );
if ( wbLoadScriptFile.getSelection() ) {
wtvScriptLocation.setEditable( true );
wstcScriptEditor.getStyledText().setBackground( GUIResource.getInstance().getColorDemoGray() );
} else {
wtvScriptLocation.setEditable( false );
wstcScriptEditor.getStyledText().setBackground( GUIResource.getInstance().getColorWhite() );
}
wbScriptBrowse.setEnabled( wbLoadScriptFile.getSelection() );
String currVars = wtvPyVarsToGet.getText();
if ( !Const.isEmpty( currVars ) ) {
List<String> varList = stringToList( currVars );
wbGetFields.setEnabled( varList.size() == 1 );
wbIncludeRowIndex.setEnabled( varList.size() == 1 );
}
}
示例3: init
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
/**
* Initialize the properties: load from disk.
* @param display The Display
* @param t The type of properties file.
*/
public static final void init(Display d, int t)
{
if (props==null)
{
display = d;
props = new PropsUI(t);
// Also init the colors and fonts to use...
GUIResource.getInstance();
}
else
{
throw new RuntimeException("The Properties systems settings are already initialised!");
}
}
示例4: refreshTree
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
private void refreshTree()
{
try
{
wTree.removeAll();
TreeItem ti = new TreeItem(wTree, SWT.NONE);
ti.setImage(GUIResource.getInstance().getImageFolderConnections());
ti.setExpanded(true);
RepositoryDirectoryUI.getTreeWithNames(ti, rep, dircolor, sortColumn, ascending, showTrans, showJobs, rep.getDirectoryTree());
}
catch(KettleDatabaseException e)
{
new ErrorDialog(shell, Messages.getString("SelectObjectDialog.Dialog.UnexpectedError.Title"), Messages.getString("SelectObjectDialog.Dialog.UnexpectedError.Message"), e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
示例5: minMaxExtraView
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
private void minMaxExtraView() {
// What is the state?
//
boolean maximized = sashForm.getMaximizedControl() != null;
if (maximized) {
// Minimize
//
sashForm.setMaximizedControl(null);
minMaxButton.setImage(GUIResource.getInstance().getImageMaximizePanel());
minMaxButton.setToolTipText(BaseMessages.getString(PKG, "TransGraph.ExecutionResultsPanel.MaxButton.Tooltip")); //$NON-NLS-1$
} else {
// Maximize
//
sashForm.setMaximizedControl(extraViewComposite);
minMaxButton.setImage(GUIResource.getInstance().getImageMinimizePanel());
minMaxButton.setToolTipText(BaseMessages.getString(PKG, "TransGraph.ExecutionResultsPanel.MinButton.Tooltip")); //$NON-NLS-1$
}
}
示例6: addAllTabs
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
public void addAllTabs() {
CTabItem tabItemSelection = null;
if (extraViewTabFolder!=null && !extraViewTabFolder.isDisposed()) {
tabItemSelection = extraViewTabFolder.getSelection();
}
transHistoryDelegate.addTransHistory();
transLogDelegate.addTransLog();
transGridDelegate.addTransGrid();
transPerfDelegate.addTransPerf();
if (tabItemSelection!=null) {
extraViewTabFolder.setSelection(tabItemSelection);
} else {
extraViewTabFolder.setSelection(transGridDelegate.getTransGridTab());
}
XulToolbarbutton button = (XulToolbarbutton) toolbar.getElementById("trans-show-results"); //$NON-NLS-1$
button.setTooltiptext(BaseMessages.getString(PKG, "Spoon.Tooltip.HideExecutionResults")); //$NON-NLS-1$
ToolItem toolItem = (ToolItem) button.getManagedObject();
toolItem.setImage(GUIResource.getInstance().getImageHideResults());
}
示例7: editEntryParallel
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
/**
* Go from serial to parallel to serial execution
*/
public void editEntryParallel() {
getJobEntry().setLaunchingInParallel(!getJobEntry().isLaunchingInParallel());
if (getJobEntry().isLaunchingInParallel()) {
// Show a warning (optional)
//
if ("Y".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y"))) //$NON-NLS-1$ //$NON-NLS-2$
{
MessageDialogWithToggle md = new MessageDialogWithToggle(shell, Messages
.getString("JobGraph.ParallelJobEntriesWarning.DialogTitle"), //$NON-NLS-1$
null, Messages.getString("JobGraph.ParallelJobEntriesWarning.DialogMessage", Const.CR) + Const.CR, //$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.WARNING, new String[] { Messages.getString("JobGraph.ParallelJobEntriesWarning.Option1") }, //$NON-NLS-1$
0, Messages.getString("JobGraph.ParallelJobEntriesWarning.Option2"), //$NON-NLS-1$
"N".equalsIgnoreCase(spoon.props.getCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, "Y")) //$NON-NLS-1$ //$NON-NLS-2$
);
MessageDialogWithToggle.setDefaultImage(GUIResource.getInstance().getImageSpoon());
md.open();
spoon.props.setCustomParameter(STRING_PARALLEL_WARNING_PARAMETER, md.getToggleState() ? "N" : "Y"); //$NON-NLS-1$ //$NON-NLS-2$
spoon.props.saveProps();
}
}
redraw();
}
示例8: getIcon
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
public Image getIcon(JobEntryCopy je) {
Image im = null;
if (je == null)
return null;
switch (je.getJobEntryType()) {
case SPECIAL:
if (je.isStart())
im = GUIResource.getInstance().getImageStart();
if (je.isDummy())
im = GUIResource.getInstance().getImageDummy();
break;
default:
String configId = je.getEntry().getConfigId();
if (configId != null) {
im = (Image) GUIResource.getInstance().getImagesJobentries().get(configId);
}
}
return im;
}
示例9: addAllTabs
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
public void addAllTabs() {
CTabItem tabItemSelection = null;
if (extraViewTabFolder!=null && !extraViewTabFolder.isDisposed()) {
tabItemSelection = extraViewTabFolder.getSelection();
}
jobHistoryDelegate.addJobHistory();
jobLogDelegate.addJobLog();
jobGridDelegate.addJobGrid();
if (tabItemSelection!=null) {
extraViewTabFolder.setSelection(tabItemSelection);
} else {
extraViewTabFolder.setSelection(jobGridDelegate.getJobGridTab());
}
XulToolbarButton button = toolbar.getButtonById("job-show-results");
button.setImage(GUIResource.getInstance().getImageHideResults());
button.setHint(Messages.getString("Spoon.Tooltip.HideExecutionResults"));
}
示例10: showArguments
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
public void showArguments() {
RowMetaAndData allArgs = new RowMetaAndData();
for (int ii = 0; ii < arguments.length; ++ii) {
allArgs.addValue(new ValueMeta(Props.STRING_ARGUMENT_NAME_PREFIX + (1 + ii), ValueMetaInterface.TYPE_STRING), arguments[ii]);
}
// Now ask the use for more info on these!
EnterStringsDialog esd = new EnterStringsDialog(shell, SWT.NONE, allArgs);
esd.setTitle(Messages.getString("Spoon.Dialog.ShowArguments.Title"));
esd.setMessage(Messages.getString("Spoon.Dialog.ShowArguments.Message"));
esd.setReadOnly(true);
esd.setShellImage(GUIResource.getInstance().getImageLogoSmall());
esd.open();
}
示例11: layoutEditOptionButton
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
/**
* Setting the layout of an <i>Edit</i> option button. Either a button
* image is set - if existing - or a text.
*
* @param button
* The button
*/
private FormData layoutEditOptionButton(Button button)
{
FormData fd = new FormData();
Image editButton = GUIResource.getInstance().getEditOptionButton();
if (editButton != null)
{
button.setImage(editButton);
button.setBackground(GUIResource.getInstance().getColorWhite());
fd.width = editButton.getBounds().width + 4;
fd.height = editButton.getBounds().height;
} else
{
button.setText(BaseMessages.getString(PKG, "EnterOptionsDialog.Button.Edit"));
}
button.setToolTipText(BaseMessages.getString(PKG, "EnterOptionsDialog.Button.Edit.Tooltip"));
return fd;
}
示例12: minMaxExtraView
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
private void minMaxExtraView() {
// What is the state?
//
boolean maximized = sashForm.getMaximizedControl() != null;
if (maximized) {
// Minimize
//
sashForm.setMaximizedControl(null);
minMaxButton.setImage(GUIResource.getInstance().getImageMaximizePanel());
minMaxButton.setToolTipText(Messages.getString("TransGraph.ExecutionResultsPanel.MaxButton.Tooltip"));
} else {
// Maximize
//
sashForm.setMaximizedControl(extraViewComposite);
minMaxButton.setImage(GUIResource.getInstance().getImageMinimizePanel());
minMaxButton.setToolTipText(Messages.getString("TransGraph.ExecutionResultsPanel.MinButton.Tooltip"));
}
}
示例13: addAllTabs
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
public void addAllTabs() {
CTabItem tabItemSelection = null;
if (extraViewTabFolder!=null && !extraViewTabFolder.isDisposed()) {
tabItemSelection = extraViewTabFolder.getSelection();
}
transHistoryDelegate.addTransHistory();
transLogDelegate.addTransLog();
transGridDelegate.addTransGrid();
transPerfDelegate.addTransPerf();
if (tabItemSelection!=null) {
extraViewTabFolder.setSelection(tabItemSelection);
} else {
extraViewTabFolder.setSelection(transGridDelegate.getTransGridTab());
}
XulToolbarButton button = toolbar.getButtonById("trans-show-results");
button.setImage(GUIResource.getInstance().getImageHideResults());
button.setHint(Messages.getString("Spoon.Tooltip.HideExecutionResults"));
}
示例14: drawJobEntryIcon
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
public void drawJobEntryIcon(int x, int y, JobEntryCopy jobEntryCopy) {
if (jobEntryCopy == null)
return; // Don't draw anything
Image image = null;
if (jobEntryCopy.isSpecial()) {
if (jobEntryCopy.isStart()) {
image = GUIResource.getInstance().getImageStart();
}
if (jobEntryCopy.isDummy()) {
image = GUIResource.getInstance().getImageDummy();
}
} else {
String configId = jobEntryCopy.getEntry().getPluginId();
if (configId != null) {
image = GUIResource.getInstance().getImagesJobentries().get(configId);
}
}
if (image==null) {
return;
}
org.eclipse.swt.graphics.Rectangle bounds = image.getBounds();
gc.drawImage(image, 0, 0, bounds.width, bounds.height, x, y, iconsize, iconsize);
}
示例15: layoutResetOptionButton
import org.pentaho.di.ui.core.gui.GUIResource; //导入依赖的package包/类
/**
* Setting the layout of a <i>Reset</i> option button. Either a button
* image is set - if existing - or a text.
*
* @param button
* The button
*/
private FormData layoutResetOptionButton(Button button)
{
FormData fd = new FormData();
Image editButton = GUIResource.getInstance().getResetOptionButton();
if (editButton != null)
{
button.setImage(editButton);
button.setBackground(GUIResource.getInstance().getColorWhite());
fd.width = editButton.getBounds().width + 4;
fd.height = editButton.getBounds().height;
} else
{
button.setText(Messages.getString("EnterOptionsDialog.Button.Reset"));
}
button.setToolTipText(Messages.getString("EnterOptionsDialog.Button.Reset.Tooltip"));
return fd;
}