Skip to content
Snippets Groups Projects
Commit dc839b0f authored by Florian Hölzl's avatar Florian Hölzl
Browse files

Cleanup => YELLOW

refs 238
parent 19849407
No related branches found
No related tags found
No related merge requests found
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.utils;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.resource.ImageDescriptor;
/**
* Utility methods for handling JFace {@link Action}s.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class ActionUtils {
/** Setup an enabled action with name, tool tip, and icons. */
public static void setUpAction(Action action, String name, String toolTip,
ImageDescriptor icon, ImageDescriptor disabledIcon) {
action.setText(name);
action.setToolTipText(toolTip);
action.setEnabled(true);
action.setImageDescriptor(icon);
action.setDisabledImageDescriptor(disabledIcon);
}
}
/*--------------------------------------------------------------------------+
$Id$
| |
| Copyright 2011 ForTISS GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.utils;
import org.eclipse.jface.viewers.ColumnLabelProvider;
import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
/**
* Utility methods for JFace {@link TableViewer}s.
*
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating RED Hash:
*/
public class TableViewerUtils {
/** Creates a simple column in the table viewer. */
public static TableViewerColumn makeColumn(TableViewer viewer, int bound,
String title, String tooltip, ColumnLabelProvider labelProvider) {
final TableViewerColumn column = new TableViewerColumn(viewer, SWT.LEFT);
column.getColumn().setWidth(bound);
column.getColumn().setText(title);
column.getColumn().setToolTipText(tooltip);
column.setLabelProvider(labelProvider);
return column;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment